Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,17 @@ both from executables and from the JIT. No GPU SDK is needed to compile or to ru
the GPU's driver itself.

```typescript
@kernel
@gpu
function add(i: int, a: number[], b: number[], c: number[]) {
c[i] = a[i] + b[i];
}

function main() {
const a: number[] = [1, 2, 3];
const b: number[] = [10, 20, 30];
const c: number[] = [0, 0, 0];
gpuLaunch(add, 3, a, b, c);
print(c); // [ 11, 22, 33 ]
const a = [1.0, 2.0, 3.0];
const b = [10.0, 20.0, 30.0];
const c = [0.0, 0.0, 0.0];
add(3, a, b, c);
console.log(c); // [ 11.0, 22.0, 33.0 ]
}
```

Expand Down
Loading