Description
The functionality described in this section requires
support for OpenCL C 2.0 and the cl_khr_
extension macro.
|
The https://www.khronos.org/registry/OpenCL/specs/3.0-unified/html/OpenCL_C.html#table-builtin-work-group-logical table describes the OpenCL C
programming language built-in functions that perform logical arithmetic
operations across work items in a work-group.
These functions must be encountered by all work items in a work-group
executing the kernel, otherwise the behavior is undefined.
For these functions, a non-zero predicate argument or return value is
logically true and a zero predicate argument or return value is
logically false.
| Function | Description |
|---|---|
|
Returns the logical and, or, or xor of predicate for all work items in the work-group. |
|
Returns the result of an inclusive scan operation, which is the logical and, or, or xor of predicate for all work items in the work-group with a work-group linear local ID less than or equal to this work item’s work-group linear local ID. |
|
Returns the result of an exclusive scan operation, which is the logical and, or, or xor of predicate for all work items in the work-group with a work-group linear local ID less than this work item’s work-group linear local ID. If there is no work item in the work-group with a work-group linear
local ID less than this work item’s work-group linear local ID then an
identity value |
The https://www.khronos.org/registry/OpenCL/specs/3.0-unified/html/OpenCL_C.html#table-builtin-work-group-bitwise-integer table describes the OpenCL
C programming language built-in functions that perform bitwise integer
operations across work items in a work-group.
These functions must be encountered by all work items in a work-group
executing the kernel, otherwise the behavior is undefined.
For the functions below, the generic type name gentype may be one of the
supported built-in scalar data types int, uint, long, and ulong.
| Function | Description |
|---|---|
|
Returns the bitwise and, or, or xor of value for all work items in the work-group. |
|
Returns the result of an inclusive scan operation, which is the bitwise and, or, or xor of value for all work items in the work-group with a work-group linear local ID less than or equal to this work item’s work-group linear local ID. |
|
Returns the result of an exclusive scan operation, which is the bitwise and, or, or xor of value for all work items in the work-group with a work-group linear local ID less than this work item’s work-group linear local ID. If there is no work item in the work-group with a work-group linear
local ID less than this work item’s work-group linear local ID then an
identity value |
The https://www.khronos.org/registry/OpenCL/specs/3.0-unified/html/OpenCL_C.html#table-builtin-work-group-multiplicative table describes the OpenCL C
programming language built-in functions that perform multiplicative
operations across work items in a work-group.
These functions must be encountered by all work items in a work-group
executing the kernel, otherwise the behavior is undefined.
For the functions below, the generic type name gentype may be one of the
supported built-in scalar data types int, uint, long, ulong,
float, double (if double precision is supported), or half (if half
precision is supported).
| Function | Description |
|---|---|
|
Returns the multiplication of value for all work items in the work-group. |
|
Returns the result of an inclusive scan operation which is the multiplication of value for all work items in the work-group with a work-group linear local ID less than or equal to this work item’s work-group linear local ID. |
|
Returns the result of an exclusive scan operation which is the multiplication of value for all work items in the work-group with a work-group linear local ID less than this work item’s work-group linear local ID. If there is no work item in the work-group with a work-group linear
local ID less than this work item’s work-group linear local ID then the
identity value |
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.