25using namespace Kokkos::utils::callbacks;
33 Kokkos::RangePolicy<TEST_EXECUTION_SPACE>,
51 Kokkos::RangePolicy<TEST_EXECUTION_SPACE>(0,
size)} {
55 static constexpr size_t size = 10;
78 sizeof(completion_signal_schedule_wait_event_t)
89 sizeof(completion_signal_order_on_exec_t)
100 sizeof(completion_signal_depend_on_event_t)
106static_assert(test_completion_signal_traits());
110 auto op_state = stdexec::connect(
111 stdexec::schedule(
esc.get_scheduler())
118 static_assert(std::same_as<
119 typename decltype(op_state)::completion_signal_policy_t,
125 recorder_listener_t::record([&]() { op_state.start(); }),
131template <Kokkos::ExecutionSpace Exec,
bool SubmittedOrderOn,
bool SubmittedDependOn>
134 SubmittedOrderOn || SubmittedDependOn,
136 stdexec::receiver_tag
146 template <
typename Error>
158 if (dep.has_value()) {
167 stdexec::prop{stdexec::get_delegation_scheduler,
loop->get_scheduler()},
state->
exec);
174 GTEST_SKIP() <<
"The execution space does not have non-blocking dispatch.";
177 const auto [exec_A, exec_B] = Kokkos::Experimental::partition_space(
exec, 1, 1);
178 const context_t esc_A{exec_A}, esc_B{exec_B};
180 stdexec::run_loop loop;
182 auto op_state = stdexec::connect(
190 const auto recorded_events_before_run = recorder_listener_t::record([&]() { op_state.start(); });
194 const auto recorded_events_after_run = recorder_listener_t::record([&]() { loop.run(); });
197 recorded_events_after_run, testing::ElementsAre(
MATCHER_FOR_WAIT_EVENT(recorded_events_before_run.at(0))));
205 std::optional<std::tuple<>> result;
207 auto op_state = stdexec::connect(
208 stdexec::schedule(
esc.get_scheduler())
214 .state = std::addressof(esc.m_state),
215 .runloop_state = std::addressof(runloop_state),
216 .result = std::addressof(result)});
218 static_assert(std::same_as<
219 typename decltype(op_state)::completion_signal_policy_t,
225 recorder_listener_t::record([&]() { op_state.start(); }),
230 runloop_state.loop.run();
235 const auto [exec_A, exec_B] = Kokkos::Experimental::partition_space(
exec, 1, 1);
236 const context_t esc_A{exec_A}, esc_B{exec_B};
238 stdexec::run_loop loop;
240 auto op_state = stdexec::connect(
249 static_assert(std::same_as<
250 typename decltype(op_state)::completion_signal_policy_t,
255 const auto recorded_events = recorder_listener_t::record([&]() { op_state.start(); });
258 ASSERT_THAT(recorded_events, testing::IsEmpty());
constexpr std::string dispatch_label(const Exec &, const std::string_view label)
Get the dispatch label from Exec and label.
#define MATCHER_FOR_WAIT_EVENT(_record_event_variant_)
#define MATCHER_FOR_RECORD_EVENT(_exec_)
#define MATCHER_FOR_BEGIN_FENCE(_exec_, _label_)
Kokkos::Execution::Impl::ParallelForData< Tests::Utils::Functors::SumIndices< view_s_t >, Kokkos::RangePolicy< TEST_EXECUTION_SPACE >, Kokkos::Execution::Impl::Label< std::string > > parallel_for_data_t
parallel_for_data_t pfor_data
RecorderListener< EventDiscardMatcher< TEST_EXECUTION_SPACE >, BeginFenceEvent, Kokkos::Execution::Impl::RecordEvent, Kokkos::Execution::Impl::WaitEvent > recorder_listener_t
static constexpr size_t size
constexpr auto join_env_with_exec(Env &&env, const Exec &exec) noexcept
Unconditionally join exec to env.
OptionalRef< const Event< Exec > > OptionalConstEventRef
Optionally stores a reference to a const Impl::Event.
std::optional< Event< Exec > > event_storage_t
void wait(const Event< Exec > &... events)
Wait for events to complete.
constexpr decltype(auto) get_property(Data &&data) noexcept
constexpr parallel_for_t parallel_for
consteval bool test_completion_signal_traits()
bool are_same_instances(const Exec &exec, const OtherExec &other_exec)
Matcher to filter out events that are just noise for tests.
auto get_scheduler() const noexcept -> ExecutionSpaceImpl::Scheduler< execution_space >
Event to be sent to Kokkos::utils::callbacks::dispatch when calling record.
Receiver for stdexec::sync_wait.
Inspired by https://github.com/NVIDIA/stdexec/blob/16076a81efa4477513e6ede9c2741fd034ecef99/include/s...
Event to be sent to Kokkos::utils::callbacks::dispatch when calling wait.
void submitted(Kokkos::Execution::Impl::OptionalConstEventRef< Exec > dep) &&noexcept
void set_error(Error &&) &&noexcept
std::conditional_t< SubmittedOrderOn||SubmittedDependOn, Kokkos::Execution::Impl::SubmittedReceiverTag, stdexec::receiver_tag > receiver_concept
constexpr auto get_env() const noexcept
void set_value() &&noexcept
void submitted() &&noexcept
Kokkos::Execution::Impl::State< Exec > const * state
Kokkos::View< value_t, Kokkos::SharedSpace > view_s_t
Kokkos::Execution::ExecutionSpaceContext< Exec > context_t
A receiver that can handle all completions and does nothing with them.