The OpenCL C programming language implements the following synchronization functions.
All work-items in a work-group executing the kernel on a processor must execute this function before any are allowed to continue execution beyond the work_group_barrier. This function must be encountered by all work-items in a work-group executing the kernel. These rules apply to ND-ranges implemented with uniform and non-uniform work-groups.
If work_group_barrier is inside a conditional statement, then all work-items must enter the conditional if any work-item enters the conditional statement and executes the work_group_barrier.
If work_group_barrier is inside a loop, all work-items must execute the work_group_barrier for each iteration of the loop before any are allowed to continue execution beyond the work_group_barrier.
The work_group_barrier function also supports a variant that
specifies the memory scope.
For the work_group_barrier variant that does not take a memory
scope, the scope is
The scope argument specifies whether the memory accesses of work-items in the work-group to memory address space(s) identified by flags become visible to all work-items in the work-group, the device or all SVM devices.
The work_group_barrier function can also be used to specify which
memory operations, i.e. to
The values of flags and scope must be the same for all work-items in the work-group.
 The built-in function barrier has been renamed work_group_barrier. For backward compatibility, barrier is also supported.
 Refer to the description of
No cross-references are available
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.
Copyright (c) 2014-2020 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.