diff --git a/README.md b/README.md index 0c1031d9e..f516dd204 100644 --- a/README.md +++ b/README.md @@ -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 ] } ```