34using namespace Kokkos::utils::callbacks;
62 using then_sndr_t = stdexec::transform_sender_result_t<
63 decltype(stdexec::then(std::declval<schd_sndr_t>(), std::declval<functor_t>())),
69 static_assert(std::same_as<Kokkos::Execution::Impl::exec_of_t<then_sndr_t>, TEST_EXECUTION_SPACE>);
90 static_assert(std::same_as<
91 stdexec::__demangle_t<sndr_then_t>,
99 static_assert(stdexec::__detail::__has_nothrow_transform_sender<
101 stdexec::set_value_t,
106 using sndr_then_maythrow_on_move_t =
109 static_assert(!stdexec::__detail::__has_nothrow_transform_sender<
110 Kokkos::Execution::GraphImpl::Domain,
111 stdexec::set_value_t,
112 sndr_then_maythrow_on_move_t&&,
123 static_assert(!std::is_nothrow_constructible_v<Kokkos::Experimental::Graph<TEST_EXECUTION_SPACE>>);
126 decltype(stdexec::schedule(std::declval<typename ThenTest::scheduler_t>()) | stdexec::then(Tests::Utils::Functors::NoOp<false, false, false>{}));
128 static_assert(!stdexec::__nothrow_connectable<sndr_then_t, Tests::Utils::SinkReceiver>);
139 decltype(stdexec::schedule(std::declval<typename ThenTest::scheduler_t>()) | stdexec::then(functor_t{}) | stdexec::then(functor_t{}));
140 using connect_result_t = stdexec::connect_result_t<sndr_t, Tests::Utils::SinkReceiver>;
142 static_assert(stdexec::__is_instance_of<connect_result_t, Kokkos::Execution::GraphImpl::OpState>);
144 using root_t =
typename ThenTest::graph_t::root_t;
145 using then_A_t = Kokkos::Experimental::GraphNodeRef<
146 TEST_EXECUTION_SPACE,
147 Kokkos::Impl::GraphNodeThenImpl<TEST_EXECUTION_SPACE, Kokkos::Experimental::ThenPolicy<>, functor_t>,
150 using then_B_t = Kokkos::Experimental::GraphNodeRef<
151 TEST_EXECUTION_SPACE,
152 Kokkos::Impl::GraphNodeThenImpl<TEST_EXECUTION_SPACE, Kokkos::Experimental::ThenPolicy<>, functor_t>,
156 static_assert(std::same_as<typename connect_result_t::predecessor_t, root_t>);
157 static_assert(std::same_as<typename connect_result_t::node_t, then_B_t>);
168 const view_s_t data(Kokkos::view_alloc(
exec,
"data - shared space"));
175 | stdexec::then(functor_t{.prev = 0, .value = 4, .data = data.data()})
176 | stdexec::then(functor_t{.prev = 4, .value = 3, .data = data.data()});
178 using sndr_t =
decltype(sndr);
180 static_assert(std::same_as<
181 stdexec::__demangle_t<stdexec::transform_sender_result_t<sndr_t, stdexec::env<>>>,
183 TEST_EXECUTION_SPACE,
190 static_assert(std::same_as<stdexec::__domain_of_t<stdexec::env_of_t<sndr_t>>, stdexec::default_domain>);
191 static_assert(std::same_as<
192 stdexec::__detail::__completing_domain_t<stdexec::set_value_t, sndr_t>,
197 static_assert(std::same_as<
202 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
209 testing::ElementsAre(
217 ASSERT_EQ(data(), 7);
225 const view_s_t data(Kokkos::view_alloc(
exec,
"data - shared space"));
234 using work_t =
decltype(work);
239 stdexec::__mset<stdexec::set_error_t(std::exception_ptr), stdexec::set_value_t()>
242 std::same_as<stdexec::__completion_domain_of_t<stdexec::set_value_t, work_t>, stdexec::indeterminate_domain<>>);
245 auto sndr = stdexec::starts_on(gctx.
get_scheduler(), std::move(work));
247 using sndr_t =
decltype(sndr);
250 static_assert(stdexec::dependent_sender<sndr_t>);
252 static_assert(std::same_as<
258 stdexec::__mset<stdexec::set_value_t(), stdexec::set_error_t(std::exception_ptr)>,
263 static_assert(std::same_as<
264 stdexec::__completion_domain_of_t<stdexec::set_value_t, sndr_t, stdexec::env<>>,
268 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
274 testing::ElementsAre(
280 ASSERT_EQ(data(), 1);
constexpr std::string dispatch_label(const Exec &, Label &&label)
Get the dispatch label from Exec and label.
#define MATCHER_FOR_BEGIN_FENCE(_exec_, _label_)
RecorderListener< ConjunctionMatcher< EventDiscardMatcher< TEST_EXECUTION_SPACE >, GraphEventDiscardMatcher< TEST_EXECUTION_SPACE > >, BeginFenceEvent, BeginParallelForEvent, AllocateDataEvent, DeallocateDataEvent, Kokkos::Execution::Impl::RecordEvent, Kokkos::Execution::Impl::WaitEvent, Kokkos::Execution::GraphImpl::GraphAddNodeEvent, Kokkos::Execution::GraphImpl::GraphCreateEvent, Kokkos::Execution::GraphImpl::GraphInstantiateEvent, Kokkos::Execution::GraphImpl::GraphSubmitEvent > recorder_listener_t
Concept for a sender whose completion scheduler is Kokkos::Execution::GraphImpl::Scheduler.
Concept that constrains the type of a sender that dispatches a functor for execution.
#define THEN_INCREMENT(_data_)
Add a then using Tests::Utils::Functors::Increment that may throw. // NOLINTNEXTLINE(cppcoreguideline...
std::invoke_result_t< stdexec::get_completion_scheduler_t< Tag >, stdexec::env_of_t< Sndr >, Env... > completion_scheduler_of_t
Retrieve the completion scheduler for a given completion tag.
consteval bool test_sndr_nothrow_transformable()
consteval bool test_then_opstate_traits()
consteval bool test_sndr_traits()
consteval bool test_sndr_nothrow_connectable()
typename stdexec::__basic_sender< Args... >::type basic_sender_t
See https://github.com/NVIDIA/stdexec/pull/1873#discussion_r2834863237.
auto record_sync_wait(Sndr &&sndr)
consteval bool check_continues_on_after_just_stopped()
auto get_scheduler() const noexcept -> GraphImpl::Scheduler< Exec >
Event to be sent to Kokkos::utils::callbacks::dispatch when a Kokkos graph node is added.
Event to be sent to Kokkos::utils::callbacks::dispatch when a Kokkos graph is created.
Event to be sent to Kokkos::utils::callbacks::dispatch when a Kokkos graph is instantiated.
Event to be sent to Kokkos::utils::callbacks::dispatch when a Kokkos graph is submitted.
Sender for stdexec::then.
Event to be sent to Kokkos::utils::callbacks::dispatch when calling record.
Event to be sent to Kokkos::utils::callbacks::dispatch when calling wait.
Similar to EventDiscardMatcher, for graph-related events.
decltype(std::declval< const context_t >().get_scheduler()) scheduler_t
decltype(stdexec::schedule(std::declval< scheduler_t >())) schedule_sender_t
Kokkos::View< value_t, Kokkos::SharedSpace > view_s_t
Kokkos::Execution::GraphContext< Exec > context_t
Load the value at data and check it is equal to prev. Then, add value to it.
device_handle_t device_handle
#define MATCHER_FOR_GRAPH_CREATE(_device_handle_)
#define MATCHER_FOR_GRAPH_SUBMIT(_exec_, _graph_create_event_variant_)
#define MATCHER_FOR_GRAPH_ADDNODE(_graph_create_event_variant_, _device_handle_, _predecessor_)
#define MATCHER_FOR_GRAPH_NODE_OF(_graph_add_node_event_)