|
kokkos-execution 0.0.1
|
Operation state for stdexec::when_all.
More...
#include <when_all.hpp>
Classes | |
| struct | WhenAllChildReceiver |
Receiver for a child of stdexec::when_all. More... | |
| struct | JoinOpStateNodes |
| Join the nodes of all operation states into one aggregate node. More... | |
Public Types | |
| using | operation_state_concept = stdexec::operation_state_tag |
| using | base_t = OpStateBase<Exec, Rcvr> |
| using | execution_space = Exec |
| using | predecessor_t = GraphComposition::node_t<Exec, Rcvr> |
| using | children_op_states_t = stdexec::__tuple<stdexec::connect_result_t<Sndrs, WhenAllChildReceiver>...> |
| using | node_t = std::invoke_result_t<JoinOpStateNodes, const children_op_states_t&> |
| using | graph_composition_policy_t |
| using | state_t = State<graph_composition_policy_t, execution_space> |
| Public Types inherited from Kokkos::Execution::GraphImpl::OpStateBase< Exec, Rcvr > | |
| using | completion_signal_policy_t = decltype(select_completion_signal_policy()) |
| using | completion_signal_t = Impl::CompletionSignal<completion_signal_policy_t, Exec, Rcvr> |
Public Member Functions | |
| WhenAllOpState (stdexec::__tuple< Sndrs... > &&sndrs_, Rcvr &&rcvr_) | |
| const predecessor_t & | get_predecessor () const noexcept |
| auto | query (get_node_t) const &noexcept -> const node_t &requires(!Impl::empty< node_t >) |
| auto | query (get_graph_t) const &noexcept -> const typename state_t::graph_t & |
| void | submit () &noexcept |
| void | submit () &noexcept |
| void | complete (stdexec::set_value_t) &noexcept |
| template<typename Tag, typename... Args> requires (!std::same_as<Tag, stdexec::set_value_t>) | |
| void | complete (Tag, Args &&... args) &noexcept |
| void | start () &noexcept |
| void | start () &noexcept |
If as_one is true, there is no need to start the branches. | |
| void | submit_graph () &noexcept |
| void | submit_graph () &noexcept |
| constexpr auto | get_env () const noexcept -> stdexec::env_of_t< Rcvr > |
| Public Member Functions inherited from Kokkos::Execution::Impl::Immovable | |
| Immovable ()=default | |
| Immovable (Immovable &&)=delete | |
| Immovable & | operator= (Immovable &&)=delete |
| Immovable (const Immovable &)=delete | |
| Immovable & | operator= (const Immovable &)=delete |
| ~Immovable ()=default | |
| Public Member Functions inherited from Kokkos::Execution::GraphImpl::OpStateBase< Exec, Rcvr > | |
| constexpr | OpStateBase (Rcvr rcvr) noexcept(std::is_nothrow_constructible_v< completion_signal_t, Rcvr && >) |
| template<typename Error> | |
| void | complete (stdexec::set_error_t, Error &&error) noexcept |
| void | complete (stdexec::set_stopped_t) noexcept |
Public Attributes | |
| state_t | state |
| children_op_states_t | children_op_states |
| PRAGMA_DIAGNOSTIC_PUSH KOKKOS_EXECUTION_PRAGMA_DIAGNOSTIC_IGNORED_DANGLING_REFERENCE node_t | node |
| PRAGMA_DIAGNOSTIC_POP Impl::CompileTimeOptional<!as_one, std::atomic< size_t > > | count {num_branches_not_remaining_on_graph} |
| Public Attributes inherited from Kokkos::Execution::GraphImpl::OpStateBase< Exec, Rcvr > | |
| completion_signal_t | completion_signal |
Static Public Attributes | |
| static constexpr bool | as_one |
| Determine if all branches remain fully on the graph, if connected to WhenAllChildReceiver. | |
| static constexpr bool | at_least_one_child_adds_a_node |
| Determine if at least one child operation state will add a node. | |
| static constexpr std::size_t | num_branches = sizeof...(Sndrs) |
| Number of branches. | |
| static constexpr std::size_t | num_branches_remaining_on_graph |
| Determine how many branches remain on graph (and how many don't). | |
| static constexpr std::size_t | num_branches_not_remaining_on_graph = num_branches - num_branches_remaining_on_graph |
Additional Inherited Members | |
| Static Public Member Functions inherited from Kokkos::Execution::GraphImpl::OpStateBase< Exec, Rcvr > | |
| static consteval auto | select_completion_signal_policy () noexcept |
Operation state for stdexec::when_all.
It creates the graph, and passes it to its branches through the receiver environment.
Definition at line 44 of file when_all.hpp.
| using Kokkos::Execution::GraphImpl::WhenAllOpState< Exec, Rcvr, Sndrs >::base_t = OpStateBase<Exec, Rcvr> |
Definition at line 49 of file when_all.hpp.
| using Kokkos::Execution::GraphImpl::WhenAllOpState< Exec, Rcvr, Sndrs >::children_op_states_t = stdexec::__tuple<stdexec::connect_result_t<Sndrs, WhenAllChildReceiver>...> |
Definition at line 67 of file when_all.hpp.
| using Kokkos::Execution::GraphImpl::WhenAllOpState< Exec, Rcvr, Sndrs >::execution_space = Exec |
Definition at line 50 of file when_all.hpp.
| using Kokkos::Execution::GraphImpl::WhenAllOpState< Exec, Rcvr, Sndrs >::graph_composition_policy_t |
If at_least_one_child_adds_a_node is false, the composition policy is unconditionally GraphComposition::Attach to avoid creating a useless Kokkos::Experimental::Graph.
Definition at line 143 of file when_all.hpp.
| using Kokkos::Execution::GraphImpl::WhenAllOpState< Exec, Rcvr, Sndrs >::node_t = std::invoke_result_t<JoinOpStateNodes, const children_op_states_t&> |
Definition at line 139 of file when_all.hpp.
| using Kokkos::Execution::GraphImpl::WhenAllOpState< Exec, Rcvr, Sndrs >::operation_state_concept = stdexec::operation_state_tag |
Definition at line 47 of file when_all.hpp.
| using Kokkos::Execution::GraphImpl::WhenAllOpState< Exec, Rcvr, Sndrs >::predecessor_t = GraphComposition::node_t<Exec, Rcvr> |
Definition at line 52 of file when_all.hpp.
| using Kokkos::Execution::GraphImpl::WhenAllOpState< Exec, Rcvr, Sndrs >::state_t = State<graph_composition_policy_t, execution_space> |
Definition at line 145 of file when_all.hpp.
|
inline |
noexcept because both graph and node construction may throw.stdexec::when_all for an execution space instance to submit the graph onto. Definition at line 159 of file when_all.hpp.
References children_op_states, and state.
|
inlinenoexcept |
Definition at line 236 of file when_all.hpp.
References submit().
|
inlinenoexcept |
Definition at line 242 of file when_all.hpp.
References Kokkos::Execution::GraphImpl::OpStateBase< Exec, Rcvr >::complete().
|
inlinenodiscardconstexprnoexcept |
Definition at line 299 of file when_all.hpp.
References Kokkos::Execution::GraphImpl::OpStateBase< Exec, Rcvr >::completion_signal, and KOKKOS_EXECUTION_GET_ENV.
|
inlinenoexcept |
Definition at line 182 of file when_all.hpp.
References Kokkos::Execution::GraphImpl::OpStateBase< Exec, Rcvr >::completion_signal, Kokkos::Execution::GraphImpl::get_node, and state.
|
inlinenodiscardnoexcept |
Definition at line 197 of file when_all.hpp.
References state.
|
inlinenodiscardnoexcept |
Definition at line 191 of file when_all.hpp.
References node.
|
inlinenoexcept |
If as_one is true, there is no need to start the branches.
Definition at line 271 of file when_all.hpp.
|
inlinenoexcept |
Definition at line 246 of file when_all.hpp.
References as_one, and children_op_states.
|
inlinenoexcept |
Definition at line 231 of file when_all.hpp.
References as_one, and submit_graph().
|
inlinenoexcept |
Each branch that does not remain on graph calls this method if as_one is false. Once the counter decreases to zero, the graph is submitted. This allows branches that may start with operations that are not part of the graph, implying that the graph cannot be submitted by one of the other branches.
The following schematic illustrates such a situation.
* (branch 1) -> (thread) -> (then) -> (graph) -> (then) -\ * -> (when_all) * (branch 0) -> (graph) -> (bulk) -/ *
If the branch 0 submits the graph before calling WhenAllOpState::complete, the graph will be submitted before the branch 1 is started, leading to operations of the graph in branch 1 potentially running before the "thread".
Definition at line 224 of file when_all.hpp.
References as_one, count, and submit_graph().
|
inlinenoexcept |
|
inlinenoexcept |
Definition at line 279 of file when_all.hpp.
References Kokkos::Execution::GraphImpl::OpStateBase< Exec, Rcvr >::completion_signal.
|
staticconstexpr |
Determine if all branches remain fully on the graph, if connected to WhenAllChildReceiver.
Definition at line 70 of file when_all.hpp.
|
staticconstexpr |
Determine if at least one child operation state will add a node.
Definition at line 74 of file when_all.hpp.
| children_op_states_t Kokkos::Execution::GraphImpl::WhenAllOpState< Exec, Rcvr, Sndrs >::children_op_states |
Definition at line 149 of file when_all.hpp.
| PRAGMA_DIAGNOSTIC_POP Impl::CompileTimeOptional<!as_one, std::atomic<size_t> > Kokkos::Execution::GraphImpl::WhenAllOpState< Exec, Rcvr, Sndrs >::count {num_branches_not_remaining_on_graph} |
Definition at line 156 of file when_all.hpp.
| PRAGMA_DIAGNOSTIC_PUSH KOKKOS_EXECUTION_PRAGMA_DIAGNOSTIC_IGNORED_DANGLING_REFERENCE node_t Kokkos::Execution::GraphImpl::WhenAllOpState< Exec, Rcvr, Sndrs >::node |
Definition at line 153 of file when_all.hpp.
|
staticconstexpr |
Number of branches.
Definition at line 80 of file when_all.hpp.
|
staticconstexpr |
Definition at line 87 of file when_all.hpp.
|
staticconstexpr |
Determine how many branches remain on graph (and how many don't).
Definition at line 83 of file when_all.hpp.
| state_t Kokkos::Execution::GraphImpl::WhenAllOpState< Exec, Rcvr, Sndrs >::state |
Definition at line 148 of file when_all.hpp.