6.15.17. Work-group Collective Uniform Arithmetic Functions
6.15.17. 工作组共有统一算术函数
The functionality described in this section requires support for OpenCL C 2.0 and the 本节中描述的功能需要支持OpenCL C 2.0和cl_khr_work_group_uniform_arithmetic扩展宏。 |
The Built-in Work-group Logical Arithmetic Functions 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
.
内置工作组逻辑算术函数表描述了OpenCL C编程语言的内置函数,这些函数在工作组中的工作项之间执行逻辑算术运算。执行内核的工作组中的所有工作项都必须遇到这些函数,否则行为未定义。对于这些函数,非零的predicate参数或返回值在逻辑上为真,而零的predicate变量或返回值则为假。
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. 返回包容性扫描操作的结果,该结果是工作组线性本地ID小于或等于此工作项的工作组线性局部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. 返回独占扫描操作的结果,该结果是工作组中所有工作项的predicate的逻辑和、或或异或,工作组线性本地ID小于此工作项的工作组线性局部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 如果工作组中没有工作组线性本地ID小于此工作项的线性本地ID的工作项,则返回标识值I。对于and,标识值为真(非零)。对于or和xor,标识值为false(零)。 |
The Built-in Work-group Bitwise Integer Functions 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
.
内置工作组逐位整数函数表描述了OpenCL C编程语言的内置函数,这些函数在工作组中的工作项之间执行逐位整数运算。执行内核的工作组中的所有工作项都必须遇到这些函数,否则行为未定义。对于下面的函数,泛型类型名称gentype可能是支持的内置标量数据类型之一,如int、uint、long和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. 返回包容性扫描操作的结果,即工作组线性本地ID小于或等于此工作项的工作组线性局部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. 返回独占扫描操作的结果,即工作组线性本地ID小于此工作项的工作组线性局部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 如果工作组中没有工作组线性本地ID小于此工作项的线性本地ID的工作项,则返回标识值I。对于and,标识值为~0(所有位都已设置)。对于or和xor,标识值为0。 |
The Built-in Work-group Multiplicative Functions 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).
内置工作组乘法函数表描述了OpenCL C编程语言的内置函数,这些函数在工作组中的工作项之间执行乘法操作。执行内核的工作组中的所有工作项都必须遇到这些函数,否则行为未定义。对于下面的函数,泛型类型名称gentype可以是支持的内置标量数据类型之一,如int、uint、long、ulong、float、double(如果支持双精度)或half(如果支持半精度)。
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. 返回包容性扫描操作的结果,该操作是将工作组中所有工作项的值与小于或等于此工作项的工作组线性本地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. 返回独占扫描操作的结果,该操作是工作组中所有工作项的值与小于此工作项的工作组线性本地ID的工作组的线性本地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 如果工作组中没有工作组线性本地ID小于此工作项的工作组线性局部ID的工作项,则返回标识值1。 |