summaryrefslogtreecommitdiffstats
path: root/libclc/generic/lib/workitem
diff options
context:
space:
mode:
authorJan Vesely <jan.vesely@rutgers.edu>2016-07-22 17:24:24 +0000
committerJan Vesely <jan.vesely@rutgers.edu>2016-07-22 17:24:24 +0000
commita82e080b57a47e9ef8f89c56bdd6b9593db596d2 (patch)
tree392d06b76bd59817ac4897128a1961dc84c39208 /libclc/generic/lib/workitem
parent74f02db922b4609095da4218fd3016c2c51d056b (diff)
downloadbcm5719-llvm-a82e080b57a47e9ef8f89c56bdd6b9593db596d2.tar.gz
bcm5719-llvm-a82e080b57a47e9ef8f89c56bdd6b9593db596d2.zip
AMDGPU: Implement get_global_offset builtin
Also fix get_global_id to consider offset No idea how to add this for ptx, so they are stuck with the old get_global_id implementation. v2: split to a separate patch v3: Switch R600 to use implictarg.ptr Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> llvm-svn: 276443
Diffstat (limited to 'libclc/generic/lib/workitem')
-rw-r--r--libclc/generic/lib/workitem/get_global_id.cl2
1 files changed, 1 insertions, 1 deletions
diff --git a/libclc/generic/lib/workitem/get_global_id.cl b/libclc/generic/lib/workitem/get_global_id.cl
index fdd83d2953d..b6c2ea1d2cc 100644
--- a/libclc/generic/lib/workitem/get_global_id.cl
+++ b/libclc/generic/lib/workitem/get_global_id.cl
@@ -1,5 +1,5 @@
#include <clc/clc.h>
_CLC_DEF size_t get_global_id(uint dim) {
- return get_group_id(dim)*get_local_size(dim) + get_local_id(dim);
+ return get_group_id(dim) * get_local_size(dim) + get_local_id(dim) + get_global_offset(dim);
}
OpenPOWER on IntegriCloud