32using namespace Kokkos::utils::callbacks;
51 using variant_t =
typename recorder_listener_t::event_variant_t;
58template <
template <
typename...>
class SndrAdptr,
bool IsDispatchingSender,
typename... Args>
64 using label_t = std::string;
66 using policy_t = Kokkos::RangePolicy<TEST_EXECUTION_SPACE>;
67 using pfor_sndr_t = SndrAdptr<schd_sndr_t, label_t, functor_t, policy_t>;
76 using completion_signatures_t = stdexec::__completion_signatures_of_t<pfor_sndr_t, stdexec::env<>>;
78 static_assert(stdexec::__mset_eq<
79 stdexec::__mset<stdexec::set_value_t(), stdexec::set_error_t(std::exception_ptr)>,
80 completion_signatures_t
84 static_assert(std::same_as<
85 stdexec::__completion_domain_of_t<stdexec::set_value_t, pfor_sndr_t, stdexec::env<>>,
90 static_assert(std::same_as<
96 static_assert(stdexec::sender_to<pfor_sndr_t, Tests::Utils::SinkReceiver>);
98 static_assert(std::same_as<
99 stdexec::transform_sender_result_t<pfor_sndr_t, stdexec::env_of_t<Tests::Utils::SinkReceiver>>,
104 static_assert(!stdexec::__nothrow_connectable<pfor_sndr_t, Tests::Utils::SinkReceiver>);
112template <
typename ViewType>
115 using policy_t = Kokkos::RangePolicy<TEST_EXECUTION_SPACE>;
121 static_assert(std::is_nothrow_move_constructible_v<closure_t>);
132 Kokkos::RangePolicy<TEST_EXECUTION_SPACE>,
141 constexpr size_t size = 10;
143 const view_s_t data(Kokkos::view_alloc(
exec,
"data - shared space"));
149 std::format(
"{}: hello from pfor", Kokkos::Impl::TypeInfo<TEST_EXECUTION_SPACE>::name()),
150 Kokkos::RangePolicy<TEST_EXECUTION_SPACE>(0, size),
157 testing::ElementsAre(
163 ASSERT_EQ(data(), size / 2 * (size - 1));
171 constexpr size_t size = 10;
173 const view_s_t data(Kokkos::view_alloc(
exec,
"data - shared space"));
175 auto sndr = stdexec::just()
177 std::format(
"{}: hello from pfor", Kokkos::Impl::TypeInfo<TEST_EXECUTION_SPACE>::name()),
178 Kokkos::RangePolicy<TEST_EXECUTION_SPACE>(0, size),
182 auto starts_on = stdexec::starts_on(gctx.get_scheduler(), std::move(sndr));
188 testing::ElementsAre(
194 ASSERT_EQ(data(), size / 2 * (size - 1));
202 const view_s_t data(Kokkos::view_alloc(
exec,
"data - shared space"));
211 Kokkos::RangePolicy<typename functor_t::Tag, TEST_EXECUTION_SPACE>(0, 1), functor_t{.data = data}));
215 testing::ElementsAre(
221 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_)
typename recorder_listener_t::event_variant_t variant_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::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.
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.
constexpr parallel_for_t parallel_for
consteval bool test_closure_traits()
consteval bool test_sndr_traits()
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.
Scheduler for a Kokkos::Experimental::Graph.
Event to be sent to Kokkos::utils::callbacks::dispatch when calling record.
Event to be sent to Kokkos::utils::callbacks::dispatch when calling wait.
Custom algorithm for the Kokkos::parallel_for construct.
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
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_)