|
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... | |
Public Types | |
| using | operation_state_concept = stdexec::operation_state_tag |
| using | base_t = OpStateBase<Exec, Rcvr> |
| using | execution_space = Exec |
| using | state_t = State<GraphComposition::Create, execution_space> |
| using | root_t = typename state_t::graph_t::root_t |
| using | children_op_states_t = stdexec::__tuple<stdexec::connect_result_t<Sndrs, WhenAllChildReceiver>...> |
| using | node_t |
| 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_) | |
| auto | query (get_node_t) const &noexcept -> const 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 |
| 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 |
| root_t | root |
| children_op_states_t | children_op_states |
| node_t | node |
| std::atomic< size_t > | count = sizeof...(Sndrs) |
| Public Attributes inherited from Kokkos::Execution::GraphImpl::OpStateBase< Exec, Rcvr > | |
| completion_signal_t | completion_signal |
Static Public Attributes | |
| static constexpr bool | as_one = (remains_on_graph_for<execution_space, Sndrs, WhenAllChildReceiver> && ...) |
| Determine if all branches remain fully on the graph, if connected to WhenAllChildReceiver. | |
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 34 of file when_all.hpp.
| using Kokkos::Execution::GraphImpl::WhenAllOpState< Exec, Rcvr, Sndrs >::base_t = OpStateBase<Exec, Rcvr> |
Definition at line 39 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 58 of file when_all.hpp.
| using Kokkos::Execution::GraphImpl::WhenAllOpState< Exec, Rcvr, Sndrs >::execution_space = Exec |
Definition at line 40 of file when_all.hpp.
| using Kokkos::Execution::GraphImpl::WhenAllOpState< Exec, Rcvr, Sndrs >::node_t |
Definition at line 73 of file when_all.hpp.
| using Kokkos::Execution::GraphImpl::WhenAllOpState< Exec, Rcvr, Sndrs >::operation_state_concept = stdexec::operation_state_tag |
Definition at line 37 of file when_all.hpp.
| using Kokkos::Execution::GraphImpl::WhenAllOpState< Exec, Rcvr, Sndrs >::root_t = typename state_t::graph_t::root_t |
Definition at line 43 of file when_all.hpp.
| using Kokkos::Execution::GraphImpl::WhenAllOpState< Exec, Rcvr, Sndrs >::state_t = State<GraphComposition::Create, execution_space> |
Definition at line 42 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 85 of file when_all.hpp.
References children_op_states, root, and state.
|
inlinenoexcept |
Definition at line 159 of file when_all.hpp.
References submit().
|
inlinenoexcept |
Definition at line 165 of file when_all.hpp.
References Kokkos::Execution::GraphImpl::OpStateBase< Exec, Rcvr >::complete().
|
inlinenodiscardconstexprnoexcept |
Definition at line 200 of file when_all.hpp.
References Kokkos::Execution::GraphImpl::OpStateBase< Exec, Rcvr >::completion_signal, and KOKKOS_EXECUTION_GET_ENV.
|
inlinenodiscardnoexcept |
Definition at line 119 of file when_all.hpp.
References state.
|
inlinenodiscardnoexcept |
Definition at line 114 of file when_all.hpp.
References node.
|
inlinenoexcept |
If as_one is true, there is no need to start the branches.
Definition at line 178 of file when_all.hpp.
|
inlinenoexcept |
Definition at line 169 of file when_all.hpp.
References as_one, and children_op_states.
|
inlinenoexcept |
Definition at line 154 of file when_all.hpp.
References as_one, and submit_graph().
|
inlinenoexcept |
Each branch calls this method if as_one is false. Once the counter decreases to zero, the graph is submitted. It is intended, because there is no strong check on the branch content if as_one is false. Indeed, one of the branches 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".
In the future, a solution could be to create one graph per branch in such a setting, but it would require introspecting the sender type of each branch, recursively.
Definition at line 147 of file when_all.hpp.
References as_one, count, and submit_graph().
|
inlinenoexcept |
Definition at line 186 of file when_all.hpp.
References Kokkos::Execution::GraphImpl::OpStateBase< Exec, Rcvr >::completion_signal, Kokkos::Execution::GraphImpl::get_graph_impl_ptr(), state, and Kokkos::Execution::GraphImpl::submit_graph().
|
staticconstexpr |
Determine if all branches remain fully on the graph, if connected to WhenAllChildReceiver.
Definition at line 71 of file when_all.hpp.
| children_op_states_t Kokkos::Execution::GraphImpl::WhenAllOpState< Exec, Rcvr, Sndrs >::children_op_states |
Definition at line 80 of file when_all.hpp.
| std::atomic<size_t> Kokkos::Execution::GraphImpl::WhenAllOpState< Exec, Rcvr, Sndrs >::count = sizeof...(Sndrs) |
Definition at line 82 of file when_all.hpp.
| node_t Kokkos::Execution::GraphImpl::WhenAllOpState< Exec, Rcvr, Sndrs >::node |
Definition at line 81 of file when_all.hpp.
| root_t Kokkos::Execution::GraphImpl::WhenAllOpState< Exec, Rcvr, Sndrs >::root |
Definition at line 79 of file when_all.hpp.
| state_t Kokkos::Execution::GraphImpl::WhenAllOpState< Exec, Rcvr, Sndrs >::state |
Definition at line 77 of file when_all.hpp.