Write GPU kernels in Python, run on any GPU
Project description
WAVE Python SDK
Write GPU kernels in Python, run on any GPU.
Install
pip install wave-gpu
Usage
import wave_gpu
@wave_gpu.kernel
def vector_add(a: wave_gpu.f32[:], b: wave_gpu.f32[:], out: wave_gpu.f32[:], n: wave_gpu.u32):
gid = wave_gpu.thread_id()
if gid < n:
out[gid] = a[gid] + b[gid]
a = wave_gpu.array([1.0, 2.0, 3.0, 4.0])
b = wave_gpu.array([5.0, 6.0, 7.0, 8.0])
out = wave_gpu.zeros(4)
vector_add(a, b, out, len(a))
print(out.to_list()) # [6.0, 8.0, 10.0, 12.0]
License
Apache 2.0 - see LICENSE
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wave_gpu-0.1.2.tar.gz
(7.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wave_gpu-0.1.2.tar.gz.
File metadata
- Download URL: wave_gpu-0.1.2.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8807f38532b0fa56230905b54de72a72c37de7e083401088d46a6dfd9d44913
|
|
| MD5 |
7fca2015d4ec367409e5370e6d7cf28c
|
|
| BLAKE2b-256 |
470b0298c304f90716a1e512d22001bf7e08de1d2c82a23a4aa81cf86de05842
|
File details
Details for the file wave_gpu-0.1.2-py3-none-any.whl.
File metadata
- Download URL: wave_gpu-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d39dc7a60713560d8cd3a039ad1890d4e0cb79c77dd09fd6d104771511787956
|
|
| MD5 |
05f17ef01c1666d150fd6b3e3bdb6c90
|
|
| BLAKE2b-256 |
e4d6d3d0fe8235a8df8d637a29e4c7f13d5723b88931cc990466b33075745e1f
|