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:
Tom Stellard 2013-06-26 18:18:59 +00:00
parent 734508d9e6
commit 879327fcdc
10 changed files with 30 additions and 1 deletions

View File

@ -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:

View File

@ -0,0 +1,2 @@
_CLC_INLINE void barrier(cl_mem_fence_flags flags) {
}

View File

@ -0,0 +1 @@
size_t get_global_id(uint dim);

View File

@ -0,0 +1,3 @@
_CLC_INLINE size_t get_global_size(uint dim) {
return 0;
}

View File

@ -0,0 +1,3 @@
_CLC_INLINE size_t get_group_id(uint dim) {
return 0;
}

View File

@ -0,0 +1,3 @@
_CLC_INLINE size_t get_local_id(uint dim) {
return 0;
}

View File

@ -0,0 +1,3 @@
_CLC_INLINE size_t get_local_size(uint dim) {
return 0;
}

View File

@ -0,0 +1,3 @@
_CLC_INLINE size_t get_num_groups(uint dim) {
return 0;
}

1
libclc/r600/lib/SOURCES Normal file
View File

@ -0,0 +1 @@
workitem/get_global_id.cl

View 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;
}
}