summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--loop.cl3
1 files changed, 2 insertions, 1 deletions
diff --git a/loop.cl b/loop.cl
index 0d2c1b8..3379e9e 100644
--- a/loop.cl
+++ b/loop.cl
@@ -1,8 +1,9 @@
__kernel void loop(__global int * out, int iterations)
{
unsigned i;
+ unsigned base = get_global_id(0) * iterations;
for (i = 0; i < iterations; i++) {
- unsigned id = (get_global_id(0) * iterations) + i;
+ unsigned id = (base + i);
out[id] = id;
}
}