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_opstate_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>);
100 experimental::execution::single_thread_context stc{};
103 stdexec::sender
auto sndr = stdexec::schedule(stc.get_scheduler()) | stdexec::then(
noop_t{})
106 using sndr_t =
decltype(sndr);
107 using opstate_t = stdexec::connect_result_t<sndr_t, sync_wait_rcvr_t>;
110 static_assert(stdexec::dependent_sender<sndr_t>);
121 testing::ElementsAre(
136 stdexec::sender
auto sndr = stdexec::schedule(gctx.
get_scheduler()) | stdexec::then(
noop_t{})
139 using sndr_t =
decltype(sndr);
140 using opstate_t = stdexec::connect_result_t<sndr_t, sync_wait_rcvr_t>;
150 testing::ElementsAre(
164 stdexec::sender
auto sndr = stdexec::when_all(
168 using sndr_t =
decltype(sndr);
169 using opstate_t = stdexec::connect_result_t<sndr_t, sync_wait_rcvr_t>;
179 testing::ElementsAre(
184 recorded_events.at(0),
201 const view_s_t data(Kokkos::view_alloc(
"data - shared space"));
203 experimental::execution::single_thread_context stc{};
206 stdexec::sender
auto sndr = stdexec::when_all(
213 using sndr_t =
decltype(sndr);
214 using opstate_t = stdexec::connect_result_t<sndr_t, sync_wait_rcvr_t>;
219 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
228 testing::ElementsAre(
234 recorded_events.at(0),
241 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_)
Tests::Utils::Functors::NoOp< true, false, false > noop_t
Kokkos::Execution::Impl::SyncWait::Receiver< TEST_EXECUTION_SPACE, std::true_type > sync_wait_rcvr_t
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
#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_NODE_OF(_graph_add_node_event_)