1#ifndef KOKKOS_EXECUTION_EXECUTION_SPACE_SCHEDULE_FROM_HPP
2#define KOKKOS_EXECUTION_EXECUTION_SPACE_SCHEDULE_FROM_HPP
4#include "stdexec/execution.hpp"
16template <stdexec::scheduler Schd, stdexec::receiver Rcvr>
25 const bool skip = [&]() {
26 if constexpr (stdexec::__is_instance_of<Rcvr, ContinuesOnReceiver>) {
27 if constexpr (stdexec::__queryable_with<stdexec::env_of_t<Rcvr>,
get_exec_t>) {
30 std::remove_cvref_t<
decltype(
get_exec(stdexec::get_env(
rcvr)).get())>,
31 typename Schd::execution_space
40 schd.state->exec.fence(
41 std::format(
"{}: schedule_from", Kokkos::Impl::TypeInfo<typename Schd::execution_space>::name()));
42 stdexec::set_value(std::move(
rcvr));
45 template <
typename Error>
47 stdexec::set_error(std::move(
rcvr), std::forward<Error>(err));
51 stdexec::set_stopped(std::move(
rcvr));
59template <stdexec::scheduler Schd, stdexec::sender Sndr>
65 template <
typename Rcvr>
68 template <stdexec::receiver Rcvr>
69 stdexec::operation_state
auto connect(Rcvr rcvr) &&
noexcept(
70 std::is_nothrow_constructible_v<rcvr_t<Rcvr>, Schd&&, Rcvr&&>
71 && stdexec::__nothrow_connectable<Sndr&&, rcvr_t<Rcvr>>) {
72 return stdexec::connect(
84 template <
typename Sndr,
typename Env>
85 using schd_t = stdexec::__completion_scheduler_of_t<stdexec::set_value_t, Sndr, Env>;
87 template <
typename Sndr,
typename Env>
90 template <
typename Env, execution_space_completing_sender<Env> Sndr>
91 auto operator()(
const Env& env, stdexec::schedule_from_t, stdexec::__ignore, Sndr&&
sndr)
const
92 noexcept(std::is_nothrow_constructible_v<sndr_t<Sndr, Env>,
schd_t<Sndr, Env>&&, Sndr&&>) {
95 .schd = stdexec::get_completion_scheduler<stdexec::set_value_t>(stdexec::get_env(
sndr), env),
96 .sndr = std::forward<Sndr>(
sndr)};
#define KOKKOS_EXECUTION_IMPL_FORWARDING_ATTRIBUTES_GET_ENV(_type_, _obj_)
#define KOKKOS_EXECUTION_COMPL_SIGS_KEEP(_sndr_type_)
#define KOKKOS_EXECUTION_UPSERT_EXEC(_exec_type_, _exec_, _rcvr_type_, _rcvr_)
constexpr get_exec_t get_exec
Receiver for schedule_from.
void set_stopped() &&noexcept
void set_error(Error &&err) &&noexcept
stdexec::receiver_t receiver_concept
void set_value() &&noexcept
Sender for schedule_from.
stdexec::sender_t sender_concept
ScheduleFromReceiver< Schd, Rcvr > rcvr_t
stdexec::operation_state auto connect(Rcvr rcvr) &&noexcept(std::is_nothrow_constructible_v< rcvr_t< Rcvr >, Schd &&, Rcvr && > &&stdexec::__nothrow_connectable< Sndr &&, rcvr_t< Rcvr > >)