kokkos-execution 0.0.1
Loading...
Searching...
No Matches
Kokkos::Execution::ExecutionSpaceImpl::RequiresSynchronization< Rcvr, OpState > Struct Template Reference

Synchronization at the boundary of the work enqueued on an execution space. More...

#include <operation_state.hpp>

Public Member Functions

constexpr bool operator() (const OpState &) const noexcept
 The synchronization will be handled by the successor.
bool operator() (const OpState &opstate) const noexcept
constexpr bool operator() (const OpState &) const noexcept
 As a fallback, synchronization is always required.

Static Public Attributes

static constexpr bool successor_handles_sync

Detailed Description

template<stdexec::receiver Rcvr, typename OpState>
struct Kokkos::Execution::ExecutionSpaceImpl::RequiresSynchronization< Rcvr, OpState >

Synchronization at the boundary of the work enqueued on an execution space.

Under special circumstances, the implementation is allowed to skip any synchronization of asynchronous work. Otherwise, synchronization must occur before invoking the downstream receiver. This situation may arise, for example, when the execution space scheduler is used in a stdexec::when_all branch. In the default implementation of stdexec::when_all, the branches are not terminated by a stdexec::schedule_from, so we'd be missing a synchronization.

Definition at line 36 of file operation_state.hpp.

Member Function Documentation

◆ operator()() [1/3]

template<stdexec::receiver Rcvr, typename OpState>
bool Kokkos::Execution::ExecutionSpaceImpl::RequiresSynchronization< Rcvr, OpState >::operator() ( const OpState & ) const
inlineconstexprnoexcept

As a fallback, synchronization is always required.

Definition at line 64 of file operation_state.hpp.

References successor_handles_sync.

◆ operator()() [2/3]

template<stdexec::receiver Rcvr, typename OpState>
bool Kokkos::Execution::ExecutionSpaceImpl::RequiresSynchronization< Rcvr, OpState >::operator() ( const OpState & ) const
inlineconstexprnoexcept

The synchronization will be handled by the successor.

Definition at line 41 of file operation_state.hpp.

References successor_handles_sync.

◆ operator()() [3/3]

template<stdexec::receiver Rcvr, typename OpState>
bool Kokkos::Execution::ExecutionSpaceImpl::RequiresSynchronization< Rcvr, OpState >::operator() ( const OpState & opstate) const
inlinenoexcept

If the receiver environment can be queried for Kokkos::Execution::ExecutionSpaceImpl::get_exec_t, and if the successor enqueues work on the same execution space instance, no synchronization is needed.

Definition at line 50 of file operation_state.hpp.

References Kokkos::Execution::ExecutionSpaceImpl::get_exec, and successor_handles_sync.

Member Data Documentation

◆ successor_handles_sync

template<stdexec::receiver Rcvr, typename OpState>
bool Kokkos::Execution::ExecutionSpaceImpl::RequiresSynchronization< Rcvr, OpState >::successor_handles_sync
staticconstexpr
Initial value:
= stdexec::__is_instance_of<Rcvr, ScheduleFromReceiver>
|| stdexec::__is_instance_of<Rcvr, SyncWaitReceiver>

Definition at line 37 of file operation_state.hpp.


The documentation for this struct was generated from the following file: