diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2013-06-26 18:19:44 +0000 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2013-06-26 18:19:44 +0000 |
commit | 760192413b4fd5f67d14a79c5c74d7f6fcea354c (patch) | |
tree | 2c1ab55f28dbc6f3dd64d1d116023dc87451ff9f | |
parent | 98d740bd592b44da1394434961cd42695e7e79f2 (diff) |
r600: Add get_global_size() implementation
git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@184977 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | r600/include/clc/workitem/get_global_size.h | 4 | ||||
-rw-r--r-- | r600/lib/SOURCES | 1 | ||||
-rw-r--r-- | r600/lib/workitem/get_global_size.cl | 10 |
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; + } +} |