summaryrefslogtreecommitdiffstats
path: root/libclc
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2013-06-26 18:19:44 +0000
committerTom Stellard <thomas.stellard@amd.com>2013-06-26 18:19:44 +0000
commit38f0ac9d5ee762425e178e8dfaf8e95e00248536 (patch)
treeec83158954efc9e711a5c7d24548397117025fce /libclc
parentac14c4e8782a69b3a4558fa4d114ded7bd24e0c8 (diff)
downloadbcm5719-llvm-38f0ac9d5ee762425e178e8dfaf8e95e00248536.tar.gz
bcm5719-llvm-38f0ac9d5ee762425e178e8dfaf8e95e00248536.zip
r600: Add get_global_size() implementation
llvm-svn: 184977
Diffstat (limited to 'libclc')
-rw-r--r--libclc/r600/include/clc/workitem/get_global_size.h4
-rw-r--r--libclc/r600/lib/SOURCES1
-rw-r--r--libclc/r600/lib/workitem/get_global_size.cl10
3 files changed, 12 insertions, 3 deletions
diff --git a/libclc/r600/include/clc/workitem/get_global_size.h b/libclc/r600/include/clc/workitem/get_global_size.h
index afd9ae1916a..8d7b9a1d581 100644
--- a/libclc/r600/include/clc/workitem/get_global_size.h
+++ b/libclc/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/libclc/r600/lib/SOURCES b/libclc/r600/lib/SOURCES
index 08440307038..644d2f39733 100644
--- a/libclc/r600/lib/SOURCES
+++ b/libclc/r600/lib/SOURCES
@@ -1 +1,2 @@
workitem/get_global_id.cl
+workitem/get_global_size.cl
diff --git a/libclc/r600/lib/workitem/get_global_size.cl b/libclc/r600/lib/workitem/get_global_size.cl
new file mode 100644
index 00000000000..4e47bbec916
--- /dev/null
+++ b/libclc/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;
+ }
+}
OpenPOWER on IntegriCloud