From be8921d0192095b8c4a0c3a7dfcdd7a75dee682b Mon Sep 17 00:00:00 2001 From: Alex D Date: Sat, 5 Dec 2026 21:37:07 +0000 Subject: [PATCH] Change kernel annotation and update example code Updated kernel annotation and modified example to use floating-point numbers and console logging. --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 ] } ```