diff options
Diffstat (limited to 'ptx-nvidiacl')
-rw-r--r-- | ptx-nvidiacl/include/clc/workitem/get_global_id.h | 8 | ||||
-rw-r--r-- | ptx-nvidiacl/include/clc/workitem/get_global_size.h | 8 | ||||
-rw-r--r-- | ptx-nvidiacl/lib/SOURCES | 5 | ||||
-rw-r--r-- | ptx-nvidiacl/lib/synchronization/barrier.cl (renamed from ptx-nvidiacl/include/clc/synchronization/barrier.h) | 4 | ||||
-rw-r--r-- | ptx-nvidiacl/lib/workitem/get_group_id.cl (renamed from ptx-nvidiacl/include/clc/workitem/get_group_id.h) | 4 | ||||
-rw-r--r-- | ptx-nvidiacl/lib/workitem/get_local_id.cl (renamed from ptx-nvidiacl/include/clc/workitem/get_local_id.h) | 4 | ||||
-rw-r--r-- | ptx-nvidiacl/lib/workitem/get_local_size.cl (renamed from ptx-nvidiacl/include/clc/workitem/get_local_size.h) | 4 | ||||
-rw-r--r-- | ptx-nvidiacl/lib/workitem/get_num_groups.cl (renamed from ptx-nvidiacl/include/clc/workitem/get_num_groups.h) | 4 |
8 files changed, 20 insertions, 21 deletions
diff --git a/ptx-nvidiacl/include/clc/workitem/get_global_id.h b/ptx-nvidiacl/include/clc/workitem/get_global_id.h deleted file mode 100644 index 026d2fe..0000000 --- a/ptx-nvidiacl/include/clc/workitem/get_global_id.h +++ /dev/null @@ -1,8 +0,0 @@ -_CLC_INLINE size_t get_global_id(uint dim) { - switch (dim) { - case 0: return __builtin_ptx_read_ctaid_x()*__builtin_ptx_read_ntid_x()+__builtin_ptx_read_tid_x(); - case 1: return __builtin_ptx_read_ctaid_y()*__builtin_ptx_read_ntid_y()+__builtin_ptx_read_tid_y(); - case 2: return __builtin_ptx_read_ctaid_z()*__builtin_ptx_read_ntid_z()+__builtin_ptx_read_tid_z(); - default: return 0; - } -} diff --git a/ptx-nvidiacl/include/clc/workitem/get_global_size.h b/ptx-nvidiacl/include/clc/workitem/get_global_size.h deleted file mode 100644 index 5cd4222..0000000 --- a/ptx-nvidiacl/include/clc/workitem/get_global_size.h +++ /dev/null @@ -1,8 +0,0 @@ -_CLC_INLINE size_t get_global_size(uint dim) { - switch (dim) { - case 0: return __builtin_ptx_read_nctaid_x()*__builtin_ptx_read_ntid_x(); - case 1: return __builtin_ptx_read_nctaid_y()*__builtin_ptx_read_ntid_y(); - case 2: return __builtin_ptx_read_nctaid_z()*__builtin_ptx_read_ntid_z(); - default: return 0; - } -} diff --git a/ptx-nvidiacl/lib/SOURCES b/ptx-nvidiacl/lib/SOURCES index e69de29..7cdbd85 100644 --- a/ptx-nvidiacl/lib/SOURCES +++ b/ptx-nvidiacl/lib/SOURCES @@ -0,0 +1,5 @@ +synchronization/barrier.cl +workitem/get_group_id.cl +workitem/get_local_id.cl +workitem/get_local_size.cl +workitem/get_num_groups.cl diff --git a/ptx-nvidiacl/include/clc/synchronization/barrier.h b/ptx-nvidiacl/lib/synchronization/barrier.cl index cd9f327..fb36c26 100644 --- a/ptx-nvidiacl/include/clc/synchronization/barrier.h +++ b/ptx-nvidiacl/lib/synchronization/barrier.cl @@ -1,4 +1,6 @@ -_CLC_INLINE void barrier(cl_mem_fence_flags flags) { +#include <clc/clc.h> + +_CLC_DEF void barrier(cl_mem_fence_flags flags) { if (flags & CLK_LOCAL_MEM_FENCE) { __builtin_ptx_bar_sync(0); } diff --git a/ptx-nvidiacl/include/clc/workitem/get_group_id.h b/ptx-nvidiacl/lib/workitem/get_group_id.cl index 18b1bd4..2b35b4e 100644 --- a/ptx-nvidiacl/include/clc/workitem/get_group_id.h +++ b/ptx-nvidiacl/lib/workitem/get_group_id.cl @@ -1,4 +1,6 @@ -_CLC_INLINE size_t get_group_id(uint dim) { +#include <clc/clc.h> + +_CLC_DEF size_t get_group_id(uint dim) { switch (dim) { case 0: return __builtin_ptx_read_ctaid_x(); case 1: return __builtin_ptx_read_ctaid_y(); diff --git a/ptx-nvidiacl/include/clc/workitem/get_local_id.h b/ptx-nvidiacl/lib/workitem/get_local_id.cl index 1b8c776..f0cfdc0 100644 --- a/ptx-nvidiacl/include/clc/workitem/get_local_id.h +++ b/ptx-nvidiacl/lib/workitem/get_local_id.cl @@ -1,4 +1,6 @@ -_CLC_INLINE size_t get_local_id(uint dim) { +#include <clc/clc.h> + +_CLC_DEF size_t get_local_id(uint dim) { switch (dim) { case 0: return __builtin_ptx_read_tid_x(); case 1: return __builtin_ptx_read_tid_y(); diff --git a/ptx-nvidiacl/include/clc/workitem/get_local_size.h b/ptx-nvidiacl/lib/workitem/get_local_size.cl index cbc1f6e..c3f5425 100644 --- a/ptx-nvidiacl/include/clc/workitem/get_local_size.h +++ b/ptx-nvidiacl/lib/workitem/get_local_size.cl @@ -1,4 +1,6 @@ -_CLC_INLINE size_t get_local_size(uint dim) { +#include <clc/clc.h> + +_CLC_DEF size_t get_local_size(uint dim) { switch (dim) { case 0: return __builtin_ptx_read_ntid_x(); case 1: return __builtin_ptx_read_ntid_y(); diff --git a/ptx-nvidiacl/include/clc/workitem/get_num_groups.h b/ptx-nvidiacl/lib/workitem/get_num_groups.cl index 36ee849..90bdc2e 100644 --- a/ptx-nvidiacl/include/clc/workitem/get_num_groups.h +++ b/ptx-nvidiacl/lib/workitem/get_num_groups.cl @@ -1,4 +1,6 @@ -_CLC_INLINE size_t get_num_groups(uint dim) { +#include <clc/clc.h> + +_CLC_DEF size_t get_num_groups(uint dim) { switch (dim) { case 0: return __builtin_ptx_read_nctaid_x(); case 1: return __builtin_ptx_read_nctaid_y(); |