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.0.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.0.tar.gz.
File metadata
- Download URL: wave_gpu-0.1.0.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 |
577c722556ff1c85e5c530e341cf7f26aa951921c1095a1213f8e649680a5542
|
|
| MD5 |
d2f09ab680b5fe26a9a0a74b0bc4b510
|
|
| BLAKE2b-256 |
4f5d116005116cc115878b9cfdb65056130f69dec34efa6eb2277d1617687029
|
File details
Details for the file wave_gpu-0.1.0-py3-none-any.whl.
File metadata
- Download URL: wave_gpu-0.1.0-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 |
40626749f519f95146e9bb28adcd52e7aae0cc156a479e71eb399a0daec081b9
|
|
| MD5 |
565fdc9d8727b5c77915b83b8b52a982
|
|
| BLAKE2b-256 |
78b0cb952c10b80d2102c45360b0c4715610411d06f19c4d27ce8aa50887fb4f
|