llvm-capstone/libclc/r600/lib/workitem/get_local_id.cl
Jan Vesely 74f02db922 AMDGPU: Use clang intrinsics for workitem builtins
v2: split into 2 patches
    use clang builtins for other intrinsics as well

v3: Fix warnings
    Switch r600 to use implictarg.ptr

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 276442
2016-07-22 17:24:20 +00:00

12 lines
242 B
Common Lisp

#include <clc/clc.h>
_CLC_DEF uint get_local_id(uint dim)
{
switch(dim) {
case 0: return __builtin_r600_read_tidig_x();
case 1: return __builtin_r600_read_tidig_y();
case 2: return __builtin_r600_read_tidig_z();
default: return 1;
}
}