summaryrefslogtreecommitdiff
path: root/global_id2d.cl
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2012-03-13 14:40:22 -0400
committerTom Stellard <thomas.stellard@amd.com>2012-03-13 14:40:22 -0400
commit82c794dc5e393bbd3fdea7300b41336a7f574a9d (patch)
tree393c4465a6c7280b8e780a0419004a364c185648 /global_id2d.cl
parent5534a6e31678de2aa37d6ff4f8c9b9b8229100c9 (diff)
Add get-global-id2d
Diffstat (limited to 'global_id2d.cl')
-rw-r--r--global_id2d.cl9
1 files changed, 9 insertions, 0 deletions
diff --git a/global_id2d.cl b/global_id2d.cl
new file mode 100644
index 0000000..08f9fd8
--- /dev/null
+++ b/global_id2d.cl
@@ -0,0 +1,9 @@
+__kernel void global_id2d(__global int * out)
+{
+ unsigned x = get_global_id(0);
+ unsigned y = get_global_id(1);
+ unsigned id = (y * 10) + x;
+
+ out[id] = id;
+
+}