1#ifndef KOKKOS_EXECUTION_GRAPH_THEN_HPP
2#define KOKKOS_EXECUTION_GRAPH_THEN_HPP
6#if defined(KOKKOS_EXECUTION_ENABLE_DEBUG_LOGGING)
10#include "Kokkos_Graph.hpp"
26template <Kokkos::ExecutionSpace Exec,
typename Functor>
30 using node_props_t =
typename Kokkos::Impl::NodeCtorProps<std::string, device_handle_t>::uniform_type;
32 template <NodeRef Predecessor>
33 using node_t =
decltype(std::declval<const Predecessor&>()
34 .then(std::declval<node_props_t&&>(), std::declval<Functor&&>()));
37 template <NodeRef Predecessor>
39 auto device_handle = Kokkos::Impl::get_property<device_handle_t>(
node_props);
40 auto node = predecessor.then(std::move(
node_props), std::forward<Functor>(
functor));
50template <
typename Exec,
typename Sndr,
typename Functor>
68 template <
typename Env,
typename Functor,
typename Sndr>
71 template <
typename Env,
typename Functor,
typename Sndr>
72 requires stdexec::__sends<stdexec::set_value_t, Sndr, Env>
73 auto operator()(
const Env& env, stdexec::then_t, Functor&& functor, Sndr&&
sndr)
const
74 noexcept(std::is_nothrow_constructible_v<
80 auto schd = stdexec::get_completion_scheduler<stdexec::set_value_t>(stdexec::get_env(
sndr), env);
84 {.node_props = Kokkos::Experimental::node_props(
86 Kokkos::Experimental::get_device_handle(schd.state->exec)),
87 .functor = std::forward<Functor>(functor)},
88 .sndr = std::forward<Sndr>(
sndr)
100template <
typename Exec,
typename Sndr,
typename Functor>
101extern __mtype<Kokkos::Execution::GraphImpl::ThenSender<Exec, __demangle_t<Sndr>, Functor>>
102 __demangle_v<Kokkos::Execution::GraphImpl::ThenSender<Exec, Sndr, Functor>>;
#define KOKKOS_EXECUTION_IMPL_FORWARDING_ATTRIBUTES_GET_ENV(_type_, _obj_)
#define KOKKOS_EXECUTION_COMPL_SIGS_ADD(_decayed_self_type_, _sndr_type_,...)
Concept for a sender whose completion scheduler is Kokkos::Execution::GraphImpl::Scheduler.
#define KOKKOS_EXECUTION_IMPL_GRAPH_ADD_NODE_DEBUG_LOGGING(_type_, _node_, _predecessor_)
#define KOKKOS_EXECUTION_GRAPH_OPERATION_STATE_CONNECT
void graph_add_node_event(const Predecessor &predecessor, const NodeType &node, const Kokkos::Impl::DeviceHandle< Exec > &device_handle)
Record an event for a node added after predecessor.
auto no_graph_scheduler_in_env() noexcept
Show a better compile diagnostic when there is no Kokkos::Execution::GraphImpl::Scheduler found.
typename ExecOf< Args... >::type exec_of_t
consteval std::string_view dispatch_label() noexcept
View the dispatch label as a std::string_view.
auto add_node(const Predecessor &predecessor) &&noexcept(false) -> node_t< Predecessor >
typename Kokkos::Impl::NodeCtorProps< std::string, device_handle_t >::uniform_type node_props_t
Kokkos::Impl::DeviceHandle< Exec > device_handle_t
decltype(std::declval< const Predecessor & >() .then(std::declval< node_props_t && >(), std::declval< Functor && >())) node_t
Sender for stdexec::then.
stdexec::sender_tag sender_concept
ThenClosure< Exec, Functor > closure_t