4#include "exec/single_thread_context.hpp"
7#include "gtest/gtest.h"
38using namespace Kokkos::utils::callbacks;
40class TEST_CATEGORY(RemainsOnGraphForTest)
68 stdexec::sender
auto sndr = stdexec::schedule(gctx.
get_scheduler()) | stdexec::then(
noop_t{});
70 using sndr_t =
decltype(sndr);
72 static_assert(!stdexec::dependent_sender<sndr_t>);
74 using outer_t = stdexec::connect_result_t<sndr_t, sync_wait_rcvr_t>;
75 using inner_t =
typename outer_t::inner_op_state_t;
77 static_assert(stdexec::__is_instance_of<outer_t, Kokkos::Execution::GraphImpl::OpState>);
79 stdexec::__is_instance_of<inner_t, Kokkos::Execution::GraphImpl::Scheduler<TEST_EXECUTION_SPACE>::OpState>);
101 experimental::execution::single_thread_context stc{};
104 stdexec::sender
auto sndr = stdexec::schedule(stc.get_scheduler()) | stdexec::then(
noop_t{})
107 using sndr_t =
decltype(sndr);
108 using op_state_t = stdexec::connect_result_t<sndr_t, sync_wait_rcvr_t>;
111 static_assert(stdexec::dependent_sender<sndr_t>);
122 testing::ElementsAre(
138 stdexec::sender
auto sndr = stdexec::schedule(gctx.
get_scheduler()) | stdexec::then(
noop_t{})
141 using sndr_t =
decltype(sndr);
142 using op_state_t = stdexec::connect_result_t<sndr_t, sync_wait_rcvr_t>;
152 testing::ElementsAre(
168 stdexec::sender
auto sndr = stdexec::when_all(
172 using sndr_t =
decltype(sndr);
173 using op_state_t = stdexec::connect_result_t<sndr_t, sync_wait_rcvr_t>;
183 testing::ElementsAre(
190 recorded_events.at(0),
207 const view_s_t data(Kokkos::view_alloc(
"data - shared space"));
209 experimental::execution::single_thread_context stc{};
212 stdexec::sender
auto sndr = stdexec::when_all(
219 using sndr_t =
decltype(sndr);
220 using op_state_t = stdexec::connect_result_t<sndr_t, sync_wait_rcvr_t>;
225 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
234 testing::ElementsAre(
243 recorded_events.at(0),
250 ASSERT_EQ(data(), 5);
constexpr std::string dispatch_label(const Exec &, Label &&label)
Get the dispatch label from Exec and label.
#define MATCHER_FOR_BEGIN_FENCE(_exec_, _label_)
#define TEST_CATEGORY(_name_)
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::GraphAddAggregateNodeEvent, Kokkos::Execution::GraphImpl::GraphAddNodeEvent, Kokkos::Execution::GraphImpl::GraphCreateEvent, Kokkos::Execution::GraphImpl::GraphInstantiateEvent, Kokkos::Execution::GraphImpl::GraphSubmitEvent > recorder_listener_t
Tests::Utils::Functors::NoOp< true, false, false > noop_t
Kokkos::Execution::Impl::SyncWait::Receiver< TEST_EXECUTION_SPACE, std::true_type > sync_wait_rcvr_t
#define KOKKOS_EXECUTION_THREADS_THROWS_ON_SYNC_WAIT_ASSERT_AND_SKIP(_sndr_)
#define KOKKOS_EXECUTION_STDEXEC_PRAGMA_DIAGNOSTIC_IGNORED
Basic list of ignored diagnostics when including anything from stdexec.
#define THEN_INCREMENT_ATOMIC(_scope_, _data_)
Same as THEN_INCREMENT, using Tests::Utils::atomic_fetch_add. // NOLINTNEXTLINE(cppcoreguidelines-mac...
auto record_sync_wait(Sndr &&sndr)
auto get_scheduler() const noexcept -> GraphImpl::Scheduler< Exec >
Event to be sent to Kokkos::utils::callbacks::dispatch when a Kokkos graph aggregate node is added.
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.
Event to be sent to Kokkos::utils::callbacks::dispatch when calling record.
Receiver for stdexec::sync_wait.
Event to be sent to Kokkos::utils::callbacks::dispatch when calling wait.
Similar to EventDiscardMatcher, for graph-related events.
Kokkos::View< value_t, Kokkos::SharedSpace > view_s_t
Kokkos::Execution::GraphContext< Exec > context_t
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_ADD_AGGREGATE_NODE(_graph_create_event_variant_,...)
#define MATCHER_FOR_GRAPH_ROOT_NODE_OF(_graph_create_event_)
#define MATCHER_FOR_GRAPH_NODE_OF(_graph_add_node_event_)