Skip to content

Commit b18a566

Browse files
authored
[SYCL][Doc] Add leader to GroupAlgorithms (#1297)
Signed-off-by: John Pennycook <[email protected]>
1 parent d006a11 commit b18a566

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

sycl/doc/extensions/GroupAlgorithms/SYCL_INTEL_group_algorithms.asciidoc

+12
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ The extension introduces the following functions:
6262
- +any_of+
6363
- +all_of+
6464
- +none_of+
65+
- +leader+
6566
- +broadcast+
6667
- +reduce+
6768
- +exclusive_scan+
@@ -181,6 +182,17 @@ It is undefined behavior for any of these functions to be invoked within a +para
181182
|Return +true+ if _pred_ returns +true+ for no element in the range [_first_, _last_). _first_, _last_ and _pred_ must be the same for all work-items in the group.
182183
|===
183184

185+
==== Elect
186+
187+
The +leader+ function provides a mechanism to _elect_ a single work-item as the leader of the group, commonly in order to execute a task once per group.
188+
189+
|===
190+
|Function|Description
191+
192+
|+template <typename Group> bool leader(Group g);+
193+
|Return +true+ for exactly one work-item in the group, if the calling work-item is the elected leader of the group. Every call to +leader+ with the same group _g_ must elect the same work-item.
194+
|===
195+
184196
==== Collectives
185197

186198
In this section, the meaning of "exclusive scan" and "inclusive scan" are as defined in Sections 29.8.7 and 29.8.8 of the {cpp}17 specification, respectively.

0 commit comments

Comments
 (0)