summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2012-03-14 10:37:38 -0400
committerTom Stellard <thomas.stellard@amd.com>2012-06-01 09:03:19 -0400
commitdfe199f89dbfe58f058ed254db9e591c9b29bf03 (patch)
tree4c3ef5c2c3559a866bfa85022ef7e6e2a89e888a
parent03331c276767d66d2965f0528ed2d0e3a9a56e61 (diff)
r600: Add get_global_size() implementation
-rw-r--r--r600/include/clc/workitem/get_global_size.h4
-rw-r--r--r600/lib/SOURCES1
-rw-r--r--r600/lib/workitem/get_global_size.cl10
3 files changed, 12 insertions, 3 deletions
diff --git a/r600/include/clc/workitem/get_global_size.h b/r600/include/clc/workitem/get_global_size.h
index afd9ae1..8d7b9a1 100644
--- a/r600/include/clc/workitem/get_global_size.h
+++ b/r600/include/clc/workitem/get_global_size.h
@@ -1,3 +1 @@
-_CLC_INLINE size_t get_global_size(uint dim) {
- return 0;
-}
+size_t get_global_size(uint dim);
diff --git a/r600/lib/SOURCES b/r600/lib/SOURCES
index 0844030..644d2f3 100644
--- a/r600/lib/SOURCES
+++ b/r600/lib/SOURCES
@@ -1 +1,2 @@
workitem/get_global_id.cl
+workitem/get_global_size.cl
diff --git a/r600/lib/workitem/get_global_size.cl b/r600/lib/workitem/get_global_size.cl
new file mode 100644
index 0000000..4e47bbe
--- /dev/null
+++ b/r600/lib/workitem/get_global_size.cl
@@ -0,0 +1,10 @@
+#include <clc/clc.h>
+
+_CLC_DEF size_t get_global_size(uint dim) {
+ switch (dim) {
+ case 0: return __builtin_r600_read_global_size_x();
+ case 1: return __builtin_r600_read_global_size_y();
+ case 2: return __builtin_r600_read_global_size_z();
+ default: return 1;
+ }
+}