Skip to content

Commit a5a71be

Browse files
authored
Move descriptions of identity value for exclusive scan (#560)
The identify value is introduced in the description of the inclusive scan operations, despite only being referenced in the description of the exclusive scan operations. Move its description into that of the exclusive scan operations, where it belongs.
1 parent 9b6590d commit a5a71be

2 files changed

Lines changed: 10 additions & 11 deletions

File tree

OpenCL_C.txt

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10003,16 +10003,9 @@ The *<op>* in *work_group_reduce_<op>*, *work_group_scan_exclusive_<op>* and
1000310003
*work_group_scan_inclusive_<op>* defines the operator and can be *add*,
1000410004
*min* or *max*.
1000510005

10006-
The inclusive scan operation takes a binary operator *op* with an identity I
10007-
and _n_ (where _n_ is the size of the work-group) elements [a~0~, a~1~, ...
10008-
a~n-1~] and returns [a~0~, (a~0~ *op* a~1~), ... (a~0~ *op* a~1~ *op* ...
10009-
*op* a~n-1~)].
10010-
If *op* = add, the identity I is 0.
10011-
If *op* = min, the identity I is `INT_MAX`, `UINT_MAX`, `LONG_MAX`,
10012-
`ULONG_MAX`, for `int`, `uint`, `long`, `ulong` types and is `+INF` for
10013-
floating-point types.
10014-
Similarly if *op* = max, the identity I is `INT_MIN`, 0, `LONG_MIN`, 0 and
10015-
`-INF`.
10006+
The inclusive scan operation takes a binary operator *op* with _n_ (where _n_
10007+
is the size of the work-group) elements [a~0~, a~1~, ... a~n-1~] and returns
10008+
[a~0~, (a~0~ *op* a~1~), ... (a~0~ *op* a~1~ *op* ... *op* a~n-1~)].
1001610009

1001710010
Consider the following example:
1001810011

@@ -10037,6 +10030,12 @@ The exclusive scan operation takes a binary associative operator *op* with
1003710030
an identity I and n (where n is the size of the work-group) elements [a~0~,
1003810031
a~1~, ... a~n-1~] and returns [I, a~0~, (a~0~ *op* a~1~), ... (a~0~ *op*
1003910032
a~1~ *op* ... *op* a~n-2~)].
10033+
If *op* = add, the identity I is 0.
10034+
If *op* = min, the identity I is `INT_MAX`, `UINT_MAX`, `LONG_MAX`,
10035+
`ULONG_MAX`, for `int`, `uint`, `long`, `ulong` types and is `+INF` for
10036+
floating-point types.
10037+
Similarly if *op* = max, the identity I is `INT_MIN`, 0, `LONG_MIN`, 0 and
10038+
`-INF`.
1004010039
For the example above, the exclusive scan add operation on the ordered set
1004110040
[3 1 7 0 4 1 6 3] would return [0 3 4 11 11 15 16 22].
1004210041

ext/cl_khr_subgroups.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ The *<op>* in *sub_group_reduce_<op>*, *sub_group_scan_inclusive_<op>* and *sub_
340340

341341
The exclusive scan operation takes a binary operator *op* with an identity I and _n_ (where _n_ is the size of the sub-group) elements [a~0~, a~1~, ... a~n-1~] and returns [I, a~0~, (a~0~ *op* a~1~), ... (a~0~ *op* a~1~ *op* ... *op* a~n-2~)].
342342

343-
The inclusive scan operation takes a binary operator *op* with an identity I and _n_ (where _n_ is the size of the sub-group) elements [a~0~, a~1~, ... a~n-1~] and returns [a~0~, (a~0~ *op* a~1~), ... (a~0~ *op* a~1~ *op* ... *op* a~n-1~)].
343+
The inclusive scan operation takes a binary operator *op* with _n_ (where _n_ is the size of the sub-group) elements [a~0~, a~1~, ... a~n-1~] and returns [a~0~, (a~0~ *op* a~1~), ... (a~0~ *op* a~1~ *op* ... *op* a~n-1~)].
344344

345345
If *op* = *add*, the identity I is 0.
346346
If *op* = *min*, the identity I is `INT_MAX`, `UINT_MAX`, `LONG_MAX`, `ULONG_MAX`, for `int`, `uint`, `long`, `ulong` types and is `+INF` for

0 commit comments

Comments
 (0)