34#define __OPENCL_C_VERSION__ 120
35#define __OPENCL_VERSION__ 120
36#define CL_VERSION_1_0 100
37#define CL_VERSION_1_1 110
38#define CL_VERSION_1_2 120
39#define __ENDIAN_LITTLE__ 1
47#define __kernel [[cccc::__kernel__]]
48#define kernel [[cccc::__kernel__]]
49#define __global [[cccc::__global__]]
50#define global [[cccc::__global__]]
51#define __local [[cccc::__local__]]
52#define local [[cccc::__local__]]
53#define __constant [[cccc::__constant__]]
54#define constant [[cccc::__constant__]]
55#define __private [[cccc::__private__]]
56#define private [[cccc::__private__]]
73#define __CL_VECTOR(base, name, bytes) \
74 typedef base name __attribute__((vector_size(bytes)))
75#define __CL_VECTOR3(base, name, bytes) \
76 typedef base name __attribute__((vector_size(bytes), cccc_visible_lanes(3)))
108#define get_work_dim() cccc_work_dim()
109#define get_global_id(d) cccc_global_id(d)
110#define get_local_id(d) cccc_local_id(d)
111#define get_group_id(d) cccc_group_id(d)
112#define get_global_size(d) cccc_global_size(d)
113#define get_local_size(d) cccc_local_size(d)
114#define get_num_groups(d) cccc_num_groups(d)
116#define get_global_offset(d) ((size_t)0)
121#define CLK_LOCAL_MEM_FENCE CCCC_LOCAL_FENCE
122#define CLK_GLOBAL_MEM_FENCE CCCC_GLOBAL_FENCE
124#define barrier(flags) cccc_barrier(flags)
125#define mem_fence(flags) __atomic_thread_fence(__ATOMIC_SEQ_CST)
126#define read_mem_fence(flags) __atomic_thread_fence(__ATOMIC_SEQ_CST)
127#define write_mem_fence(flags) __atomic_thread_fence(__ATOMIC_SEQ_CST)
134#define atomic_add(p, v) __atomic_fetch_add(p, v, __ATOMIC_SEQ_CST)
135#define atomic_sub(p, v) __atomic_fetch_sub(p, v, __ATOMIC_SEQ_CST)
136#define atomic_and(p, v) __atomic_fetch_and(p, v, __ATOMIC_SEQ_CST)
137#define atomic_or(p, v) __atomic_fetch_or(p, v, __ATOMIC_SEQ_CST)
138#define atomic_xor(p, v) __atomic_fetch_xor(p, v, __ATOMIC_SEQ_CST)
139#define atomic_inc(p) __atomic_fetch_add(p, 1, __ATOMIC_SEQ_CST)
140#define atomic_dec(p) __atomic_fetch_sub(p, 1, __ATOMIC_SEQ_CST)
148#define __CL_XCHG_F32(p, val) \
153 } __cl_in = {.f = (val)}, __cl_out; \
154 __cl_out.u = __atomic_exchange_n((__cl_generic_uint *)(p), __cl_in.u, \
158#define atomic_xchg(p, val) \
160 float: __CL_XCHG_F32(p, val), \
161 default: __atomic_exchange_n(p, val, __ATOMIC_SEQ_CST))
162#define atomic_cmpxchg(p, cmp, val) \
165 typeof_unqual(*__cl_p) __cl_e = (cmp); \
166 __atomic_compare_exchange_n(__cl_p, &__cl_e, (val), 0, \
167 __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); \
170#define __CL_ATOMIC_EXTREMUM(p, val, stops) \
173 typeof_unqual(*__cl_p) __cl_v = (val); \
174 typeof_unqual(*__cl_p) __cl_o = \
175 __atomic_load_n(__cl_p, __ATOMIC_SEQ_CST); \
176 while (stops && !__atomic_compare_exchange_n(__cl_p, &__cl_o, __cl_v, \
177 0, __ATOMIC_SEQ_CST, \
178 __ATOMIC_SEQ_CST)) { \
182#define atomic_min(p, val) __CL_ATOMIC_EXTREMUM(p, val, __cl_v < __cl_o)
183#define atomic_max(p, val) __CL_ATOMIC_EXTREMUM(p, val, __cl_v > __cl_o)
186#define atom_add atomic_add
187#define atom_sub atomic_sub
188#define atom_and atomic_and
189#define atom_or atomic_or
190#define atom_xor atomic_xor
191#define atom_xchg atomic_xchg
192#define atom_inc atomic_inc
193#define atom_dec atomic_dec
194#define atom_cmpxchg atomic_cmpxchg
195#define atom_min atomic_min
196#define atom_max atomic_max
Work-item builtins and the launch builtin for [[cccc::kernel]] functions. See docs/kernels....
#define __CL_VECTOR3(base, name, bytes)
Definition opencl.h:75
unsigned __cl_generic_uint
Definition opencl.h:68
unsigned char uchar
Definition opencl.h:61
#define __CL_VECTOR(base, name, bytes)
Definition opencl.h:73
unsigned long ulong
Definition opencl.h:64
unsigned int uint
Definition opencl.h:63
unsigned short ushort
Definition opencl.h:62