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

Clarify parallel semantics of calling functor operator #627

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions docs/source/API/core/parallel-dispatch/parallel_for.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Requirements
Semantics
---------

* For every element of the iteration space defined in ``policy`` the functors call operator is invoked exactly once, except for ``TeamPolicy`` and ``TeamThreadRange`` where the call operator is invoked by each vector lane of the team and thread respectively.
* Neither concurrency nor order of execution of iterations are guaranteed.
* The call is potentially asynchronous. To guarantee a kernel has finished, a developer should call fence on the execution space on which the kernel is run.

Expand Down
1 change: 1 addition & 0 deletions docs/source/API/core/parallel-dispatch/parallel_reduce.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ Requirements:
Semantics
---------

* For every element of the iteration space defined in ``policy`` the functors call operator is invoked exactly once, except for ``TeamPolicy`` and ``TeamThreadRange`` where the call operator is invoked by each vector lane of the team and thread respectively.
* Neither concurrency nor order of execution are guaranteed.
* The call is potentially asynchronous if the ``ReducerArgument`` is not a scalar type.
* The ``ReducerArgument`` content will be overwritten, i.e. the value does not need to be initialized to the reduction-neutral element.
Expand Down
1 change: 1 addition & 0 deletions docs/source/API/core/parallel-dispatch/parallel_scan.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ Semantics
* Neither concurrency nor order of execution are guaranteed.
* The ``ReturnType`` content will be overwritten, i.e. the value does not need to be initialized to the reduction-neutral element.
* The input value to the operator may contain a partial result, Kokkos may only combine the thread local contributions in the end. The operator should modify the input value according to the desired scan operation.
* For every element of the iteration space defined in ``policy`` the functors call operator is invoked exactly once with ``final = true``.
* It is not guaranteed that the functor will ever be called with ``final = false``.
* The functor might be called multiple times with ``final = false`` and the user has to make sure that the behavior in this case stays the same for repeated calls.

Expand Down