diff --git a/sycl/doc/extensions/GroupAlgorithms/SYCL_INTEL_group_algorithms.asciidoc b/sycl/doc/extensions/GroupAlgorithms/SYCL_INTEL_group_algorithms.asciidoc index 8e0f68b001e39..31392cd740a82 100755 --- a/sycl/doc/extensions/GroupAlgorithms/SYCL_INTEL_group_algorithms.asciidoc +++ b/sycl/doc/extensions/GroupAlgorithms/SYCL_INTEL_group_algorithms.asciidoc @@ -62,6 +62,7 @@ The extension introduces the following functions: - +any_of+ - +all_of+ - +none_of+ +- +leader+ - +broadcast+ - +reduce+ - +exclusive_scan+ @@ -181,6 +182,17 @@ It is undefined behavior for any of these functions to be invoked within a +para |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. |=== +==== Elect + +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. + +|=== +|Function|Description + +|+template bool leader(Group g);+ +|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. +|=== + ==== Collectives 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.