Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCL][Doc] Add leader to GroupAlgorithms #1297

Merged
merged 2 commits into from
Mar 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ The extension introduces the following functions:
- +any_of+
- +all_of+
- +none_of+
- +leader+
- +broadcast+
- +reduce+
- +exclusive_scan+
Expand Down Expand Up @@ -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 <typename Group> 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.
Expand Down