Description
| The memory fence functions described in this sub-section are deprecated by OpenCL C 2.0. |
The OpenCL C programming language implements the following explicit memory fence functions to provide ordering between memory operations of a work-item.
| Function | Description |
|---|---|
void mem_fence( |
Orders loads and stores of a work-item executing a kernel. This means that loads and stores preceding the mem_fence will be committed to memory before any loads and stores following the mem_fence. The flags argument specifies the memory address space and can be set to a combination of the following literal values: The value of flags must be the same for all work-items in the work-group. |
void read_mem_fence( |
Read memory barrier that orders only loads. The flags argument specifies the memory address space and can be set to a combination of the following literal values: The value of flags must be the same for all work-items in the work-group. |
void write_mem_fence( |
Write memory barrier that orders only stores. The flags argument specifies the memory address space and can be set to a combination of the following literal values: The value of flags must be the same for all work-items in the work-group. |
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.