kokkos-execution 0.0.1
Loading...
Searching...
No Matches
receiver.hpp
Go to the documentation of this file.
1#ifndef KOKKOS_EXECUTION_IMPL_RECEIVER_HPP
2#define KOKKOS_EXECUTION_IMPL_RECEIVER_HPP
3
5
8
10
12template <typename ParentOp, typename Env = stdexec::env_of_t<ParentOp>>
13struct Receiver {
15
16 ParentOp* parent_op;
17
18 void set_value() && noexcept {
19 parent_op->complete(stdexec::set_value);
20 }
21
22 template <typename Error>
23 void set_error(Error&& error) && noexcept {
24 parent_op->complete(stdexec::set_error, std::forward<Error>(error));
25 }
26
27 void set_stopped() && noexcept {
28 parent_op->complete(stdexec::set_stopped);
29 }
30
31 void submitted() && noexcept {
32 parent_op->submit();
33 }
34
35 [[nodiscard]]
36 constexpr auto get_env() const noexcept -> stdexec::__fwd_env_t<Env> {
37 return stdexec::__fwd_env(stdexec::get_env(*parent_op));
38 }
39};
40
41} // namespace Kokkos::Execution::Impl
42
43#endif // KOKKOS_EXECUTION_IMPL_RECEIVER_HPP
Receiver for an object parent_op that implements complete.
Definition receiver.hpp:13
constexpr auto get_env() const noexcept -> stdexec::__fwd_env_t< Env >
Definition receiver.hpp:36
void set_error(Error &&error) &&noexcept
Definition receiver.hpp:23