Description
-
All operations on atomic types must be performed using the built-in atomic functions. C11 and C++11 support operators on atomic types. OpenCL C does not support operators with atomic types. Using atomic types with operators should result in a compilation error.
-
The
atomic_bool,atomic_char,atomic_uchar,atomic_short,atomic_ushort,atomic_intmax_tandatomic_uintmax_ttypes are not supported by OpenCL C. -
OpenCL C 2.0 requires that the built-in atomic functions on atomic types are lock-free. In OpenCL C 3.0 or newer, built-in atomic functions on atomic types may be lock-free.
-
The
_Atomictype specifier and_Atomictype qualifier are not supported by OpenCL C. -
The behavior of atomic operations where pointer arguments to the atomic functions refers to an atomic type in the
privateaddress space is undefined. -
Using
memory_order_acquirewith any built-in atomic function exceptatomic_work_item_fencerequires support for OpenCL C 2.0, or OpenCL C 3.0 or newer and the__opencl_c_feature.atomic_ order_ acq_ rel -
Using
memory_order_releasewith any built-in atomic function exceptatomic_work_item_fencerequires support for OpenCL C 2.0, or OpenCL C 3.0 or newer and the__opencl_c_feature.atomic_ order_ acq_ rel -
Using
memory_order_acq_relwith any built-in atomic function exceptatomic_work_item_fencerequires support for OpenCL C 2.0, or OpenCL C 3.0 or newer and the__opencl_c_feature.atomic_ order_ acq_ rel -
Using
memory_order_seq_cstwith any built-in atomic function requires support for OpenCL C 2.0, or OpenCL C 3.0 or newer and the__opencl_c_feature.atomic_ order_ seq_ cst -
Using
memory_scope_sub_groupwith any built-in atomic function requires support for thecl_khr_extension macro; or for OpenCL C 3.0 or newer and thesubgroups __opencl_c_feature.subgroups -
Using
memory_scope_devicerequires support for OpenCL C 2.0, or OpenCL C 3.0 or newer and the__opencl_c_feature.atomic_ scope_ device -
Using
memory_scope_all_svm_devicesrequires support for OpenCL C 2.0, or OpenCL C 3.0 or newer and the__opencl_c_feature.atomic_ scope_ all_ devices -
Using
memory_scope_all_devicesrequires support for OpenCL C 3.0 or newer and the__opencl_c_feature.atomic_ scope_ all_ devices
Document Notes
For more information, see the OpenCL C Specification
This page is extracted from the OpenCL C Specification. Fixes and changes should be made to the Specification, not directly.