summaryrefslogtreecommitdiff
path: root/examples/gpu/cuda_vector_add.zc
diff options
context:
space:
mode:
authorZuhaitz <zuhaitz.zechhub@gmail.com>2026-01-26 00:39:31 +0000
committerGitHub <noreply@github.com>2026-01-26 00:39:31 +0000
commitca08979910e5a234a2423e4448ad0e284bf4f508 (patch)
treee09702f7b0850feb00a6af7f315bff7448c2ed26 /examples/gpu/cuda_vector_add.zc
parent6bef876bf900458a36260ca3fe96e23b06749d74 (diff)
parent97d0583c92c733aa8497a99f5267d50151f6e965 (diff)
Merge pull request #132 from Burnett01/fix/var-const-remains-in-examples
Housekeeping: Fix var/const remains in examples and docs
Diffstat (limited to 'examples/gpu/cuda_vector_add.zc')
-rw-r--r--examples/gpu/cuda_vector_add.zc4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/gpu/cuda_vector_add.zc b/examples/gpu/cuda_vector_add.zc
index d1f896a..534950d 100644
--- a/examples/gpu/cuda_vector_add.zc
+++ b/examples/gpu/cuda_vector_add.zc
@@ -15,7 +15,7 @@ fn add_kernel(a: float*, b: float*, c: float*, n: int) {
}
fn main() {
- const N = 1024;
+ def N = 1024;
"=> Zen C CUDA Vector Addition";
"-> Vector size: {N} elements";
@@ -43,7 +43,7 @@ fn main() {
cuda_copy_to_device(d_a, h_a, N * sizeof(float));
cuda_copy_to_device(d_b, h_b, N * sizeof(float));
- const BLOCK_SIZE = 256;
+ def BLOCK_SIZE = 256;
let num_blocks = (N + BLOCK_SIZE - 1) / BLOCK_SIZE;
"-> Launching: {num_blocks} blocks x {BLOCK_SIZE} threads";