diff --git a/clang/lib/Headers/opencl-c-base.h b/clang/lib/Headers/opencl-c-base.h --- a/clang/lib/Headers/opencl-c-base.h +++ b/clang/lib/Headers/opencl-c-base.h @@ -281,9 +281,16 @@ typedef enum memory_scope { memory_scope_work_item = __OPENCL_MEMORY_SCOPE_WORK_ITEM, memory_scope_work_group = __OPENCL_MEMORY_SCOPE_WORK_GROUP, +#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) || (__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && defined(__opencl_c_atomic_scope_device)) memory_scope_device = __OPENCL_MEMORY_SCOPE_DEVICE, +#endif +#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) || (__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && defined(__opencl_c_atomic_scope_all_devices)) memory_scope_all_svm_devices = __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES, -#if defined(cl_intel_subgroups) || defined(cl_khr_subgroups) +#endif +#if __OPENCL_C_VERSION__ >= CL_VERSION_3_0 && defined(__opencl_c_atomic_scope_all_devices) + memory_scope_all_devices = __OPENCL_MEMORY_SCOPE_ALL_SVM_DEVICES, +#endif +#if defined(cl_intel_subgroups) || defined(cl_khr_subgroups) || (__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && defined(__opencl_c_subgroups)) memory_scope_sub_group = __OPENCL_MEMORY_SCOPE_SUB_GROUP #endif } memory_scope; diff --git a/clang/lib/Headers/opencl-c.h b/clang/lib/Headers/opencl-c.h --- a/clang/lib/Headers/opencl-c.h +++ b/clang/lib/Headers/opencl-c.h @@ -17,6 +17,12 @@ #endif //cl_khr_depth_images #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#if __OPENCL_C_VERSION__ >= CL_VERSION_3_0 && defined(__opencl_c_subgroups) +#ifndef cl_khr_subgroups +#define cl_khr_subgroups +#endif +#endif //(__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && defined(__opencl_c_subgroups) + #if __OPENCL_C_VERSION__ < CL_VERSION_2_0 #ifdef cl_khr_3d_image_writes #pragma OPENCL EXTENSION cl_khr_3d_image_writes : enable @@ -28,6 +34,27 @@ #pragma OPENCL EXTENSION cl_intel_planar_yuv : end #endif // defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_1_2) +#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0 && __OPENCL_C_VERSION__ < CL_VERSION_3_0) +#ifndef __opencl_c_generic_address_space +#define __opencl_c_generic_address_space +#endif +#ifndef __opencl_c_pipes +#define __opencl_c_pipes +#endif +#ifndef __opencl_c_subgroups +#define __opencl_c_subgroups +#endif +#ifndef __opencl_c_atomic_order_seq_cst +#define __opencl_c_atomic_order_seq_cst +#endif +#ifndef __opencl_c_atomic_scope_device +#define __opencl_c_atomic_scope_device +#endif +#ifndef __opencl_c_work_group_collective_functions +#define __opencl_c_work_group_collective_functions +#endif +#endif + #define __ovld __attribute__((overloadable)) #define __conv __attribute__((convergent)) @@ -7354,7 +7381,7 @@ * Returns fmin(x - floor (x), 0x1.fffffep-1f ). * floor(x) is returned in iptr. */ -#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#if defined(__opencl_c_generic_address_space) float __ovld fract(float x, float *iptr); float2 __ovld fract(float2 x, float2 *iptr); float3 __ovld fract(float3 x, float3 *iptr); @@ -7436,7 +7463,7 @@ half8 __ovld fract(half8 x, __private half8 *iptr); half16 __ovld fract(half16 x, __private half16 *iptr); #endif //cl_khr_fp16 -#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#endif //defined(__opencl_c_generic_address_space) /** * Extract mantissa and exponent from x. For each @@ -7444,7 +7471,7 @@ * magnitude in the interval [1/2, 1) or 0. Each * component of x equals mantissa returned * 2^exp. */ -#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#if defined(__opencl_c_generic_address_space) float __ovld frexp(float x, int *exp); float2 __ovld frexp(float2 x, int2 *exp); float3 __ovld frexp(float3 x, int3 *exp); @@ -7526,7 +7553,7 @@ half8 __ovld frexp(half8 x, __private int8 *exp); half16 __ovld frexp(half16 x, __private int16 *exp); #endif //cl_khr_fp16 -#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#endif //defined(__opencl_c_generic_address_space) /** * Compute the value of the square root of x^2 + y^2 @@ -7651,7 +7678,7 @@ half16 __ovld __cnfn lgamma(half16 x); #endif //cl_khr_fp16 -#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#if defined(__opencl_c_generic_address_space) float __ovld lgamma_r(float x, int *signp); float2 __ovld lgamma_r(float2 x, int2 *signp); float3 __ovld lgamma_r(float3 x, int3 *signp); @@ -7733,7 +7760,7 @@ half8 __ovld lgamma_r(half8 x, __private int8 *signp); half16 __ovld lgamma_r(half16 x, __private int16 *signp); #endif //cl_khr_fp16 -#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#endif //defined(__opencl_c_generic_address_space) /** * Compute natural logarithm. @@ -7957,7 +7984,7 @@ * the argument. It stores the integral part in the object * pointed to by iptr. */ -#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#if defined(__opencl_c_generic_address_space) float __ovld modf(float x, float *iptr); float2 __ovld modf(float2 x, float2 *iptr); float3 __ovld modf(float3 x, float3 *iptr); @@ -8039,7 +8066,7 @@ half8 __ovld modf(half8 x, __private half8 *iptr); half16 __ovld modf(half16 x, __private half16 *iptr); #endif //cl_khr_fp16 -#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#endif //defined(__opencl_c_generic_address_space) /** * Returns a quiet NaN. The nancode may be placed @@ -8217,7 +8244,7 @@ * sign as x/y. It stores this signed value in the object * pointed to by quo. */ -#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#if defined(__opencl_c_generic_address_space) float __ovld remquo(float x, float y, int *quo); float2 __ovld remquo(float2 x, float2 y, int2 *quo); float3 __ovld remquo(float3 x, float3 y, int3 *quo); @@ -8300,7 +8327,7 @@ half8 __ovld remquo(half8 x, half8 y, __private int8 *quo); half16 __ovld remquo(half16 x, half16 y, __private int16 *quo); #endif //cl_khr_fp16 -#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#endif //defined(__opencl_c_generic_address_space) /** * Round to integral value (using round to nearest * even rounding mode) in floating-point format. @@ -8441,7 +8468,7 @@ * is the return value and computed cosine is returned * in cosval. */ -#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#if defined(__opencl_c_generic_address_space) float __ovld sincos(float x, float *cosval); float2 __ovld sincos(float2 x, float2 *cosval); float3 __ovld sincos(float3 x, float3 *cosval); @@ -8523,7 +8550,7 @@ half8 __ovld sincos(half8 x, __private half8 *cosval); half16 __ovld sincos(half16 x, __private half16 *cosval); #endif //cl_khr_fp16 -#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#endif //defined(__opencl_c_generic_address_space) /** * Compute hyperbolic sine. @@ -11342,7 +11369,7 @@ half16 __ovld vload16(size_t offset, const __constant half *p); #endif //cl_khr_fp16 -#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#if defined(__opencl_c_generic_address_space) char2 __ovld vload2(size_t offset, const char *p); uchar2 __ovld vload2(size_t offset, const uchar *p); short2 __ovld vload2(size_t offset, const short *p); @@ -11580,9 +11607,9 @@ half8 __ovld vload8(size_t offset, const __private half *p); half16 __ovld vload16(size_t offset, const __private half *p); #endif //cl_khr_fp16 -#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#endif //defined(__opencl_c_generic_address_space) -#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#if defined(__opencl_c_generic_address_space) void __ovld vstore2(char2 data, size_t offset, char *p); void __ovld vstore2(uchar2 data, size_t offset, uchar *p); void __ovld vstore2(short2 data, size_t offset, short *p); @@ -11816,7 +11843,7 @@ void __ovld vstore8(half8 data, size_t offset, __private half *p); void __ovld vstore16(half16 data, size_t offset, __private half *p); #endif //cl_khr_fp16 -#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#endif //defined(__opencl_c_generic_address_space) /** * Read sizeof (half) bytes of data from address @@ -11827,13 +11854,13 @@ * must be 16-bit aligned. */ float __ovld vload_half(size_t offset, const __constant half *p); -#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#if defined(__opencl_c_generic_address_space) float __ovld vload_half(size_t offset, const half *p); #else float __ovld vload_half(size_t offset, const __global half *p); float __ovld vload_half(size_t offset, const __local half *p); float __ovld vload_half(size_t offset, const __private half *p); -#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#endif //defined(__opencl_c_generic_address_space) /** * Read sizeof (halfn) bytes of data from address @@ -11848,7 +11875,7 @@ float4 __ovld vload_half4(size_t offset, const __constant half *p); float8 __ovld vload_half8(size_t offset, const __constant half *p); float16 __ovld vload_half16(size_t offset, const __constant half *p); -#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#if defined(__opencl_c_generic_address_space) float2 __ovld vload_half2(size_t offset, const half *p); float3 __ovld vload_half3(size_t offset, const half *p); float4 __ovld vload_half4(size_t offset, const half *p); @@ -11870,7 +11897,7 @@ float4 __ovld vload_half4(size_t offset, const __private half *p); float8 __ovld vload_half8(size_t offset, const __private half *p); float16 __ovld vload_half16(size_t offset, const __private half *p); -#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#endif //defined(__opencl_c_generic_address_space) /** * The float value given by data is first @@ -11883,7 +11910,7 @@ * The default current rounding mode is round to * nearest even. */ -#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#if defined(__opencl_c_generic_address_space) void __ovld vstore_half(float data, size_t offset, half *p); void __ovld vstore_half_rte(float data, size_t offset, half *p); void __ovld vstore_half_rtz(float data, size_t offset, half *p); @@ -11929,7 +11956,7 @@ void __ovld vstore_half_rtp(double data, size_t offset, __private half *p); void __ovld vstore_half_rtn(double data, size_t offset, __private half *p); #endif //cl_khr_fp64 -#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#endif //defined(__opencl_c_generic_address_space) /** * The floatn value given by data is converted to @@ -11942,7 +11969,7 @@ * The default current rounding mode is round to * nearest even. */ -#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#if defined(__opencl_c_generic_address_space) void __ovld vstore_half2(float2 data, size_t offset, half *p); void __ovld vstore_half3(float3 data, size_t offset, half *p); void __ovld vstore_half4(float4 data, size_t offset, half *p); @@ -12148,7 +12175,7 @@ void __ovld vstore_half8_rtn(double8 data, size_t offset, __private half *p); void __ovld vstore_half16_rtn(double16 data, size_t offset, __private half *p); #endif //cl_khr_fp64 -#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#endif //defined(__opencl_c_generic_address_space) /** * For n = 1, 2, 4, 8 and 16 read sizeof (halfn) @@ -12169,7 +12196,7 @@ float4 __ovld vloada_half4(size_t offset, const __constant half *p); float8 __ovld vloada_half8(size_t offset, const __constant half *p); float16 __ovld vloada_half16(size_t offset, const __constant half *p); -#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#if defined(__opencl_c_generic_address_space) float __ovld vloada_half(size_t offset, const half *p); float2 __ovld vloada_half2(size_t offset, const half *p); float3 __ovld vloada_half3(size_t offset, const half *p); @@ -12195,7 +12222,7 @@ float4 __ovld vloada_half4(size_t offset, const __private half *p); float8 __ovld vloada_half8(size_t offset, const __private half *p); float16 __ovld vloada_half16(size_t offset, const __private half *p); -#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#endif //defined(__opencl_c_generic_address_space) /** * The floatn value given by data is converted to @@ -12213,7 +12240,7 @@ * mode. The default current rounding mode is * round to nearest even. */ -#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#if defined(__opencl_c_generic_address_space) void __ovld vstorea_half(float data, size_t offset, half *p); void __ovld vstorea_half2(float2 data, size_t offset, half *p); void __ovld vstorea_half3(float3 data, size_t offset, half *p); @@ -12498,7 +12525,7 @@ void __ovld vstorea_half8_rtn(double8 data,size_t offset, __private half *p); void __ovld vstorea_half16_rtn(double16 data,size_t offset, __private half *p); #endif //cl_khr_fp64 -#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#endif //defined(__opencl_c_generic_address_space) // OpenCL v1.1 s6.11.8, v1.2 s6.12.8, v2.0 s6.13.8 - Synchronization Functions @@ -12582,7 +12609,7 @@ // OpenCL v2.0 s6.13.9 - Address Space Qualifier Functions -#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#if defined(__opencl_c_generic_address_space) cl_mem_fence_flags __ovld get_fence(const void *ptr); cl_mem_fence_flags __ovld get_fence(void *ptr); @@ -12593,7 +12620,7 @@ * where gentype is builtin type or user defined type. */ -#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#endif //defined(__opencl_c_generic_address_space) // OpenCL v1.1 s6.11.10, v1.2 s6.12.10, v2.0 s6.13.10 - Async Copies from Global to Local Memory, Local to Global Memory, and Prefetch @@ -13381,6 +13408,26 @@ #pragma OPENCL EXTENSION cl_khr_int64_extended_atomics : enable #endif +#if __OPENCL_C_VERSION__ >= CL_VERSION_3_0 +void __ovld atomic_init(volatile __global atomic_int *object, int value); +void __ovld atomic_init(volatile __local atomic_int *object, int value); +void __ovld atomic_init(volatile __global atomic_uint *object, uint value); +void __ovld atomic_init(volatile __local atomic_uint *object, uint value); +void __ovld atomic_init(volatile __global atomic_float *object, float value); +void __ovld atomic_init(volatile __local atomic_float *object, float value); +#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) +void __ovld atomic_init(volatile __global atomic_long *object, long value); +void __ovld atomic_init(volatile __local atomic_long *object, long value); +void __ovld atomic_init(volatile __global atomic_ulong *object, ulong value); +void __ovld atomic_init(volatile __local atomic_ulong *object, ulong value); +#ifdef cl_khr_fp64 +void __ovld atomic_init(volatile __global atomic_double *object, double value); +void __ovld atomic_init(volatile __local atomic_double *object, double value); +#endif //cl_khr_fp64 +#endif +#endif //__OPENCL_C_VERSION__ >= CL_VERSION_3_0 + +#if defined(__opencl_c_generic_address_space) // atomic_init() void __ovld atomic_init(volatile atomic_int *object, int value); void __ovld atomic_init(volatile atomic_uint *object, uint value); @@ -13392,295 +13439,1197 @@ void __ovld atomic_init(volatile atomic_double *object, double value); #endif //cl_khr_fp64 #endif +#endif //defined(__opencl_c_generic_address_space) // atomic_work_item_fence() void __ovld atomic_work_item_fence(cl_mem_fence_flags flags, memory_order order, memory_scope scope); // atomic_fetch() +// OpenCL v2.0 s6.13.11.7.5: +// add/sub: atomic type argument can be uintptr_t/intptr_t, value type argument can be ptrdiff_t. +// or/xor/and/min/max: atomic type argument can be intptr_t/uintptr_t, value type argument can be intptr_t/uintptr_t. +#if __OPENCL_C_VERSION__ >= CL_VERSION_3_0 && defined(__opencl_c_atomic_order_seq_cst) && defined(__opencl_c_atomic_scope_device) +int __ovld atomic_fetch_add(volatile __global atomic_int *object, int operand); +int __ovld atomic_fetch_add(volatile __local atomic_int *object, int operand); +uint __ovld atomic_fetch_add(volatile __global atomic_uint *object, uint operand); +uint __ovld atomic_fetch_add(volatile __local atomic_uint *object, uint operand); +int __ovld atomic_fetch_sub(volatile __global atomic_int *object, int operand); +int __ovld atomic_fetch_sub(volatile __local atomic_int *object, int operand); +uint __ovld atomic_fetch_sub(volatile __global atomic_uint *object, uint operand); +uint __ovld atomic_fetch_sub(volatile __local atomic_uint *object, uint operand); +int __ovld atomic_fetch_or(volatile __global atomic_int *object, int operand); +int __ovld atomic_fetch_or(volatile __local atomic_int *object, int operand); +uint __ovld atomic_fetch_or(volatile __global atomic_uint *object, uint operand); +uint __ovld atomic_fetch_or(volatile __local atomic_uint *object, uint operand); +int __ovld atomic_fetch_xor(volatile __global atomic_int *object, int operand); +int __ovld atomic_fetch_xor(volatile __local atomic_int *object, int operand); +uint __ovld atomic_fetch_xor(volatile __global atomic_uint *object, uint operand); +uint __ovld atomic_fetch_xor(volatile __local atomic_uint *object, uint operand);i +int __ovld atomic_fetch_and(volatile __global atomic_int *object, int operand); +int __ovld atomic_fetch_and(volatile __local atomic_int *object, int operand); +uint __ovld atomic_fetch_and(volatile __global atomic_uint *object, uint operand); +uint __ovld atomic_fetch_and(volatile __local atomic_uint *object, uint operand); +int __ovld atomic_fetch_min(volatile __global atomic_int *object, int operand); +int __ovld atomic_fetch_min(volatile __local atomic_int *object, int operand); +uint __ovld atomic_fetch_min(volatile __global atomic_uint *object, uint operand); +uint __ovld atomic_fetch_min(volatile __local atomic_uint *object, uint operand); +int __ovld atomic_fetch_max(volatile __global atomic_int *object, int operand); +int __ovld atomic_fetch_max(volatile __local atomic_int *object, int operand); +uint __ovld atomic_fetch_max(volatile __global atomic_uint *object, uint operand); +uint __ovld atomic_fetch_max(volatile __local atomic_uint *object, uint operand); +#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) +long __ovld atomic_fetch_add(volatile __global atomic_long *object, long operand); +long __ovld atomic_fetch_add(volatile __local atomic_long *object, long operand); +ulong __ovld atomic_fetch_add(volatile __global atomic_ulong *object, ulong operand); +ulong __ovld atomic_fetch_add(volatile __local atomic_ulong *object, ulong operand); +uintptr_t __ovld atomic_fetch_add(volatile __global atomic_uintptr_t *object, ptrdiff_t operand); +uintptr_t __ovld atomic_fetch_add(volatile __local atomic_uintptr_t *object, ptrdiff_t operand); +long __ovld atomic_fetch_sub(volatile __global atomic_long *object, long operand); +long __ovld atomic_fetch_sub(volatile __local atomic_long *object, long operand); +ulong __ovld atomic_fetch_sub(volatile __global atomic_ulong *object, ulong operand); +ulong __ovld atomic_fetch_sub(volatile __local atomic_ulong *object, ulong operand); +uintptr_t __ovld atomic_fetch_sub(volatile __global atomic_uintptr_t *object, ptrdiff_t operand); +uintptr_t __ovld atomic_fetch_sub(volatile __local atomic_uintptr_t *object, ptrdiff_t operand); +long __ovld atomic_fetch_or(volatile __global atomic_long *object, long operand); +long __ovld atomic_fetch_or(volatile __local atomic_long *object, long operand); +ulong __ovld atomic_fetch_or(volatile __global atomic_ulong *object, ulong operand); +ulong __ovld atomic_fetch_or(volatile __local atomic_ulong *object, ulong operand); +uintptr_t __ovld atomic_fetch_or(volatile __global atomic_uintptr_t *object, intptr_t operand); +uintptr_t __ovld atomic_fetch_or(volatile __local atomic_uintptr_t *object, intptr_t operand); +intptr_t __ovld atomic_fetch_or(volatile __global atomic_intptr_t *object, uintptr_t operand); +intptr_t __ovld atomic_fetch_or(volatile __local atomic_intptr_t *object, uintptr_t operand); +long __ovld atomic_fetch_xor(volatile __global atomic_long *object, long operand); +long __ovld atomic_fetch_xor(volatile __local atomic_long *object, long operand); +ulong __ovld atomic_fetch_xor(volatile __global atomic_ulong *object, ulong operand); +ulong __ovld atomic_fetch_xor(volatile __local atomic_ulong *object, ulong operand); +uintptr_t __ovld atomic_fetch_xor(volatile __global atomic_uintptr_t *object, intptr_t operand); +uintptr_t __ovld atomic_fetch_xor(volatile __local atomic_uintptr_t *object, intptr_t operand); +intptr_t __ovld atomic_fetch_xor(volatile __global atomic_intptr_t *object, uintptr_t operand); +intptr_t __ovld atomic_fetch_xor(volatile __local atomic_intptr_t *object, uintptr_t operand); +long __ovld atomic_fetch_and(volatile __global atomic_long *object, long operand); +long __ovld atomic_fetch_and(volatile __local atomic_long *object, long operand); +ulong __ovld atomic_fetch_and(volatile __global atomic_ulong *object, ulong operand); +ulong __ovld atomic_fetch_and(volatile __local atomic_ulong *object, ulong operand); +uintptr_t __ovld atomic_fetch_and(volatile __global atomic_uintptr_t *object, intptr_t operand); +uintptr_t __ovld atomic_fetch_and(volatile __local atomic_uintptr_t *object, intptr_t operand); +intptr_t __ovld atomic_fetch_and(volatile __global atomic_intptr_t *object, uintptr_t operand); +intptr_t __ovld atomic_fetch_and(volatile __local atomic_intptr_t *object, uintptr_t operand); +long __ovld atomic_fetch_min(volatile __global atomic_long *object, long operand); +long __ovld atomic_fetch_min(volatile __local atomic_long *object, long operand); +ulong __ovld atomic_fetch_min(volatile __global atomic_ulong *object, ulong operand); +ulong __ovld atomic_fetch_min(volatile __local atomic_ulong *object, ulong operand); +uintptr_t __ovld atomic_fetch_min(volatile __global atomic_uintptr_t *object, intptr_t operand); +uintptr_t __ovld atomic_fetch_min(volatile __local atomic_uintptr_t *object, intptr_t operand); +intptr_t __ovld atomic_fetch_min(volatile __global atomic_intptr_t *object, uintptr_t operand); +intptr_t __ovld atomic_fetch_min(volatile __local atomic_intptr_t *object, uintptr_t operand); +long __ovld atomic_fetch_max(volatile __global atomic_long *object, long operand); +long __ovld atomic_fetch_max(volatile __local atomic_long *object, long operand); +ulong __ovld atomic_fetch_max(volatile __global atomic_ulong *object, ulong operand); +ulong __ovld atomic_fetch_max(volatile __local atomic_ulong *object, ulong operand); +uintptr_t __ovld atomic_fetch_max(volatile __global atomic_uintptr_t *object, intptr_t operand); +uintptr_t __ovld atomic_fetch_max(volatile __local atomic_uintptr_t *object, intptr_t operand); +intptr_t __ovld atomic_fetch_max(volatile __global atomic_intptr_t *object, uintptr_t operand); +intptr_t __ovld atomic_fetch_max(volatile __local atomic_intptr_t *object, uintptr_t operand); +#endif +#endif + +#if defined(__opencl_c_generic_address_space) && defined(__opencl_c_atomic_order_seq_cst) && defined(__opencl_c_atomic_scope_device) int __ovld atomic_fetch_add(volatile atomic_int *object, int operand); -int __ovld atomic_fetch_add_explicit(volatile atomic_int *object, int operand, memory_order order); -int __ovld atomic_fetch_add_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope); uint __ovld atomic_fetch_add(volatile atomic_uint *object, uint operand); -uint __ovld atomic_fetch_add_explicit(volatile atomic_uint *object, uint operand, memory_order order); -uint __ovld atomic_fetch_add_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope); int __ovld atomic_fetch_sub(volatile atomic_int *object, int operand); -int __ovld atomic_fetch_sub_explicit(volatile atomic_int *object, int operand, memory_order order); -int __ovld atomic_fetch_sub_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope); uint __ovld atomic_fetch_sub(volatile atomic_uint *object, uint operand); -uint __ovld atomic_fetch_sub_explicit(volatile atomic_uint *object, uint operand, memory_order order); -uint __ovld atomic_fetch_sub_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope); int __ovld atomic_fetch_or(volatile atomic_int *object, int operand); -int __ovld atomic_fetch_or_explicit(volatile atomic_int *object, int operand, memory_order order); -int __ovld atomic_fetch_or_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope); uint __ovld atomic_fetch_or(volatile atomic_uint *object, uint operand); -uint __ovld atomic_fetch_or_explicit(volatile atomic_uint *object, uint operand, memory_order order); -uint __ovld atomic_fetch_or_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope); int __ovld atomic_fetch_xor(volatile atomic_int *object, int operand); -int __ovld atomic_fetch_xor_explicit(volatile atomic_int *object, int operand, memory_order order); -int __ovld atomic_fetch_xor_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope); uint __ovld atomic_fetch_xor(volatile atomic_uint *object, uint operand); -uint __ovld atomic_fetch_xor_explicit(volatile atomic_uint *object, uint operand, memory_order order); -uint __ovld atomic_fetch_xor_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope); int __ovld atomic_fetch_and(volatile atomic_int *object, int operand); -int __ovld atomic_fetch_and_explicit(volatile atomic_int *object, int operand, memory_order order); -int __ovld atomic_fetch_and_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope); uint __ovld atomic_fetch_and(volatile atomic_uint *object, uint operand); -uint __ovld atomic_fetch_and_explicit(volatile atomic_uint *object, uint operand, memory_order order); -uint __ovld atomic_fetch_and_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope); int __ovld atomic_fetch_min(volatile atomic_int *object, int operand); -int __ovld atomic_fetch_min_explicit(volatile atomic_int *object, int operand, memory_order order); -int __ovld atomic_fetch_min_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope); uint __ovld atomic_fetch_min(volatile atomic_uint *object, uint operand); -uint __ovld atomic_fetch_min_explicit(volatile atomic_uint *object, uint operand, memory_order order); -uint __ovld atomic_fetch_min_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope); int __ovld atomic_fetch_max(volatile atomic_int *object, int operand); -int __ovld atomic_fetch_max_explicit(volatile atomic_int *object, int operand, memory_order order); -int __ovld atomic_fetch_max_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope); uint __ovld atomic_fetch_max(volatile atomic_uint *object, uint operand); -uint __ovld atomic_fetch_max_explicit(volatile atomic_uint *object, uint operand, memory_order order); -uint __ovld atomic_fetch_max_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope); - #if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) long __ovld atomic_fetch_add(volatile atomic_long *object, long operand); -long __ovld atomic_fetch_add_explicit(volatile atomic_long *object, long operand, memory_order order); -long __ovld atomic_fetch_add_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope); ulong __ovld atomic_fetch_add(volatile atomic_ulong *object, ulong operand); -ulong __ovld atomic_fetch_add_explicit(volatile atomic_ulong *object, ulong operand, memory_order order); -ulong __ovld atomic_fetch_add_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); +uintptr_t __ovld atomic_fetch_add(volatile atomic_uintptr_t *object, ptrdiff_t operand); long __ovld atomic_fetch_sub(volatile atomic_long *object, long operand); -long __ovld atomic_fetch_sub_explicit(volatile atomic_long *object, long operand, memory_order order); -long __ovld atomic_fetch_sub_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope); ulong __ovld atomic_fetch_sub(volatile atomic_ulong *object, ulong operand); -ulong __ovld atomic_fetch_sub_explicit(volatile atomic_ulong *object, ulong operand, memory_order order); -ulong __ovld atomic_fetch_sub_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); +uintptr_t __ovld atomic_fetch_sub(volatile atomic_uintptr_t *object, ptrdiff_t operand); long __ovld atomic_fetch_or(volatile atomic_long *object, long operand); -long __ovld atomic_fetch_or_explicit(volatile atomic_long *object, long operand, memory_order order); -long __ovld atomic_fetch_or_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope); ulong __ovld atomic_fetch_or(volatile atomic_ulong *object, ulong operand); -ulong __ovld atomic_fetch_or_explicit(volatile atomic_ulong *object, ulong operand, memory_order order); -ulong __ovld atomic_fetch_or_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); +uintptr_t __ovld atomic_fetch_or(volatile atomic_uintptr_t *object, intptr_t operand); +intptr_t __ovld atomic_fetch_or(volatile atomic_intptr_t *object, uintptr_t operand); long __ovld atomic_fetch_xor(volatile atomic_long *object, long operand); -long __ovld atomic_fetch_xor_explicit(volatile atomic_long *object, long operand, memory_order order); -long __ovld atomic_fetch_xor_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope); ulong __ovld atomic_fetch_xor(volatile atomic_ulong *object, ulong operand); -ulong __ovld atomic_fetch_xor_explicit(volatile atomic_ulong *object, ulong operand, memory_order order); -ulong __ovld atomic_fetch_xor_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); +uintptr_t __ovld atomic_fetch_xor(volatile atomic_uintptr_t *object, intptr_t operand); +intptr_t __ovld atomic_fetch_xor(volatile atomic_intptr_t *object, uintptr_t operand); long __ovld atomic_fetch_and(volatile atomic_long *object, long operand); -long __ovld atomic_fetch_and_explicit(volatile atomic_long *object, long operand, memory_order order); -long __ovld atomic_fetch_and_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope); ulong __ovld atomic_fetch_and(volatile atomic_ulong *object, ulong operand); -ulong __ovld atomic_fetch_and_explicit(volatile atomic_ulong *object, ulong operand, memory_order order); -ulong __ovld atomic_fetch_and_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); +uintptr_t __ovld atomic_fetch_and(volatile atomic_uintptr_t *object, intptr_t operand); +intptr_t __ovld atomic_fetch_and(volatile atomic_intptr_t *object, uintptr_t operand); long __ovld atomic_fetch_min(volatile atomic_long *object, long operand); -long __ovld atomic_fetch_min_explicit(volatile atomic_long *object, long operand, memory_order order); -long __ovld atomic_fetch_min_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope); ulong __ovld atomic_fetch_min(volatile atomic_ulong *object, ulong operand); -ulong __ovld atomic_fetch_min_explicit(volatile atomic_ulong *object, ulong operand, memory_order order); -ulong __ovld atomic_fetch_min_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); +uintptr_t __ovld atomic_fetch_min(volatile atomic_uintptr_t *object, intptr_t opermax); +intptr_t __ovld atomic_fetch_min(volatile atomic_intptr_t *object, uintptr_t opermax); long __ovld atomic_fetch_max(volatile atomic_long *object, long operand); -long __ovld atomic_fetch_max_explicit(volatile atomic_long *object, long operand, memory_order order); -long __ovld atomic_fetch_max_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope); ulong __ovld atomic_fetch_max(volatile atomic_ulong *object, ulong operand); -ulong __ovld atomic_fetch_max_explicit(volatile atomic_ulong *object, ulong operand, memory_order order); -ulong __ovld atomic_fetch_max_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); -#endif //defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) +uintptr_t __ovld atomic_fetch_max(volatile atomic_uintptr_t *object, intptr_t opermax); +intptr_t __ovld atomic_fetch_max(volatile atomic_intptr_t *object, uintptr_t opermax); +#endif +#endif -// OpenCL v2.0 s6.13.11.7.5: -// add/sub: atomic type argument can be uintptr_t/intptr_t, value type argument can be ptrdiff_t. -// or/xor/and/min/max: atomic type argument can be intptr_t/uintptr_t, value type argument can be intptr_t/uintptr_t. +#if __OPENCL_C_VERSION__ >= CL_VERSION_3_0 && defined(__opencl_c_atomic_scope_device) +int __ovld atomic_fetch_add_explicit(volatile __global atomic_int *object, int operand, memory_order order); +int __ovld atomic_fetch_add_explicit(volatile __local atomic_int *object, int operand, memory_order order); +uint __ovld atomic_fetch_add_explicit(volatile __global atomic_uint *object, uint operand, memory_order order); +uint __ovld atomic_fetch_add_explicit(volatile __local atomic_uint *object, uint operand, memory_order order); +int __ovld atomic_fetch_sub_explicit(volatile __global atomic_int *object, int operand, memory_order order); +int __ovld atomic_fetch_sub_explicit(volatile __local atomic_int *object, int operand, memory_order order); +uint __ovld atomic_fetch_sub_explicit(volatile __global atomic_uint *object, uint operand, memory_order order); +uint __ovld atomic_fetch_sub_explicit(volatile __local atomic_uint *object, uint operand, memory_order order); +int __ovld atomic_fetch_or_explicit(volatile __global atomic_int *object, int operand, memory_order order); +int __ovld atomic_fetch_or_explicit(volatile __local atomic_int *object, int operand, memory_order order); +uint __ovld atomic_fetch_or_explicit(volatile __global atomic_uint *object, uint operand, memory_order order); +uint __ovld atomic_fetch_or_explicit(volatile __local atomic_uint *object, uint operand, memory_order order); +int __ovld atomic_fetch_xor_explicit(volatile __global atomic_int *object, int operand, memory_order order); +int __ovld atomic_fetch_xor_explicit(volatile __local atomic_int *object, int operand, memory_order order); +uint __ovld atomic_fetch_xor_explicit(volatile __global atomic_uint *object, uint operand, memory_order order); +uint __ovld atomic_fetch_xor_explicit(volatile __local atomic_uint *object, uint operand, memory_order order); +int __ovld atomic_fetch_and_explicit(volatile __global atomic_int *object, int operand, memory_order order); +int __ovld atomic_fetch_and_explicit(volatile __local atomic_int *object, int operand, memory_order order); +uint __ovld atomic_fetch_and_explicit(volatile __global atomic_uint *object, uint operand, memory_order order); +uint __ovld atomic_fetch_and_explicit(volatile __local atomic_uint *object, uint operand, memory_order order); +int __ovld atomic_fetch_min_explicit(volatile __global atomic_int *object, int operand, memory_order order); +int __ovld atomic_fetch_min_explicit(volatile __local atomic_int *object, int operand, memory_order order); +uint __ovld atomic_fetch_min_explicit(volatile __global atomic_uint *object, uint operand, memory_order order); +uint __ovld atomic_fetch_min_explicit(volatile __local atomic_uint *object, uint operand, memory_order order); +int __ovld atomic_fetch_max_explicit(volatile __global atomic_int *object, int operand, memory_order order); +int __ovld atomic_fetch_max_explicit(volatile __local atomic_int *object, int operand, memory_order order); +uint __ovld atomic_fetch_max_explicit(volatile __global atomic_uint *object, uint operand, memory_order order); +uint __ovld atomic_fetch_max_explicit(volatile __local atomic_uint *object, uint operand, memory_order order); +#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) +long __ovld atomic_fetch_add_explicit(volatile __global atomic_long *object, long operand, memory_order order); +long __ovld atomic_fetch_add_explicit(volatile __local atomic_long *object, long operand, memory_order order); +ulong __ovld atomic_fetch_add_explicit(volatile __global atomic_ulong *object, ulong operand, memory_order order); +ulong __ovld atomic_fetch_add_explicit(volatile __local atomic_ulong *object, ulong operand, memory_order order); +uintptr_t __ovld atomic_fetch_add_explicit(volatile __global atomic_uintptr_t *object, ptrdiff_t operand, memory_order order); +uintptr_t __ovld atomic_fetch_add_explicit(volatile __local atomic_uintptr_t *object, ptrdiff_t operand, memory_order order); +long __ovld atomic_fetch_sub_explicit(volatile __global atomic_long *object, long operand, memory_order order); +long __ovld atomic_fetch_sub_explicit(volatile __local atomic_long *object, long operand, memory_order order); +ulong __ovld atomic_fetch_sub_explicit(volatile __global atomic_ulong *object, ulong operand, memory_order order); +ulong __ovld atomic_fetch_sub_explicit(volatile __local atomic_ulong *object, ulong operand, memory_order order); +uintptr_t __ovld atomic_fetch_sub_explicit(volatile __global atomic_uintptr_t *object, ptrdiff_t operand, memory_order order); +uintptr_t __ovld atomic_fetch_sub_explicit(volatile __local atomic_uintptr_t *object, ptrdiff_t operand, memory_order order); +long __ovld atomic_fetch_or_explicit(volatile __global atomic_long *object, long operand, memory_order order); +long __ovld atomic_fetch_or_explicit(volatile __local atomic_long *object, long operand, memory_order order); +ulong __ovld atomic_fetch_or_explicit(volatile __global atomic_ulong *object, ulong operand, memory_order order); +ulong __ovld atomic_fetch_or_explicit(volatile __local atomic_ulong *object, ulong operand, memory_order order); +uintptr_t __ovld atomic_fetch_or_explicit(volatile __global atomic_uintptr_t *object, intptr_t operand, memory_order order); +uintptr_t __ovld atomic_fetch_or_explicit(volatile __local atomic_uintptr_t *object, intptr_t operand, memory_order order); +intptr_t __ovld atomic_fetch_or_explicit(volatile __global atomic_intptr_t *object, uintptr_t operand, memory_order order); +intptr_t __ovld atomic_fetch_or_explicit(volatile __local atomic_intptr_t *object, uintptr_t operand, memory_order order); +long __ovld atomic_fetch_xor_explicit(volatile __global atomic_long *object, long operand, memory_order order); +long __ovld atomic_fetch_xor_explicit(volatile __local atomic_long *object, long operand, memory_order order); +ulong __ovld atomic_fetch_xor_explicit(volatile __global atomic_ulong *object, ulong operand, memory_order order); +ulong __ovld atomic_fetch_xor_explicit(volatile __local atomic_ulong *object, ulong operand, memory_order order); +uintptr_t __ovld atomic_fetch_xor_explicit(volatile __global atomic_uintptr_t *object, intptr_t operand, memory_order order); +uintptr_t __ovld atomic_fetch_xor_explicit(volatile __local atomic_uintptr_t *object, intptr_t operand, memory_order order); +intptr_t __ovld atomic_fetch_xor_explicit(volatile __global atomic_intptr_t *object, uintptr_t operand, memory_order order); +intptr_t __ovld atomic_fetch_xor_explicit(volatile __local atomic_intptr_t *object, uintptr_t operand, memory_order order); +long __ovld atomic_fetch_and_explicit(volatile __global atomic_long *object, long operand, memory_order order); +long __ovld atomic_fetch_and_explicit(volatile __local atomic_long *object, long operand, memory_order order); +ulong __ovld atomic_fetch_and_explicit(volatile __global atomic_ulong *object, ulong operand, memory_order order); +ulong __ovld atomic_fetch_and_explicit(volatile __local atomic_ulong *object, ulong operand, memory_order order); +uintptr_t __ovld atomic_fetch_and_explicit(volatile __global atomic_uintptr_t *object, intptr_t operand, memory_order order); +uintptr_t __ovld atomic_fetch_and_explicit(volatile __local atomic_uintptr_t *object, intptr_t operand, memory_order order); +intptr_t __ovld atomic_fetch_and_explicit(volatile __global atomic_intptr_t *object, uintptr_t operand, memory_order order); +intptr_t __ovld atomic_fetch_and_explicit(volatile __local atomic_intptr_t *object, uintptr_t operand, memory_order order); +long __ovld atomic_fetch_min_explicit(volatile __global atomic_long *object, long operand, memory_order order); +long __ovld atomic_fetch_min_explicit(volatile __local atomic_long *object, long operand, memory_order order); +ulong __ovld atomic_fetch_min_explicit(volatile __global atomic_ulong *object, ulong operand, memory_order order); +ulong __ovld atomic_fetch_min_explicit(volatile __local atomic_ulong *object, ulong operand, memory_order order); +uintptr_t __ovld atomic_fetch_min_explicit(volatile __global atomic_uintptr_t *object, intptr_t operand, memory_order order); +uintptr_t __ovld atomic_fetch_min_explicit(volatile __local atomic_uintptr_t *object, intptr_t operand, memory_order order); +intptr_t __ovld atomic_fetch_min_explicit(volatile __global atomic_intptr_t *object, uintptr_t operand, memory_order order); +intptr_t __ovld atomic_fetch_min_explicit(volatile __local atomic_intptr_t *object, uintptr_t operand, memory_order order); +long __ovld atomic_fetch_max_explicit(volatile __global atomic_long *object, long operand, memory_order order); +long __ovld atomic_fetch_max_explicit(volatile __local atomic_long *object, long operand, memory_order order); +ulong __ovld atomic_fetch_max_explicit(volatile __global atomic_ulong *object, ulong operand, memory_order order); +ulong __ovld atomic_fetch_max_explicit(volatile __local atomic_ulong *object, ulong operand, memory_order order); +uintptr_t __ovld atomic_fetch_max_explicit(volatile __global atomic_uintptr_t *object, intptr_t operand, memory_order order); +uintptr_t __ovld atomic_fetch_max_explicit(volatile __local atomic_uintptr_t *object, intptr_t operand, memory_order order); +intptr_t __ovld atomic_fetch_max_explicit(volatile __global atomic_intptr_t *object, uintptr_t operand, memory_order order); +intptr_t __ovld atomic_fetch_max_explicit(volatile __local atomic_intptr_t *object, uintptr_t operand, memory_order order); +#endif +#endif +#if defined(__opencl_c_generic_address_space) && defined(__opencl_c_atomic_scope_device) +int __ovld atomic_fetch_add_explicit(volatile atomic_int *object, int operand, memory_order order); +uint __ovld atomic_fetch_add_explicit(volatile atomic_uint *object, uint operand, memory_order order); +int __ovld atomic_fetch_sub_explicit(volatile atomic_int *object, int operand, memory_order order); +uint __ovld atomic_fetch_sub_explicit(volatile atomic_uint *object, uint operand, memory_order order); +int __ovld atomic_fetch_or_explicit(volatile atomic_int *object, int operand, memory_order order); +uint __ovld atomic_fetch_or_explicit(volatile atomic_uint *object, uint operand, memory_order order); +int __ovld atomic_fetch_xor_explicit(volatile atomic_int *object, int operand, memory_order order); +uint __ovld atomic_fetch_xor_explicit(volatile atomic_uint *object, uint operand, memory_order order); +int __ovld atomic_fetch_and_explicit(volatile atomic_int *object, int operand, memory_order order); +uint __ovld atomic_fetch_and_explicit(volatile atomic_uint *object, uint operand, memory_order order); +int __ovld atomic_fetch_min_explicit(volatile atomic_int *object, int operand, memory_order order); +uint __ovld atomic_fetch_min_explicit(volatile atomic_uint *object, uint operand, memory_order order); +int __ovld atomic_fetch_max_explicit(volatile atomic_int *object, int operand, memory_order order); +uint __ovld atomic_fetch_max_explicit(volatile atomic_uint *object, uint operand, memory_order order); #if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) -uintptr_t __ovld atomic_fetch_add(volatile atomic_uintptr_t *object, ptrdiff_t operand); +long __ovld atomic_fetch_add_explicit(volatile atomic_long *object, long operand, memory_order order); +ulong __ovld atomic_fetch_add_explicit(volatile atomic_ulong *object, ulong operand, memory_order order); uintptr_t __ovld atomic_fetch_add_explicit(volatile atomic_uintptr_t *object, ptrdiff_t operand, memory_order order); -uintptr_t __ovld atomic_fetch_add_explicit(volatile atomic_uintptr_t *object, ptrdiff_t operand, memory_order order, memory_scope scope); -uintptr_t __ovld atomic_fetch_sub(volatile atomic_uintptr_t *object, ptrdiff_t operand); +long __ovld atomic_fetch_sub_explicit(volatile atomic_long *object, long operand, memory_order order); +ulong __ovld atomic_fetch_sub_explicit(volatile atomic_ulong *object, ulong operand, memory_order order); uintptr_t __ovld atomic_fetch_sub_explicit(volatile atomic_uintptr_t *object, ptrdiff_t operand, memory_order order); -uintptr_t __ovld atomic_fetch_sub_explicit(volatile atomic_uintptr_t *object, ptrdiff_t operand, memory_order order, memory_scope scope); - -uintptr_t __ovld atomic_fetch_or(volatile atomic_uintptr_t *object, intptr_t operand); +long __ovld atomic_fetch_or_explicit(volatile atomic_long *object, long operand, memory_order order); +ulong __ovld atomic_fetch_or_explicit(volatile atomic_ulong *object, ulong operand, memory_order order); uintptr_t __ovld atomic_fetch_or_explicit(volatile atomic_uintptr_t *object, intptr_t operand, memory_order order); -uintptr_t __ovld atomic_fetch_or_explicit(volatile atomic_uintptr_t *object, intptr_t operand, memory_order order, memory_scope scope); -uintptr_t __ovld atomic_fetch_xor(volatile atomic_uintptr_t *object, intptr_t operand); +intptr_t __ovld atomic_fetch_or_explicit(volatile atomic_intptr_t *object, uintptr_t operand, memory_order order); +long __ovld atomic_fetch_xor_explicit(volatile atomic_long *object, long operand, memory_order order); +ulong __ovld atomic_fetch_xor_explicit(volatile atomic_ulong *object, ulong operand, memory_order order); uintptr_t __ovld atomic_fetch_xor_explicit(volatile atomic_uintptr_t *object, intptr_t operand, memory_order order); -uintptr_t __ovld atomic_fetch_xor_explicit(volatile atomic_uintptr_t *object, intptr_t operand, memory_order order, memory_scope scope); -uintptr_t __ovld atomic_fetch_and(volatile atomic_uintptr_t *object, intptr_t operand); +intptr_t __ovld atomic_fetch_xor_explicit(volatile atomic_intptr_t *object, uintptr_t operand, memory_order order); +long __ovld atomic_fetch_and_explicit(volatile atomic_long *object, long operand, memory_order order); +ulong __ovld atomic_fetch_and_explicit(volatile atomic_ulong *object, ulong operand, memory_order order); uintptr_t __ovld atomic_fetch_and_explicit(volatile atomic_uintptr_t *object, intptr_t operand, memory_order order); -uintptr_t __ovld atomic_fetch_and_explicit(volatile atomic_uintptr_t *object, intptr_t operand, memory_order order, memory_scope scope); -uintptr_t __ovld atomic_fetch_min(volatile atomic_uintptr_t *object, intptr_t opermax); +intptr_t __ovld atomic_fetch_and_explicit(volatile atomic_intptr_t *object, uintptr_t operand, memory_order order); +long __ovld atomic_fetch_min_explicit(volatile atomic_long *object, long operand, memory_order order); +ulong __ovld atomic_fetch_min_explicit(volatile atomic_ulong *object, ulong operand, memory_order order); uintptr_t __ovld atomic_fetch_min_explicit(volatile atomic_uintptr_t *object, intptr_t opermax, memory_order minder); -uintptr_t __ovld atomic_fetch_min_explicit(volatile atomic_uintptr_t *object, intptr_t opermax, memory_order minder, memory_scope scope); -uintptr_t __ovld atomic_fetch_max(volatile atomic_uintptr_t *object, intptr_t opermax); +intptr_t __ovld atomic_fetch_min_explicit(volatile atomic_intptr_t *object, uintptr_t opermax, memory_order minder); +long __ovld atomic_fetch_max_explicit(volatile atomic_long *object, long operand, memory_order order); +ulong __ovld atomic_fetch_max_explicit(volatile atomic_ulong *object, ulong operand, memory_order order); uintptr_t __ovld atomic_fetch_max_explicit(volatile atomic_uintptr_t *object, intptr_t opermax, memory_order minder); -uintptr_t __ovld atomic_fetch_max_explicit(volatile atomic_uintptr_t *object, intptr_t opermax, memory_order minder, memory_scope scope); +intptr_t __ovld atomic_fetch_max_explicit(volatile atomic_intptr_t *object, uintptr_t opermax, memory_order minder); +#endif +#endif -intptr_t __ovld atomic_fetch_or(volatile atomic_intptr_t *object, uintptr_t operand); -intptr_t __ovld atomic_fetch_or_explicit(volatile atomic_intptr_t *object, uintptr_t operand, memory_order order); +#if __OPENCL_C_VERSION__ >= CL_VERSION_3_0 +int __ovld atomic_fetch_add_explicit(volatile __global atomic_int *object, int operand, memory_order order, memory_scope scope); +int __ovld atomic_fetch_add_explicit(volatile __local atomic_int *object, int operand, memory_order order, memory_scope scope); +uint __ovld atomic_fetch_add_explicit(volatile __global atomic_uint *object, uint operand, memory_order order, memory_scope scope); +uint __ovld atomic_fetch_add_explicit(volatile __local atomic_uint *object, uint operand, memory_order order, memory_scope scope); +int __ovld atomic_fetch_sub_explicit(volatile __global atomic_int *object, int operand, memory_order order, memory_scope scope); +int __ovld atomic_fetch_sub_explicit(volatile __local atomic_int *object, int operand, memory_order order, memory_scope scope); +uint __ovld atomic_fetch_sub_explicit(volatile __global atomic_uint *object, uint operand, memory_order order, memory_scope scope); +uint __ovld atomic_fetch_sub_explicit(volatile __local atomic_uint *object, uint operand, memory_order order, memory_scope scope); +int __ovld atomic_fetch_or_explicit(volatile __global atomic_int *object, int operand, memory_order order, memory_scope scope); +int __ovld atomic_fetch_or_explicit(volatile __local atomic_int *object, int operand, memory_order order, memory_scope scope); +uint __ovld atomic_fetch_or_explicit(volatile __global atomic_uint *object, uint operand, memory_order order, memory_scope scope); +uint __ovld atomic_fetch_or_explicit(volatile __local atomic_uint *object, uint operand, memory_order order, memory_scope scope); +int __ovld atomic_fetch_xor_explicit(volatile __global atomic_int *object, int operand, memory_order order, memory_scope scope); +int __ovld atomic_fetch_xor_explicit(volatile __local atomic_int *object, int operand, memory_order order, memory_scope scope); +uint __ovld atomic_fetch_xor_explicit(volatile __global atomic_uint *object, uint operand, memory_order order, memory_scope scope); +uint __ovld atomic_fetch_xor_explicit(volatile __local atomic_uint *object, uint operand, memory_order order, memory_scope scope); +int __ovld atomic_fetch_and_explicit(volatile __global atomic_int *object, int operand, memory_order order, memory_scope scope); +int __ovld atomic_fetch_and_explicit(volatile __local atomic_int *object, int operand, memory_order order, memory_scope scope); +uint __ovld atomic_fetch_and_explicit(volatile __global atomic_uint *object, uint operand, memory_order order, memory_scope scope); +uint __ovld atomic_fetch_and_explicit(volatile __local atomic_uint *object, uint operand, memory_order order, memory_scope scope); +int __ovld atomic_fetch_min_explicit(volatile __global atomic_int *object, int operand, memory_order order, memory_scope scope); +int __ovld atomic_fetch_min_explicit(volatile __local atomic_int *object, int operand, memory_order order, memory_scope scope); +uint __ovld atomic_fetch_min_explicit(volatile __global atomic_uint *object, uint operand, memory_order order, memory_scope scope); +uint __ovld atomic_fetch_min_explicit(volatile __local atomic_uint *object, uint operand, memory_order order, memory_scope scope); +int __ovld atomic_fetch_max_explicit(volatile __global atomic_int *object, int operand, memory_order order, memory_scope scope); +int __ovld atomic_fetch_max_explicit(volatile __local atomic_int *object, int operand, memory_order order, memory_scope scope); +uint __ovld atomic_fetch_max_explicit(volatile __global atomic_uint *object, uint operand, memory_order order, memory_scope scope); +uint __ovld atomic_fetch_max_explicit(volatile __local atomic_uint *object, uint operand, memory_order order, memory_scope scope); +#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) +long __ovld atomic_fetch_add_explicit(volatile __global atomic_long *object, long operand, memory_order order, memory_scope scope); +long __ovld atomic_fetch_add_explicit(volatile __local atomic_long *object, long operand, memory_order order, memory_scope scope); +uintptr_t __ovld atomic_fetch_add_explicit(volatile __global atomic_uintptr_t *object, ptrdiff_t operand, memory_order order, memory_scope scope); +uintptr_t __ovld atomic_fetch_add_explicit(volatile __local atomic_uintptr_t *object, ptrdiff_t operand, memory_order order, memory_scope scope); +ulong __ovld atomic_fetch_add_explicit(volatile __global atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); +ulong __ovld atomic_fetch_add_explicit(volatile __local atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); +long __ovld atomic_fetch_sub_explicit(volatile __global atomic_long *object, long operand, memory_order order, memory_scope scope); +long __ovld atomic_fetch_sub_explicit(volatile __local atomic_long *object, long operand, memory_order order, memory_scope scope); +ulong __ovld atomic_fetch_sub_explicit(volatile __global atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); +ulong __ovld atomic_fetch_sub_explicit(volatile __local atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); +uintptr_t __ovld atomic_fetch_sub_explicit(volatile __global atomic_uintptr_t *object, ptrdiff_t operand, memory_order order, memory_scope scope); +uintptr_t __ovld atomic_fetch_sub_explicit(volatile __local atomic_uintptr_t *object, ptrdiff_t operand, memory_order order, memory_scope scope); +long __ovld atomic_fetch_or_explicit(volatile __global atomic_long *object, long operand, memory_order order, memory_scope scope); +long __ovld atomic_fetch_or_explicit(volatile __local atomic_long *object, long operand, memory_order order, memory_scope scope); +ulong __ovld atomic_fetch_or_explicit(volatile __global atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); +ulong __ovld atomic_fetch_or_explicit(volatile __local atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); +uintptr_t __ovld atomic_fetch_or_explicit(volatile __global atomic_uintptr_t *object, intptr_t operand, memory_order order, memory_scope scope); +uintptr_t __ovld atomic_fetch_or_explicit(volatile __local atomic_uintptr_t *object, intptr_t operand, memory_order order, memory_scope scope); +intptr_t __ovld atomic_fetch_or_explicit(volatile __global atomic_intptr_t *object, uintptr_t operand, memory_order order, memory_scope scope); +intptr_t __ovld atomic_fetch_or_explicit(volatile __local atomic_intptr_t *object, uintptr_t operand, memory_order order, memory_scope scope); +long __ovld atomic_fetch_xor_explicit(volatile __global atomic_long *object, long operand, memory_order order, memory_scope scope); +long __ovld atomic_fetch_xor_explicit(volatile __local atomic_long *object, long operand, memory_order order, memory_scope scope); +ulong __ovld atomic_fetch_xor_explicit(volatile __global atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); +ulong __ovld atomic_fetch_xor_explicit(volatile __local atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); +uintptr_t __ovld atomic_fetch_xor_explicit(volatile __global atomic_uintptr_t *object, intptr_t operand, memory_order order, memory_scope scope); +uintptr_t __ovld atomic_fetch_xor_explicit(volatile __local atomic_uintptr_t *object, intptr_t operand, memory_order order, memory_scope scope); +intptr_t __ovld atomic_fetch_xor_explicit(volatile __global atomic_intptr_t *object, uintptr_t operand, memory_order order, memory_scope scope); +intptr_t __ovld atomic_fetch_xor_explicit(volatile __local atomic_intptr_t *object, uintptr_t operand, memory_order order, memory_scope scope); +long __ovld atomic_fetch_and_explicit(volatile __global atomic_long *object, long operand, memory_order order, memory_scope scope); +long __ovld atomic_fetch_and_explicit(volatile __local atomic_long *object, long operand, memory_order order, memory_scope scope); +ulong __ovld atomic_fetch_and_explicit(volatile __global atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); +ulong __ovld atomic_fetch_and_explicit(volatile __local atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); +uintptr_t __ovld atomic_fetch_and_explicit(volatile __global atomic_uintptr_t *object, intptr_t operand, memory_order order, memory_scope scope); +uintptr_t __ovld atomic_fetch_and_explicit(volatile __local atomic_uintptr_t *object, intptr_t operand, memory_order order, memory_scope scope); +intptr_t __ovld atomic_fetch_and_explicit(volatile __global atomic_intptr_t *object, uintptr_t operand, memory_order order, memory_scope scope); +intptr_t __ovld atomic_fetch_and_explicit(volatile __local atomic_intptr_t *object, uintptr_t operand, memory_order order, memory_scope scope); +long __ovld atomic_fetch_min_explicit(volatile __global atomic_long *object, long operand, memory_order order, memory_scope scope); +long __ovld atomic_fetch_min_explicit(volatile __local atomic_long *object, long operand, memory_order order, memory_scope scope); +ulong __ovld atomic_fetch_min_explicit(volatile __global atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); +ulong __ovld atomic_fetch_min_explicit(volatile __local atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); +uintptr_t __ovld atomic_fetch_min_explicit(volatile __global atomic_uintptr_t *object, intptr_t operand, memory_order order, memory_scope scope); +uintptr_t __ovld atomic_fetch_min_explicit(volatile __local atomic_uintptr_t *object, intptr_t operand, memory_order order, memory_scope scope); +intptr_t __ovld atomic_fetch_min_explicit(volatile __global atomic_intptr_t *object, uintptr_t operand, memory_order order, memory_scope scope); +intptr_t __ovld atomic_fetch_min_explicit(volatile __local atomic_intptr_t *object, uintptr_t operand, memory_order order, memory_scope scope); +long __ovld atomic_fetch_max_explicit(volatile __global atomic_long *object, long operand, memory_order order, memory_scope scope); +long __ovld atomic_fetch_max_explicit(volatile __local atomic_long *object, long operand, memory_order order, memory_scope scope); +ulong __ovld atomic_fetch_max_explicit(volatile __global atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); +ulong __ovld atomic_fetch_max_explicit(volatile __local atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); +uintptr_t __ovld atomic_fetch_max_explicit(volatile __global atomic_uintptr_t *object, intptr_t operand, memory_order order, memory_scope scope); +uintptr_t __ovld atomic_fetch_max_explicit(volatile __local atomic_uintptr_t *object, intptr_t operand, memory_order order, memory_scope scope); +intptr_t __ovld atomic_fetch_max_explicit(volatile __global atomic_intptr_t *object, uintptr_t operand, memory_order order, memory_scope scope); +intptr_t __ovld atomic_fetch_max_explicit(volatile __local atomic_intptr_t *object, uintptr_t operand, memory_order order, memory_scope scope); +#endif +#endif + +#if defined(__opencl_c_generic_address_space) +int __ovld atomic_fetch_add_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope); +uint __ovld atomic_fetch_add_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope); +int __ovld atomic_fetch_sub_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope); +uint __ovld atomic_fetch_sub_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope); +int __ovld atomic_fetch_or_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope); +uint __ovld atomic_fetch_or_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope); +int __ovld atomic_fetch_xor_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope); +uint __ovld atomic_fetch_xor_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope); +int __ovld atomic_fetch_and_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope); +uint __ovld atomic_fetch_and_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope); +int __ovld atomic_fetch_min_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope); +uint __ovld atomic_fetch_min_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope); +int __ovld atomic_fetch_max_explicit(volatile atomic_int *object, int operand, memory_order order, memory_scope scope); +uint __ovld atomic_fetch_max_explicit(volatile atomic_uint *object, uint operand, memory_order order, memory_scope scope); +#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) +long __ovld atomic_fetch_add_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope); +ulong __ovld atomic_fetch_add_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); +uintptr_t __ovld atomic_fetch_add_explicit(volatile atomic_uintptr_t *object, ptrdiff_t operand, memory_order order, memory_scope scope); +long __ovld atomic_fetch_sub_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope); +ulong __ovld atomic_fetch_sub_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); +uintptr_t __ovld atomic_fetch_sub_explicit(volatile atomic_uintptr_t *object, ptrdiff_t operand, memory_order order, memory_scope scope); +long __ovld atomic_fetch_or_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope); +ulong __ovld atomic_fetch_or_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); +uintptr_t __ovld atomic_fetch_or_explicit(volatile atomic_uintptr_t *object, intptr_t operand, memory_order order, memory_scope scope); intptr_t __ovld atomic_fetch_or_explicit(volatile atomic_intptr_t *object, uintptr_t operand, memory_order order, memory_scope scope); -intptr_t __ovld atomic_fetch_xor(volatile atomic_intptr_t *object, uintptr_t operand); -intptr_t __ovld atomic_fetch_xor_explicit(volatile atomic_intptr_t *object, uintptr_t operand, memory_order order); +long __ovld atomic_fetch_xor_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope); +ulong __ovld atomic_fetch_xor_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); +uintptr_t __ovld atomic_fetch_xor_explicit(volatile atomic_uintptr_t *object, intptr_t operand, memory_order order, memory_scope scope); intptr_t __ovld atomic_fetch_xor_explicit(volatile atomic_intptr_t *object, uintptr_t operand, memory_order order, memory_scope scope); -intptr_t __ovld atomic_fetch_and(volatile atomic_intptr_t *object, uintptr_t operand); -intptr_t __ovld atomic_fetch_and_explicit(volatile atomic_intptr_t *object, uintptr_t operand, memory_order order); +long __ovld atomic_fetch_and_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope); +ulong __ovld atomic_fetch_and_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); +uintptr_t __ovld atomic_fetch_and_explicit(volatile atomic_uintptr_t *object, intptr_t operand, memory_order order, memory_scope scope); intptr_t __ovld atomic_fetch_and_explicit(volatile atomic_intptr_t *object, uintptr_t operand, memory_order order, memory_scope scope); -intptr_t __ovld atomic_fetch_min(volatile atomic_intptr_t *object, uintptr_t opermax); -intptr_t __ovld atomic_fetch_min_explicit(volatile atomic_intptr_t *object, uintptr_t opermax, memory_order minder); +long __ovld atomic_fetch_min_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope); +ulong __ovld atomic_fetch_min_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); +uintptr_t __ovld atomic_fetch_min_explicit(volatile atomic_uintptr_t *object, intptr_t opermax, memory_order minder, memory_scope scope); intptr_t __ovld atomic_fetch_min_explicit(volatile atomic_intptr_t *object, uintptr_t opermax, memory_order minder, memory_scope scope); -intptr_t __ovld atomic_fetch_max(volatile atomic_intptr_t *object, uintptr_t opermax); -intptr_t __ovld atomic_fetch_max_explicit(volatile atomic_intptr_t *object, uintptr_t opermax, memory_order minder); +long __ovld atomic_fetch_max_explicit(volatile atomic_long *object, long operand, memory_order order, memory_scope scope); +ulong __ovld atomic_fetch_max_explicit(volatile atomic_ulong *object, ulong operand, memory_order order, memory_scope scope); +uintptr_t __ovld atomic_fetch_max_explicit(volatile atomic_uintptr_t *object, intptr_t opermax, memory_order minder, memory_scope scope); intptr_t __ovld atomic_fetch_max_explicit(volatile atomic_intptr_t *object, uintptr_t opermax, memory_order minder, memory_scope scope); #endif +#endif // atomic_store() +#if __OPENCL_C_VERSION__ >= CL_VERSION_3_0 && defined(__opencl_c_atomic_order_seq_cst) && defined(__opencl_c_atomic_scope_device) +void __ovld atomic_store(volatile __global atomic_int *object, int desired); +void __ovld atomic_store(volatile __local atomic_int *object, int desired); +void __ovld atomic_store(volatile __global atomic_uint *object, uint desired); +void __ovld atomic_store(volatile __local atomic_uint *object, uint desired); +void __ovld atomic_store(volatile __global atomic_float *object, float desired); +void __ovld atomic_store(volatile __local atomic_float *object, float desired); +#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) +#ifdef cl_khr_fp64 +void __ovld atomic_store(volatile __global atomic_double *object, double desired); +void __ovld atomic_store(volatile __local atomic_double *object, double desired); +#endif //cl_khr_fp64 +void __ovld atomic_store(volatile __global atomic_long *object, long desired); +void __ovld atomic_store(volatile __local atomic_long *object, long desired); +void __ovld atomic_store(volatile __global atomic_ulong *object, ulong desired); +void __ovld atomic_store(volatile __local atomic_ulong *object, ulong desired); +#endif +#endif +#if defined(__opencl_c_generic_address_space) && defined(__opencl_c_atomic_order_seq_cst) && defined(__opencl_c_atomic_scope_device) void __ovld atomic_store(volatile atomic_int *object, int desired); -void __ovld atomic_store_explicit(volatile atomic_int *object, int desired, memory_order order); -void __ovld atomic_store_explicit(volatile atomic_int *object, int desired, memory_order order, memory_scope scope); void __ovld atomic_store(volatile atomic_uint *object, uint desired); -void __ovld atomic_store_explicit(volatile atomic_uint *object, uint desired, memory_order order); -void __ovld atomic_store_explicit(volatile atomic_uint *object, uint desired, memory_order order, memory_scope scope); void __ovld atomic_store(volatile atomic_float *object, float desired); -void __ovld atomic_store_explicit(volatile atomic_float *object, float desired, memory_order order); -void __ovld atomic_store_explicit(volatile atomic_float *object, float desired, memory_order order, memory_scope scope); #if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) #ifdef cl_khr_fp64 void __ovld atomic_store(volatile atomic_double *object, double desired); -void __ovld atomic_store_explicit(volatile atomic_double *object, double desired, memory_order order); -void __ovld atomic_store_explicit(volatile atomic_double *object, double desired, memory_order order, memory_scope scope); #endif //cl_khr_fp64 void __ovld atomic_store(volatile atomic_long *object, long desired); -void __ovld atomic_store_explicit(volatile atomic_long *object, long desired, memory_order order); -void __ovld atomic_store_explicit(volatile atomic_long *object, long desired, memory_order order, memory_scope scope); void __ovld atomic_store(volatile atomic_ulong *object, ulong desired); -void __ovld atomic_store_explicit(volatile atomic_ulong *object, ulong desired, memory_order order); -void __ovld atomic_store_explicit(volatile atomic_ulong *object, ulong desired, memory_order order, memory_scope scope); +#endif #endif -// atomic_load() +#if __OPENCL_C_VERSION__ >= CL_VERSION_3_0 && defined(__opencl_c_atomic_scope_device) +void __ovld atomic_store_explicit(volatile __global atomic_int *object, int desired, memory_order order); +void __ovld atomic_store_explicit(volatile __local atomic_int *object, int desired, memory_order order); +void __ovld atomic_store_explicit(volatile __global atomic_uint *object, uint desired, memory_order order); +void __ovld atomic_store_explicit(volatile __local atomic_uint *object, uint desired, memory_order order); +void __ovld atomic_store_explicit(volatile __global atomic_float *object, float desired, memory_order order); +void __ovld atomic_store_explicit(volatile __local atomic_float *object, float desired, memory_order order); +#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) +#ifdef cl_khr_fp64 +void __ovld atomic_store_explicit(volatile __global atomic_double *object, double desired, memory_order order); +void __ovld atomic_store_explicit(volatile __local atomic_double *object, double desired, memory_order order); +#endif +void __ovld atomic_store_explicit(volatile __global atomic_long *object, long desired, memory_order order); +void __ovld atomic_store_explicit(volatile __local atomic_long *object, long desired, memory_order order); +void __ovld atomic_store_explicit(volatile __global atomic_ulong *object, ulong desired, memory_order order); +void __ovld atomic_store_explicit(volatile __local atomic_ulong *object, ulong desired, memory_order order); +#endif +#endif -int __ovld atomic_load(volatile atomic_int *object); -int __ovld atomic_load_explicit(volatile atomic_int *object, memory_order order); -int __ovld atomic_load_explicit(volatile atomic_int *object, memory_order order, memory_scope scope); +#if defined(__opencl_c_generic_address_space) && defined(__opencl_c_atomic_scope_device) +void __ovld atomic_store_explicit(volatile atomic_int *object, int desired, memory_order order); +void __ovld atomic_store_explicit(volatile atomic_uint *object, uint desired, memory_order order); +void __ovld atomic_store_explicit(volatile atomic_float *object, float desired, memory_order order); +#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) +#ifdef cl_khr_fp64 +void __ovld atomic_store_explicit(volatile atomic_double *object, double desired, memory_order order); +#endif +void __ovld atomic_store_explicit(volatile atomic_long *object, long desired, memory_order order); +void __ovld atomic_store_explicit(volatile atomic_ulong *object, ulong desired, memory_order order); +#endif +#endif + +#if __OPENCL_C_VERSION__ >= CL_VERSION_3_0 +void __ovld atomic_store_explicit(volatile __global atomic_int *object, int desired, memory_order order, memory_scope scope); +void __ovld atomic_store_explicit(volatile __local atomic_int *object, int desired, memory_order order, memory_scope scope); +void __ovld atomic_store_explicit(volatile __global atomic_uint *object, uint desired, memory_order order, memory_scope scope); +void __ovld atomic_store_explicit(volatile __local atomic_uint *object, uint desired, memory_order order, memory_scope scope); +void __ovld atomic_store_explicit(volatile __global atomic_float *object, float desired, memory_order order, memory_scope scope); +void __ovld atomic_store_explicit(volatile __local atomic_float *object, float desired, memory_order order, memory_scope scope); +#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) +#ifdef cl_khr_fp64 +void __ovld atomic_store_explicit(volatile __global atomic_double *object, double desired, memory_order order, memory_scope scope); +void __ovld atomic_store_explicit(volatile __local atomic_double *object, double desired, memory_order order, memory_scope scope); +#endif //cl_khr_fp64 +void __ovld atomic_store_explicit(volatile __global atomic_long *object, long desired, memory_order order, memory_scope scope); +void __ovld atomic_store_explicit(volatile __local atomic_long *object, long desired, memory_order order, memory_scope scope); +void __ovld atomic_store_explicit(volatile __global atomic_ulong *object, ulong desired, memory_order order, memory_scope scope); +void __ovld atomic_store_explicit(volatile __local atomic_ulong *object, ulong desired, memory_order order, memory_scope scope); +#endif +#endif + +#if defined(__opencl_c_generic_address_space) +void __ovld atomic_store_explicit(volatile atomic_int *object, int desired, memory_order order, memory_scope scope); +void __ovld atomic_store_explicit(volatile atomic_uint *object, uint desired, memory_order order, memory_scope scope); +void __ovld atomic_store_explicit(volatile atomic_float *object, float desired, memory_order order, memory_scope scope); +#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) +#ifdef cl_khr_fp64 +void __ovld atomic_store_explicit(volatile atomic_double *object, double desired, memory_order order, memory_scope scope); +#endif //cl_khr_fp64 +void __ovld atomic_store_explicit(volatile atomic_long *object, long desired, memory_order order, memory_scope scope); +void __ovld atomic_store_explicit(volatile atomic_ulong *object, ulong desired, memory_order order, memory_scope scope); +#endif +#endif + +// atomic_load() +#if __OPENCL_C_VERSION__ >= CL_VERSION_3_0 && defined(__opencl_c_atomic_order_seq_cst) && defined(__opencl_c_atomic_scope_device) +int __ovld atomic_load(volatile __global atomic_int *object); +int __ovld atomic_load(volatile __local atomic_int *object); +uint __ovld atomic_load(volatile __global atomic_uint *object); +uint __ovld atomic_load(volatile __local atomic_uint *object); +float __ovld atomic_load(volatile __global atomic_float *object); +float __ovld atomic_load(volatile __local atomic_float *object); +#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) +#ifdef cl_khr_fp64 +#endif //cl_khr_fp64 +double __ovld atomic_load(volatile __global atomic_double *object); +double __ovld atomic_load(volatile __local atomic_double *object); +#endif +long __ovld atomic_load(volatile __global atomic_long *object); +long __ovld atomic_load(volatile __local atomic_long *object); +ulong __ovld atomic_load(volatile __global atomic_ulong *object); +ulong __ovld atomic_load(volatile __local atomic_ulong *object); +#endif + +#if defined(__opencl_c_generic_address_space) && defined(__opencl_c_atomic_order_seq_cst) && defined(__opencl_c_atomic_scope_device) +int __ovld atomic_load(volatile atomic_int *object); uint __ovld atomic_load(volatile atomic_uint *object); -uint __ovld atomic_load_explicit(volatile atomic_uint *object, memory_order order); -uint __ovld atomic_load_explicit(volatile atomic_uint *object, memory_order order, memory_scope scope); float __ovld atomic_load(volatile atomic_float *object); -float __ovld atomic_load_explicit(volatile atomic_float *object, memory_order order); -float __ovld atomic_load_explicit(volatile atomic_float *object, memory_order order, memory_scope scope); #if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) #ifdef cl_khr_fp64 double __ovld atomic_load(volatile atomic_double *object); -double __ovld atomic_load_explicit(volatile atomic_double *object, memory_order order); -double __ovld atomic_load_explicit(volatile atomic_double *object, memory_order order, memory_scope scope); #endif //cl_khr_fp64 long __ovld atomic_load(volatile atomic_long *object); -long __ovld atomic_load_explicit(volatile atomic_long *object, memory_order order); -long __ovld atomic_load_explicit(volatile atomic_long *object, memory_order order, memory_scope scope); ulong __ovld atomic_load(volatile atomic_ulong *object); +#endif +#endif + +#if __OPENCL_C_VERSION__ >= CL_VERSION_3_0 && defined(__opencl_c_atomic_scope_device) +int __ovld atomic_load_explicit(volatile __global atomic_int *object, memory_order order); +int __ovld atomic_load_explicit(volatile __local atomic_int *object, memory_order order); +uint __ovld atomic_load_explicit(volatile __global atomic_uint *object, memory_order order); +uint __ovld atomic_load_explicit(volatile __local atomic_uint *object, memory_order order); +float __ovld atomic_load_explicit(volatile __global atomic_float *object, memory_order order); +float __ovld atomic_load_explicit(volatile __local atomic_float *object, memory_order order); +#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) +#ifdef cl_khr_fp64 +double __ovld atomic_load_explicit(volatile __global atomic_double *object, memory_order order); +double __ovld atomic_load_explicit(volatile __local atomic_double *object, memory_order order); +#endif //cl_khr_fp64 +long __ovld atomic_load_explicit(volatile __global atomic_long *object, memory_order order); +long __ovld atomic_load_explicit(volatile __local atomic_long *object, memory_order order); +ulong __ovld atomic_load_explicit(volatile __global atomic_ulong *object, memory_order order); +ulong __ovld atomic_load_explicit(volatile __local atomic_ulong *object, memory_order order); +#endif +#endif + +#if defined(__opencl_c_generic_address_space) && defined(__opencl_c_atomic_scope_device) +int __ovld atomic_load_explicit(volatile atomic_int *object, memory_order order); +uint __ovld atomic_load_explicit(volatile atomic_uint *object, memory_order order); +float __ovld atomic_load_explicit(volatile atomic_float *object, memory_order order); +#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) +#ifdef cl_khr_fp64 +double __ovld atomic_load_explicit(volatile atomic_double *object, memory_order order); +#endif //cl_khr_fp64 +long __ovld atomic_load_explicit(volatile atomic_long *object, memory_order order); ulong __ovld atomic_load_explicit(volatile atomic_ulong *object, memory_order order); +#endif +#endif + +#if __OPENCL_C_VERSION__ >= CL_VERSION_3_0 +int __ovld atomic_load_explicit(volatile __global atomic_int *object, memory_order order, memory_scope scope); +int __ovld atomic_load_explicit(volatile __local atomic_int *object, memory_order order, memory_scope scope); +uint __ovld atomic_load_explicit(volatile __global atomic_uint *object, memory_order order, memory_scope scope); +uint __ovld atomic_load_explicit(volatile __local atomic_uint *object, memory_order order, memory_scope scope); +float __ovld atomic_load_explicit(volatile __global atomic_float *object, memory_order order, memory_scope scope); +float __ovld atomic_load_explicit(volatile __local atomic_float *object, memory_order order, memory_scope scope); +#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) +#ifdef cl_khr_fp64 +double __ovld atomic_load_explicit(volatile __global atomic_double *object, memory_order order, memory_scope scope); +double __ovld atomic_load_explicit(volatile __local atomic_double *object, memory_order order, memory_scope scope); +#endif +long __ovld atomic_load_explicit(volatile __global atomic_long *object, memory_order order, memory_scope scope); +long __ovld atomic_load_explicit(volatile __local atomic_long *object, memory_order order, memory_scope scope); +ulong __ovld atomic_load_explicit(volatile __global atomic_ulong *object, memory_order order, memory_scope scope); +ulong __ovld atomic_load_explicit(volatile __local atomic_ulong *object, memory_order order, memory_scope scope); +#endif +#endif + +#if defined(__opencl_c_generic_address_space) +int __ovld atomic_load_explicit(volatile atomic_int *object, memory_order order, memory_scope scope); +uint __ovld atomic_load_explicit(volatile atomic_uint *object, memory_order order, memory_scope scope); +float __ovld atomic_load_explicit(volatile atomic_float *object, memory_order order, memory_scope scope); +#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) +#ifdef cl_khr_fp64 +double __ovld atomic_load_explicit(volatile atomic_double *object, memory_order order, memory_scope scope); +#endif +long __ovld atomic_load_explicit(volatile atomic_long *object, memory_order order, memory_scope scope); ulong __ovld atomic_load_explicit(volatile atomic_ulong *object, memory_order order, memory_scope scope); #endif +#endif // atomic_exchange() +#if __OPENCL_C_VERSION__ >= CL_VERSION_3_0 && defined(__opencl_c_atomic_order_seq_cst) && defined(__opencl_c_atomic_scope_device) +int __ovld atomic_exchange(volatile __global atomic_int *object, int desired); +int __ovld atomic_exchange(volatile __local atomic_int *object, int desired); +uint __ovld atomic_exchange(volatile __global atomic_uint *object, uint desired); +uint __ovld atomic_exchange(volatile __local atomic_uint *object, uint desired); +float __ovld atomic_exchange(volatile __global atomic_float *object, float desired); +float __ovld atomic_exchange(volatile __local atomic_float *object, float desired); +#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) +#ifdef cl_khr_fp64 +double __ovld atomic_exchange(volatile __global atomic_double *object, double desired); +double __ovld atomic_exchange(volatile __local atomic_double *object, double desired); +#endif //cl_khr_fp64 +long __ovld atomic_exchange(volatile __global atomic_long *object, long desired); +long __ovld atomic_exchange(volatile __local atomic_long *object, long desired); +ulong __ovld atomic_exchange(volatile __global atomic_ulong *object, ulong desired); +ulong __ovld atomic_exchange(volatile __local atomic_ulong *object, ulong desired); +#endif +#endif +#if defined(__opencl_c_generic_address_space) && defined(__opencl_c_atomic_order_seq_cst) && defined(__opencl_c_atomic_scope_device) int __ovld atomic_exchange(volatile atomic_int *object, int desired); -int __ovld atomic_exchange_explicit(volatile atomic_int *object, int desired, memory_order order); -int __ovld atomic_exchange_explicit(volatile atomic_int *object, int desired, memory_order order, memory_scope scope); uint __ovld atomic_exchange(volatile atomic_uint *object, uint desired); -uint __ovld atomic_exchange_explicit(volatile atomic_uint *object, uint desired, memory_order order); -uint __ovld atomic_exchange_explicit(volatile atomic_uint *object, uint desired, memory_order order, memory_scope scope); float __ovld atomic_exchange(volatile atomic_float *object, float desired); -float __ovld atomic_exchange_explicit(volatile atomic_float *object, float desired, memory_order order); -float __ovld atomic_exchange_explicit(volatile atomic_float *object, float desired, memory_order order, memory_scope scope); #if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) #ifdef cl_khr_fp64 double __ovld atomic_exchange(volatile atomic_double *object, double desired); -double __ovld atomic_exchange_explicit(volatile atomic_double *object, double desired, memory_order order); -double __ovld atomic_exchange_explicit(volatile atomic_double *object, double desired, memory_order order, memory_scope scope); #endif //cl_khr_fp64 long __ovld atomic_exchange(volatile atomic_long *object, long desired); -long __ovld atomic_exchange_explicit(volatile atomic_long *object, long desired, memory_order order); -long __ovld atomic_exchange_explicit(volatile atomic_long *object, long desired, memory_order order, memory_scope scope); ulong __ovld atomic_exchange(volatile atomic_ulong *object, ulong desired); +#endif +#endif + +#if __OPENCL_C_VERSION__ >= CL_VERSION_3_0 && defined(__opencl_c_atomic_scope_device) +int __ovld atomic_exchange_explicit(volatile __global atomic_int *object, int desired, memory_order order); +int __ovld atomic_exchange_explicit(volatile __local atomic_int *object, int desired, memory_order order); +uint __ovld atomic_exchange_explicit(volatile __global atomic_uint *object, uint desired, memory_order order); +uint __ovld atomic_exchange_explicit(volatile __local atomic_uint *object, uint desired, memory_order order); +float __ovld atomic_exchange_explicit(volatile __global atomic_float *object, float desired, memory_order order); +float __ovld atomic_exchange_explicit(volatile __local atomic_float *object, float desired, memory_order order); +#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) +#ifdef cl_khr_fp64 +double __ovld atomic_exchange_explicit(volatile __global atomic_double *object, double desired, memory_order order); +double __ovld atomic_exchange_explicit(volatile __local atomic_double *object, double desired, memory_order order); +#endif //cl_khr_fp64 +long __ovld atomic_exchange_explicit(volatile __global atomic_long *object, long desired, memory_order order); +long __ovld atomic_exchange_explicit(volatile __local atomic_long *object, long desired, memory_order order); +ulong __ovld atomic_exchange_explicit(volatile __global atomic_ulong *object, ulong desired, memory_order order); +ulong __ovld atomic_exchange_explicit(volatile __local atomic_ulong *object, ulong desired, memory_order order); +#endif +#endif + +#if defined(__opencl_c_generic_address_space) && defined(__opencl_c_atomic_scope_device) +int __ovld atomic_exchange_explicit(volatile atomic_int *object, int desired, memory_order order); +uint __ovld atomic_exchange_explicit(volatile atomic_uint *object, uint desired, memory_order order); +float __ovld atomic_exchange_explicit(volatile atomic_float *object, float desired, memory_order order); +#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) +#ifdef cl_khr_fp64 +double __ovld atomic_exchange_explicit(volatile atomic_double *object, double desired, memory_order order); +#endif //cl_khr_fp64 +long __ovld atomic_exchange_explicit(volatile atomic_long *object, long desired, memory_order order); ulong __ovld atomic_exchange_explicit(volatile atomic_ulong *object, ulong desired, memory_order order); +#endif +#endif + +#if __OPENCL_C_VERSION__ >= CL_VERSION_3_0 +int __ovld atomic_exchange_explicit(volatile __global atomic_int *object, int desired, memory_order order, memory_scope scope); +int __ovld atomic_exchange_explicit(volatile __local atomic_int *object, int desired, memory_order order, memory_scope scope); +uint __ovld atomic_exchange_explicit(volatile __global atomic_uint *object, uint desired, memory_order order, memory_scope scope); +uint __ovld atomic_exchange_explicit(volatile __local atomic_uint *object, uint desired, memory_order order, memory_scope scope); +float __ovld atomic_exchange_explicit(volatile __global atomic_float *object, float desired, memory_order order, memory_scope scope); +float __ovld atomic_exchange_explicit(volatile __local atomic_float *object, float desired, memory_order order, memory_scope scope); +#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) +#ifdef cl_khr_fp64 +double __ovld atomic_exchange_explicit(volatile __global atomic_double *object, double desired, memory_order order, memory_scope scope); +double __ovld atomic_exchange_explicit(volatile __local atomic_double *object, double desired, memory_order order, memory_scope scope); +#endif //cl_khr_fp64 +long __ovld atomic_exchange_explicit(volatile __global atomic_long *object, long desired, memory_order order, memory_scope scope); +long __ovld atomic_exchange_explicit(volatile __local atomic_long *object, long desired, memory_order order, memory_scope scope); +ulong __ovld atomic_exchange_explicit(volatile __global atomic_ulong *object, ulong desired, memory_order order, memory_scope scope); +ulong __ovld atomic_exchange_explicit(volatile __local atomic_ulong *object, ulong desired, memory_order order, memory_scope scope); +#endif +#endif + +#if defined(__opencl_c_generic_address_space) +int __ovld atomic_exchange_explicit(volatile atomic_int *object, int desired, memory_order order, memory_scope scope); +uint __ovld atomic_exchange_explicit(volatile atomic_uint *object, uint desired, memory_order order, memory_scope scope); +float __ovld atomic_exchange_explicit(volatile atomic_float *object, float desired, memory_order order, memory_scope scope); +#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) +#ifdef cl_khr_fp64 +double __ovld atomic_exchange_explicit(volatile atomic_double *object, double desired, memory_order order, memory_scope scope); +#endif //cl_khr_fp64 +long __ovld atomic_exchange_explicit(volatile atomic_long *object, long desired, memory_order order, memory_scope scope); ulong __ovld atomic_exchange_explicit(volatile atomic_ulong *object, ulong desired, memory_order order, memory_scope scope); #endif +#endif // atomic_compare_exchange_strong() and atomic_compare_exchange_weak() +#if __OPENCL_C_VERSION__ >= CL_VERSION_3_0 && defined(__opencl_c_atomic_order_seq_cst) && defined(__opencl_c_atomic_scope_device) +bool __ovld atomic_compare_exchange_strong(volatile __global atomic_int *object, __global int *expected, int desired); +bool __ovld atomic_compare_exchange_strong(volatile __global atomic_int *object, __local int *expected, int desired); +bool __ovld atomic_compare_exchange_strong(volatile __global atomic_int *object, __private int *expected, int desired); +bool __ovld atomic_compare_exchange_strong(volatile __local atomic_int *object, __global int *expected, int desired); +bool __ovld atomic_compare_exchange_strong(volatile __local atomic_int *object, __local int *expected, int desired); +bool __ovld atomic_compare_exchange_strong(volatile __local atomic_int *object, __private int *expected, int desired); +bool __ovld atomic_compare_exchange_strong(volatile __global atomic_uint *object, __global uint *expected, uint desired); +bool __ovld atomic_compare_exchange_strong(volatile __global atomic_uint *object, __local uint *expected, uint desired); +bool __ovld atomic_compare_exchange_strong(volatile __global atomic_uint *object, __private uint *expected, uint desired); +bool __ovld atomic_compare_exchange_strong(volatile __local atomic_uint *object, __global uint *expected, uint desired); +bool __ovld atomic_compare_exchange_strong(volatile __local atomic_uint *object, __local uint *expected, uint desired); +bool __ovld atomic_compare_exchange_strong(volatile __local atomic_uint *object, __private uint *expected, uint desired); +bool __ovld atomic_compare_exchange_strong(volatile __global atomic_float *object, __global float *expected, float desired); +bool __ovld atomic_compare_exchange_strong(volatile __global atomic_float *object, __local float *expected, float desired); +bool __ovld atomic_compare_exchange_strong(volatile __global atomic_float *object, __private float *expected, float desired); +bool __ovld atomic_compare_exchange_strong(volatile __local atomic_float *object, __global float *expected, float desired); +bool __ovld atomic_compare_exchange_strong(volatile __local atomic_float *object, __local float *expected, float desired); +bool __ovld atomic_compare_exchange_strong(volatile __local atomic_float *object, __private float *expected, float desired); +bool __ovld atomic_compare_exchange_weak(volatile __global atomic_int *object, __global int *expected, int desired); +bool __ovld atomic_compare_exchange_weak(volatile __global atomic_int *object, __local int *expected, int desired); +bool __ovld atomic_compare_exchange_weak(volatile __global atomic_int *object, __private int *expected, int desired); +bool __ovld atomic_compare_exchange_weak(volatile __local atomic_int *object, __global int *expected, int desired); +bool __ovld atomic_compare_exchange_weak(volatile __local atomic_int *object, __local int *expected, int desired); +bool __ovld atomic_compare_exchange_weak(volatile __local atomic_int *object, __private int *expected, int desired); +bool __ovld atomic_compare_exchange_weak(volatile __global atomic_uint *object, __global uint *expected, uint desired); +bool __ovld atomic_compare_exchange_weak(volatile __global atomic_uint *object, __local uint *expected, uint desired); +bool __ovld atomic_compare_exchange_weak(volatile __global atomic_uint *object, __private uint *expected, uint desired); +bool __ovld atomic_compare_exchange_weak(volatile __local atomic_uint *object, __global uint *expected, uint desired); +bool __ovld atomic_compare_exchange_weak(volatile __local atomic_uint *object, __local uint *expected, uint desired); +bool __ovld atomic_compare_exchange_weak(volatile __local atomic_uint *object, __private uint *expected, uint desired); +bool __ovld atomic_compare_exchange_weak(volatile __global atomic_float *object, __global float *expected, float desired); +bool __ovld atomic_compare_exchange_weak(volatile __global atomic_float *object, __local float *expected, float desired); +bool __ovld atomic_compare_exchange_weak(volatile __global atomic_float *object, __private float *expected, float desired); +bool __ovld atomic_compare_exchange_weak(volatile __local atomic_float *object, __global float *expected, float desired); +bool __ovld atomic_compare_exchange_weak(volatile __local atomic_float *object, __local float *expected, float desired); +bool __ovld atomic_compare_exchange_weak(volatile __local atomic_float *object, __private float *expected, float desired); +#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) +#ifdef cl_khr_fp64 +bool __ovld atomic_compare_exchange_strong(volatile __global atomic_double *object, __global double *expected, double desired); +bool __ovld atomic_compare_exchange_strong(volatile __global atomic_double *object, __local double *expected, double desired); +bool __ovld atomic_compare_exchange_strong(volatile __global atomic_double *object, __private double *expected, double desired); +bool __ovld atomic_compare_exchange_strong(volatile __local atomic_double *object, __global double *expected, double desired); +bool __ovld atomic_compare_exchange_strong(volatile __local atomic_double *object, __local double *expected, double desired); +bool __ovld atomic_compare_exchange_strong(volatile __local atomic_double *object, __private double *expected, double desired); +bool __ovld atomic_compare_exchange_weak(volatile __global atomic_double *object, __global double *expected, double desired); +bool __ovld atomic_compare_exchange_weak(volatile __global atomic_double *object, __local double *expected, double desired); +bool __ovld atomic_compare_exchange_weak(volatile __global atomic_double *object, __private double *expected, double desired); +bool __ovld atomic_compare_exchange_weak(volatile __local atomic_double *object, __global double *expected, double desired); +bool __ovld atomic_compare_exchange_weak(volatile __local atomic_double *object, __local double *expected, double desired); +bool __ovld atomic_compare_exchange_weak(volatile __local atomic_double *object, __private double *expected, double desired); +#endif //cl_khr_fp64 +bool __ovld atomic_compare_exchange_strong(volatile __global atomic_long *object, __global long *expected, long desired); +bool __ovld atomic_compare_exchange_strong(volatile __global atomic_long *object, __local long *expected, long desired); +bool __ovld atomic_compare_exchange_strong(volatile __global atomic_long *object, __private long *expected, long desired); +bool __ovld atomic_compare_exchange_strong(volatile __local atomic_long *object, __global long *expected, long desired); +bool __ovld atomic_compare_exchange_strong(volatile __local atomic_long *object, __local long *expected, long desired); +bool __ovld atomic_compare_exchange_strong(volatile __local atomic_long *object, __private long *expected, long desired); +bool __ovld atomic_compare_exchange_strong(volatile __global atomic_ulong *object, __global ulong *expected, ulong desired); +bool __ovld atomic_compare_exchange_strong(volatile __global atomic_ulong *object, __local ulong *expected, ulong desired); +bool __ovld atomic_compare_exchange_strong(volatile __global atomic_ulong *object, __private ulong *expected, ulong desired); +bool __ovld atomic_compare_exchange_strong(volatile __local atomic_ulong *object, __global ulong *expected, ulong desired); +bool __ovld atomic_compare_exchange_strong(volatile __local atomic_ulong *object, __local ulong *expected, ulong desired); +bool __ovld atomic_compare_exchange_strong(volatile __local atomic_ulong *object, __private ulong *expected, ulong desired); +bool __ovld atomic_compare_exchange_weak(volatile __global atomic_long *object, __global long *expected, long desired); +bool __ovld atomic_compare_exchange_weak(volatile __global atomic_long *object, __local long *expected, long desired); +bool __ovld atomic_compare_exchange_weak(volatile __global atomic_long *object, __private long *expected, long desired); +bool __ovld atomic_compare_exchange_weak(volatile __local atomic_long *object, __global long *expected, long desired); +bool __ovld atomic_compare_exchange_weak(volatile __local atomic_long *object, __local long *expected, long desired); +bool __ovld atomic_compare_exchange_weak(volatile __local atomic_long *object, __private long *expected, long desired); +bool __ovld atomic_compare_exchange_weak(volatile __global atomic_ulong *object, __global ulong *expected, ulong desired); +bool __ovld atomic_compare_exchange_weak(volatile __global atomic_ulong *object, __local ulong *expected, ulong desired); +bool __ovld atomic_compare_exchange_weak(volatile __global atomic_ulong *object, __private ulong *expected, ulong desired); +bool __ovld atomic_compare_exchange_weak(volatile __local atomic_ulong *object, __global ulong *expected, ulong desired); +bool __ovld atomic_compare_exchange_weak(volatile __local atomic_ulong *object, __local ulong *expected, ulong desired); +bool __ovld atomic_compare_exchange_weak(volatile __local atomic_ulong *object, __private ulong *expected, ulong desired); +#endif +#endif +#if defined(__opencl_c_generic_address_space) && defined(__opencl_c_atomic_order_seq_cst) && defined(__opencl_c_atomic_scope_device) bool __ovld atomic_compare_exchange_strong(volatile atomic_int *object, int *expected, int desired); -bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_int *object, int *expected, +bool __ovld atomic_compare_exchange_strong(volatile atomic_uint *object, uint *expected, uint desired); +bool __ovld atomic_compare_exchange_strong(volatile atomic_float *object, float *expected, float desired); +bool __ovld atomic_compare_exchange_weak(volatile atomic_int *object, int *expected, int desired); +bool __ovld atomic_compare_exchange_weak(volatile atomic_uint *object, uint *expected, uint desired); +bool __ovld atomic_compare_exchange_weak(volatile atomic_float *object, float *expected, float desired); +#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) +#ifdef cl_khr_fp64 +bool __ovld atomic_compare_exchange_strong(volatile atomic_double *object, double *expected, double desired); +bool __ovld atomic_compare_exchange_weak(volatile atomic_double *object, double *expected, double desired); +#endif //cl_khr_fp64 +bool __ovld atomic_compare_exchange_strong(volatile atomic_long *object, long *expected, long desired); +bool __ovld atomic_compare_exchange_strong(volatile atomic_ulong *object, ulong *expected, ulong desired); +bool __ovld atomic_compare_exchange_weak(volatile atomic_long *object, long *expected, long desired); +bool __ovld atomic_compare_exchange_weak(volatile atomic_ulong *object, ulong *expected, ulong desired); +#endif +#endif + +#if __OPENCL_C_VERSION__ >= CL_VERSION_3_0 +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_int *object, __global int *expected, + int desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_int *object, __local int *expected, + int desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_int *object, __private int *expected, + int desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_int *object, __global int *expected, + int desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_int *object, __local int *expected, + int desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_int *object, __private int *expected, + int desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_uint *object, __global uint *expected, + uint desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_uint *object, __local uint *expected, + uint desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_uint *object, __private uint *expected, + uint desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_uint *object, __global uint *expected, + uint desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_uint *object, __local uint *expected, + uint desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_uint *object, __private uint *expected, + uint desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_float *object, __global float *expected, + float desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_float *object, __local float *expected, + float desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_float *object, __private float *expected, + float desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_float *object, __global float *expected, + float desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_float *object, __local float *expected, + float desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_float *object, __private float *expected, + float desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_int *object, __global int *expected, + int desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_int *object, __local int *expected, + int desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_int *object, __private int *expected, + int desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_int *object, __global int *expected, int desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_int *object, __local int *expected, + int desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_int *object, __private int *expected, + int desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_uint *object, __global uint *expected, + uint desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_uint *object, __local uint *expected, + uint desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_uint *object, __private uint *expected, + uint desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_uint *object, __global uint *expected, + uint desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_uint *object, __local uint *expected, + uint desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_uint *object, __private uint *expected, + uint desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_float *object, __global float *expected, + float desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_float *object, __local float *expected, + float desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_float *object, __private float *expected, + float desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_float *object, __global float *expected, + float desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_float *object, __local float *expected, + float desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_float *object, __private float *expected, + float desired, memory_order success, memory_order failure); +#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) +#ifdef cl_khr_fp64 +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_double *object, __global double *expected, + double desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_double *object, __local double *expected, + double desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_double *object, __private double *expected, + double desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_double *object, __global double *expected, + double desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_double *object, __local double *expected, + double desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_double *object, __private double *expected, + double desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_double *object, __global double *expected, + double desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_double *object, __local double *expected, + double desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_double *object, __private double *expected, + double desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_double *object, __global double *expected, + double desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_double *object, __local double *expected, + double desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_double *object, __private double *expected, + double desired, memory_order success, memory_order failure); +#endif //cl_khr_fp64 +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_long *object, __global long *expected, + long desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_long *object, __local long *expected, + long desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_long *object, __private long *expected, + long desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_long *object, __global long *expected, + long desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_long *object, __local long *expected, + long desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_long *object, __private long *expected, + long desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_ulong *object, __global ulong *expected, + ulong desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_ulong *object, __local ulong *expected, + ulong desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_ulong *object, __private ulong *expected, + ulong desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_ulong *object, __global ulong *expected, + ulong desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_ulong *object, __local ulong *expected, + ulong desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_ulong *object, __private ulong *expected, + ulong desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_long *object, __global long *expected, + long desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_long *object, __local long *expected, + long desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_long *object, __private long *expected, + long desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_long *object, __global long *expected, + long desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_long *object, __local long *expected, + long desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_long *object, __private long *expected, + long desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_ulong *object, __global ulong *expected, + ulong desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_ulong *object, __local ulong *expected, + ulong desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_ulong *object, __private ulong *expected, + ulong desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_ulong *object, __global ulong *expected, + ulong desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_ulong *object, __local ulong *expected, + ulong desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_ulong *object, __private ulong *expected, + ulong desired, memory_order success, memory_order failure); +#endif +#endif + +#if defined(__opencl_c_generic_address_space) bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_int *object, int *expected, - int desired, memory_order success, memory_order failure, memory_scope scope); -bool __ovld atomic_compare_exchange_strong(volatile atomic_uint *object, uint *expected, uint desired); + int desired, memory_order success, memory_order failure); bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_uint *object, uint *expected, uint desired, memory_order success, memory_order failure); -bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_uint *object, uint *expected, - uint desired, memory_order success, memory_order failure, memory_scope scope); -bool __ovld atomic_compare_exchange_weak(volatile atomic_int *object, int *expected, int desired); +bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_float *object, float *expected, + float desired, memory_order success, memory_order failure); bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_int *object, int *expected, int desired, memory_order success, memory_order failure); -bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_int *object, int *expected, - int desired, memory_order success, memory_order failure, memory_scope scope); -bool __ovld atomic_compare_exchange_weak(volatile atomic_uint *object, uint *expected, uint desired); bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_uint *object, uint *expected, uint desired, memory_order success, memory_order failure); -bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_uint *object, uint *expected, - uint desired, memory_order success, memory_order failure, memory_scope scope); -bool __ovld atomic_compare_exchange_strong(volatile atomic_float *object, float *expected, float desired); -bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_float *object, float *expected, - float desired, memory_order success, memory_order failure); -bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_float *object, float *expected, - float desired, memory_order success, memory_order failure, memory_scope scope); -bool __ovld atomic_compare_exchange_weak(volatile atomic_float *object, float *expected, float desired); bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_float *object, float *expected, float desired, memory_order success, memory_order failure); -bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_float *object, float *expected, - float desired, memory_order success, memory_order failure, memory_scope scope); #if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) #ifdef cl_khr_fp64 -bool __ovld atomic_compare_exchange_strong(volatile atomic_double *object, double *expected, double desired); bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_double *object, double *expected, double desired, memory_order success, memory_order failure); -bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_double *object, double *expected, - double desired, memory_order success, memory_order failure, memory_scope scope); -bool __ovld atomic_compare_exchange_weak(volatile atomic_double *object, double *expected, double desired); bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_double *object, double *expected, double desired, memory_order success, memory_order failure); -bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_double *object, double *expected, - double desired, memory_order success, memory_order failure, memory_scope scope); #endif //cl_khr_fp64 -bool __ovld atomic_compare_exchange_strong(volatile atomic_long *object, long *expected, long desired); bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_long *object, long *expected, long desired, memory_order success, memory_order failure); -bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_long *object, long *expected, - long desired, memory_order success, memory_order failure, memory_scope scope); -bool __ovld atomic_compare_exchange_weak(volatile atomic_long *object, long *expected, long desired); +bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_ulong *object, ulong *expected, + ulong desired, memory_order success, memory_order failure); bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_long *object, long *expected, long desired, memory_order success, memory_order failure); -bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_long *object, long *expected, - long desired, memory_order success, memory_order failure, memory_scope scope); -bool __ovld atomic_compare_exchange_strong(volatile atomic_ulong *object, ulong *expected, ulong desired); -bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_ulong *object, ulong *expected, +bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_ulong *object, ulong *expected, ulong desired, memory_order success, memory_order failure); + +#endif +#endif + +#if __OPENCL_C_VERSION__ >= CL_VERSION_3_0 +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_int *object, __global int *expected, + int desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_int *object, __local int *expected, + int desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_int *object, __private int *expected, + int desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_int *object, __global int *expected, + int desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_int *object, __local int *expected, + int desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_int *object, __private int *expected, + int desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_uint *object, __global uint *expected, + uint desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_uint *object, __local uint *expected, + uint desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_uint *object, __private uint *expected, + uint desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_uint *object, __global uint *expected, + uint desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_uint *object, __local uint *expected, + uint desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_uint *object, __private uint *expected, + uint desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_float *object, __global float *expected, + float desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_float *object, __local float *expected, + float desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_float *object, __private float *expected, + float desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_float *object, __global float *expected, + float desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_float *object, __local float *expected, + float desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_float *object, __private float *expected, + float desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_int *object, __global int *expected, + int desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_int *object, __local int *expected, + int desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_int *object, __private int *expected, + int desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_int *object, __global int *expected, + int desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_int *object, __local int *expected, + int desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_int *object, __private int *expected, + int desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_uint *object, __global uint *expected, + uint desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_uint *object, __local uint *expected, + uint desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_uint *object, __private uint *expected, + uint desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_uint *object, __global uint *expected, + uint desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_uint *object, __local uint *expected, + uint desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_uint *object, __private uint *expected, + uint desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_float *object, __global float *expected, + float desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_float *object, __local float *expected, + float desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_float *object, __private float *expected, + float desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_float *object, __global float *expected, + float desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_float *object, __local float *expected, + float desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_float *object, __private float *expected, + float desired, memory_order success, memory_order failure, memory_scope scope); +#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) +#ifdef cl_khr_fp64 +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_double *object, __global double *expected, + double desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_double *object, __local double *expected, + double desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_double *object, __private double *expected, + double desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_double *object, __global double *expected, + double desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_double *object, __local double *expected, + double desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_double *object, __private double *expected, + double desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_double *object, __global double *expected, + double desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_double *object, __local double *expected, + double desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_double *object, __private double *expected, + double desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_double *object, __global double *expected, + double desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_double *object, __local double *expected, + double desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_double *object, __private double *expected, + double desired, memory_order success, memory_order failure, memory_scope scope); +#endif //cl_khr_fp64 +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_long *object, __global long *expected, + long desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_long *object, __local long *expected, + long desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_long *object, __private long *expected, + long desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_long *object, __global long *expected, + long desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_long *object, __local long *expected, + long desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_long *object, __private long *expected, + long desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_ulong *object, __global ulong *expected, + ulong desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_ulong *object, __local ulong *expected, + ulong desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __global atomic_ulong *object, __private ulong *expected, + ulong desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_ulong *object, __global ulong *expected, + ulong desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_ulong *object, __local ulong *expected, + ulong desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile __local atomic_ulong *object, __private ulong *expected, + ulong desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_long *object, __global long *expected, + long desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_long *object, __local long *expected, + long desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_long *object, __private long *expected, + long desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_long *object, __global long *expected, + long desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_long *object, __local long *expected, + long desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_long *object, __private long *expected, + long desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_ulong *object, __global ulong *expected, + ulong desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_ulong *object, __local ulong *expected, + ulong desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __global atomic_ulong *object, __private ulong *expected, + ulong desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_ulong *object, __global ulong *expected, + ulong desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_ulong *object, __local ulong *expected, + ulong desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile __local atomic_ulong *object, __private ulong *expected, + ulong desired, memory_order success, memory_order failure, memory_scope scope); +#endif +#endif + +#if defined(__opencl_c_generic_address_space) +bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_int *object, int *expected, + int desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_uint *object, uint *expected, + uint desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_float *object, float *expected, + float desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_int *object, int *expected, + int desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_uint *object, uint *expected, + uint desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_float *object, float *expected, + float desired, memory_order success, memory_order failure, memory_scope scope); +#if defined(cl_khr_int64_base_atomics) && defined(cl_khr_int64_extended_atomics) +#ifdef cl_khr_fp64 +bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_double *object, double *expected, + double desired, memory_order success, memory_order failure, memory_scope scope); +bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_double *object, double *expected, + double desired, memory_order success, memory_order failure, memory_scope scope); +#endif //cl_khr_fp64 +bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_long *object, long *expected, + long desired, memory_order success, memory_order failure, memory_scope scope); bool __ovld atomic_compare_exchange_strong_explicit(volatile atomic_ulong *object, ulong *expected, ulong desired, memory_order success, memory_order failure, memory_scope scope); -bool __ovld atomic_compare_exchange_weak(volatile atomic_ulong *object, ulong *expected, ulong desired); -bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_ulong *object, ulong *expected, - ulong desired, memory_order success, memory_order failure); +bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_long *object, long *expected, + long desired, memory_order success, memory_order failure, memory_scope scope); bool __ovld atomic_compare_exchange_weak_explicit(volatile atomic_ulong *object, ulong *expected, ulong desired, memory_order success, memory_order failure, memory_scope scope); #endif +#endif // atomic_flag_test_and_set() and atomic_flag_clear() +#if __OPENCL_C_VERSION__ >= CL_VERSION_3_0 && defined(__opencl_c_atomic_order_seq_cst) && defined(__opencl_c_atomic_scope_device) +bool __ovld atomic_flag_test_and_set(volatile __global atomic_flag *object); +bool __ovld atomic_flag_test_and_set(volatile __local atomic_flag *object); +void __ovld atomic_flag_clear(volatile __global atomic_flag *object); +void __ovld atomic_flag_clear(volatile __local atomic_flag *object); +#endif +#if defined(__opencl_c_generic_address_space) && defined(__opencl_c_atomic_order_seq_cst) && defined(__opencl_c_atomic_scope_device) bool __ovld atomic_flag_test_and_set(volatile atomic_flag *object); -bool __ovld atomic_flag_test_and_set_explicit(volatile atomic_flag *object, memory_order order); -bool __ovld atomic_flag_test_and_set_explicit(volatile atomic_flag *object, memory_order order, memory_scope scope); void __ovld atomic_flag_clear(volatile atomic_flag *object); +#endif + +#if __OPENCL_C_VERSION__ >= CL_VERSION_3_0 && defined(__opencl_c_atomic_scope_device) +bool __ovld atomic_flag_test_and_set_explicit(volatile __global atomic_flag *object, memory_order order); +bool __ovld atomic_flag_test_and_set_explicit(volatile __local atomic_flag *object, memory_order order); +void __ovld atomic_flag_clear_explicit(volatile __global atomic_flag *object, memory_order order); +void __ovld atomic_flag_clear_explicit(volatile __local atomic_flag *object, memory_order order); +#endif + +#if defined(__opencl_c_generic_address_space) && defined(__opencl_c_atomic_scope_device) +bool __ovld atomic_flag_test_and_set_explicit(volatile atomic_flag *object, memory_order order); void __ovld atomic_flag_clear_explicit(volatile atomic_flag *object, memory_order order); +#endif + +#if __OPENCL_C_VERSION__ >= CL_VERSION_3_0 +bool __ovld atomic_flag_test_and_set_explicit(volatile __global atomic_flag *object, memory_order order, memory_scope scope); +bool __ovld atomic_flag_test_and_set_explicit(volatile __local atomic_flag *object, memory_order order, memory_scope scope); +void __ovld atomic_flag_clear_explicit(volatile __global atomic_flag *object, memory_order order, memory_scope scope); +void __ovld atomic_flag_clear_explicit(volatile __local atomic_flag *object, memory_order order, memory_scope scope); +#endif + +#if defined(__opencl_c_generic_address_space) +bool __ovld atomic_flag_test_and_set_explicit(volatile atomic_flag *object, memory_order order, memory_scope scope); void __ovld atomic_flag_clear_explicit(volatile atomic_flag *object, memory_order order, memory_scope scope); +#endif #endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) @@ -15220,8 +16169,7 @@ #endif // OpenCL v2.0 s6.13.15 - Work-group Functions - -#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#if defined(__opencl_c_work_group_collective_functions) int __ovld __conv work_group_all(int predicate); int __ovld __conv work_group_any(int predicate); @@ -15319,12 +16267,12 @@ double __ovld __conv work_group_scan_inclusive_max(double x); #endif //cl_khr_fp64 -#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#endif //defined(__opencl_c_work_group_collective_functions) // OpenCL v2.0 s6.13.16 - Pipe Functions -#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#if defined(__opencl_c_pipes) bool __ovld is_valid_reserve_id(reserve_id_t reserve_id); -#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#endif //defined(__opencl_c_pipes) // OpenCL v2.0 s6.13.17 - Enqueue Kernels @@ -15366,16 +16314,16 @@ uint __ovld get_sub_group_size(void); uint __ovld get_max_sub_group_size(void); uint __ovld get_num_sub_groups(void); -#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#if defined(__opencl_c_subgroups) uint __ovld get_enqueued_num_sub_groups(void); -#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#endif //defined(__opencl_c_subgroups) uint __ovld get_sub_group_id(void); uint __ovld get_sub_group_local_id(void); void __ovld __conv sub_group_barrier(cl_mem_fence_flags flags); -#if defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#if defined(__opencl_c_subgroups) void __ovld __conv sub_group_barrier(cl_mem_fence_flags flags, memory_scope scope); -#endif //defined(__OPENCL_CPP_VERSION__) || (__OPENCL_C_VERSION__ >= CL_VERSION_2_0) +#endif //defined(__opencl_c_subgroups) int __ovld __conv sub_group_all(int predicate); int __ovld __conv sub_group_any(int predicate);