Python-to-MLIR compiler for GPU kernel development and mathematical computing
Project description
Oven Language
A Python-to-MLIR compiler for GPU kernel development.
Installation
pip install oven-language
Quick Start
import oven.language as ol
def vector_add(a_ptr: ol.ptr, b_ptr: ol.ptr, c_ptr: ol.ptr):
bsize = ol.get_bdim_x()
bid = ol.get_bid_x()
tid = ol.get_tid_x()
idx = (bid * bsize + tid) * 4
x_value = ol.vload(a_ptr, idx)
y_value = ol.vload(b_ptr, idx)
z_value = x_value + y_value
ol.vstore(z_value, c_ptr, idx)
Compile to MLIR:
oven kernel.py
Key Functions
- Thread/Block IDs:
ol.get_tid_x(),ol.get_bid_x() - Memory:
ol.load(),ol.store(),ol.vload(),ol.vstore() - Math:
ol.exp(),ol.log(),ol.sin(),ol.sigmoid() - GPU:
ol.barrier(),ol.smem()
Links
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
oven_language-0.1.8.tar.gz
(17.1 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 oven_language-0.1.8.tar.gz.
File metadata
- Download URL: oven_language-0.1.8.tar.gz
- Upload date:
- Size: 17.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2adf4c6e726dabb53bb1e4296905610a9a222d8e640ba8a77f25fd5fafc8a1e2
|
|
| MD5 |
7d216c2ef9ccb1d93f3e9c5004559694
|
|
| BLAKE2b-256 |
33c43321e5a2b5656520f49f007a674dd6059075767fd8f8b311f41233270d64
|
File details
Details for the file oven_language-0.1.8-py3-none-any.whl.
File metadata
- Download URL: oven_language-0.1.8-py3-none-any.whl
- Upload date:
- Size: 12.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6dd9aabb8e720c7ac32de29aa6d83d7c5987ff4a7c36241afa45956355709d94
|
|
| MD5 |
5c9907ee7859ed0422aa80c35fbef0f3
|
|
| BLAKE2b-256 |
6a849ed1c9f9f056fcfbe49cab755b58247d3b38590cc00f82746bb39a8c301d
|