summaryrefslogtreecommitdiff
path: root/r600/lib
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2012-03-12 13:36:48 -0400
committerTom Stellard <thomas.stellard@amd.com>2012-06-01 09:03:19 -0400
commitfa147b7e9c203bb0a5bbec9d1eb403ed5ef0be78 (patch)
treee543a305ad99a3fc76c1f816f2a62c8fbadfb675 /r600/lib
parent257a3ba282147a947c8e0e5540d299cc65e82471 (diff)
r600: Initial support
This includes a get_global_id() implementation and function stubs for the other workitem and synchronization functions.
Diffstat (limited to 'r600/lib')
-rw-r--r--r600/lib/SOURCES1
-rw-r--r--r600/lib/workitem/get_global_id.cl10
2 files changed, 11 insertions, 0 deletions
diff --git a/r600/lib/SOURCES b/r600/lib/SOURCES
new file mode 100644
index 0000000..0844030
--- /dev/null
+++ b/r600/lib/SOURCES
@@ -0,0 +1 @@
+workitem/get_global_id.cl
diff --git a/r600/lib/workitem/get_global_id.cl b/r600/lib/workitem/get_global_id.cl
new file mode 100644
index 0000000..9b0bd94
--- /dev/null
+++ b/r600/lib/workitem/get_global_id.cl
@@ -0,0 +1,10 @@
+#include <clc/clc.h>
+
+_CLC_DEF size_t get_global_id(uint dim) {
+ switch (dim) {
+ case 0: return __builtin_r600_read_tgid_x()*__builtin_r600_read_ngroups_x()+__builtin_r600_read_tidig_x();
+ case 1: return __builtin_r600_read_tgid_y()*__builtin_r600_read_ngroups_y()+__builtin_r600_read_tidig_y();
+ case 2: return __builtin_r600_read_tgid_z()*__builtin_r600_read_ngroups_z()+__builtin_r600_read_tidig_z();
+ default: return 0;
+ }
+}