Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iskandr/honeycomb
https://github.com/iskandr/honeycomb
Last synced: 23 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/iskandr/honeycomb
- Owner: iskandr
- Created: 2013-06-19T17:23:28.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-06-19T19:53:51.000Z (over 11 years ago)
- Last Synced: 2024-10-15T20:25:35.313Z (2 months ago)
- Language: Python
- Homepage: https://github.com
- Size: 165 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
HoneyComb
=========### Data Parallel Bytecode for Simpler GPU Programming
Examples:
---------Adding two vectors:
```
n = DIM a0 0
PARFOR n
offset = MUL_SCALAR idx.x vecsize
v0 = LOAD a0 offset
v1 = LOAD a1 offset
IADD v1 v0
STORE v1 a1 s0
```Naive matrix multiply:
```
n = DIM a0 0
m = DIM a1 1
PARFOR n, m
k = DIM a0 1
FOR_OFFSETS(k, offset)
v0 = LOAD_ROW a0 idx.x offset
v1 = LOAD_COL a1 idx.y offset
IMUL v1 v0
total = SUM v1
STORE_SCALAR_2D total a2 idx.x idx.y
```Tree-structured parallel sum of a 1D vector using an outermost loop:
```
b = CONST 1
WHILE b
n_full = DIM a0 0
n_small = DIV n vecsize
a1 = ALLOC n_small
PARFOR n_full BY vecsize
v0 = LOAD a0 idx.x
total = SUM v0
i = DIV_SCALAR idx.x vecsize
STORE_SCALAR total a1 i
b = GT n_small 1
a0 = a1
res = LOAD_SCALAR a0 0
RETURN res
```Or, more pleasantly, using a global reduce:
```
n = DIM a0 0
REDUCE n
v0 = LOAD a0 idx.x
total = SUM v0
return total
```