mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-04-01 12:43:47 +00:00
r600: Initial support
This includes a get_global_id() implementation and function stubs for the other workitem and synchronization functions. llvm-svn: 184975
This commit is contained in:
parent
734508d9e6
commit
879327fcdc
@ -43,7 +43,7 @@ llvm_clang = os.path.join(llvm_bindir, 'clang')
|
||||
llvm_link = os.path.join(llvm_bindir, 'llvm-link')
|
||||
llvm_opt = os.path.join(llvm_bindir, 'opt')
|
||||
|
||||
default_targets = ['nvptx--nvidiacl', 'nvptx64--nvidiacl']
|
||||
default_targets = ['nvptx--nvidiacl', 'nvptx64--nvidiacl', 'r600--']
|
||||
|
||||
targets = args
|
||||
if not targets:
|
||||
|
2
libclc/r600/include/clc/synchronization/barrier.h
Normal file
2
libclc/r600/include/clc/synchronization/barrier.h
Normal file
@ -0,0 +1,2 @@
|
||||
_CLC_INLINE void barrier(cl_mem_fence_flags flags) {
|
||||
}
|
1
libclc/r600/include/clc/workitem/get_global_id.h
Normal file
1
libclc/r600/include/clc/workitem/get_global_id.h
Normal file
@ -0,0 +1 @@
|
||||
size_t get_global_id(uint dim);
|
3
libclc/r600/include/clc/workitem/get_global_size.h
Normal file
3
libclc/r600/include/clc/workitem/get_global_size.h
Normal file
@ -0,0 +1,3 @@
|
||||
_CLC_INLINE size_t get_global_size(uint dim) {
|
||||
return 0;
|
||||
}
|
3
libclc/r600/include/clc/workitem/get_group_id.h
Normal file
3
libclc/r600/include/clc/workitem/get_group_id.h
Normal file
@ -0,0 +1,3 @@
|
||||
_CLC_INLINE size_t get_group_id(uint dim) {
|
||||
return 0;
|
||||
}
|
3
libclc/r600/include/clc/workitem/get_local_id.h
Normal file
3
libclc/r600/include/clc/workitem/get_local_id.h
Normal file
@ -0,0 +1,3 @@
|
||||
_CLC_INLINE size_t get_local_id(uint dim) {
|
||||
return 0;
|
||||
}
|
3
libclc/r600/include/clc/workitem/get_local_size.h
Normal file
3
libclc/r600/include/clc/workitem/get_local_size.h
Normal file
@ -0,0 +1,3 @@
|
||||
_CLC_INLINE size_t get_local_size(uint dim) {
|
||||
return 0;
|
||||
}
|
3
libclc/r600/include/clc/workitem/get_num_groups.h
Normal file
3
libclc/r600/include/clc/workitem/get_num_groups.h
Normal file
@ -0,0 +1,3 @@
|
||||
_CLC_INLINE size_t get_num_groups(uint dim) {
|
||||
return 0;
|
||||
}
|
1
libclc/r600/lib/SOURCES
Normal file
1
libclc/r600/lib/SOURCES
Normal file
@ -0,0 +1 @@
|
||||
workitem/get_global_id.cl
|
10
libclc/r600/lib/workitem/get_global_id.cl
Normal file
10
libclc/r600/lib/workitem/get_global_id.cl
Normal file
@ -0,0 +1,10 @@
|
||||
#include <clc/clc.h>
|
||||
|
||||
_CLC_DEF size_t get_global_id(uint dim) {
|
||||
switch (dim) {
|
||||
case 0: return __builtin_r600_read_tgid_x()*__builtin_r600_read_ngroups_x()+__builtin_r600_read_tidig_x();
|
||||
case 1: return __builtin_r600_read_tgid_y()*__builtin_r600_read_ngroups_y()+__builtin_r600_read_tidig_y();
|
||||
case 2: return __builtin_r600_read_tgid_z()*__builtin_r600_read_ngroups_z()+__builtin_r600_read_tidig_z();
|
||||
default: return 0;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user