35using namespace Kokkos::utils::callbacks;
63 using bulk_sndr_t = stdexec::transform_sender_result_t<
64 decltype(stdexec::bulk(std::declval<schd_sndr_t>(), stdexec::par, 42, std::declval<functor_t>())),
70 static_assert(std::same_as<Kokkos::Execution::Impl::exec_of_t<bulk_sndr_t>, TEST_EXECUTION_SPACE>);
84 stdexec::parallel_policy,
100 static_assert(stdexec::__detail::__has_nothrow_transform_sender<
102 stdexec::set_value_t,
107 using sndr_bulk_maythrow_on_move_t =
110 static_assert(!stdexec::__detail::__has_nothrow_transform_sender<
112 stdexec::set_value_t,
113 sndr_bulk_maythrow_on_move_t&&,
125 static_assert(!std::is_nothrow_constructible_v<Kokkos::Experimental::Graph<TEST_EXECUTION_SPACE>>);
130 static_assert(!stdexec::__nothrow_connectable<sndr_bulk_t, Tests::Utils::SinkReceiver>);
142 decltype(stdexec::schedule(std::declval<typename BulkTest::scheduler_t>()) | stdexec::bulk(stdexec::par, 42, functor_t{}) | stdexec::bulk(stdexec::par, 42, functor_t{}));
143 using connect_result_t = stdexec::connect_result_t<sndr_t, Tests::Utils::SinkReceiver>;
145 static_assert(stdexec::__is_instance_of<connect_result_t, Kokkos::Execution::GraphImpl::OpState>);
147 using root_t =
typename BulkTest::graph_t::root_t;
148 using range_policy_t =
149 Kokkos::RangePolicy<TEST_EXECUTION_SPACE, Kokkos::IndexType<int>, Kokkos::Impl::IsGraphKernelTag>;
150 using bulk_A_t = Kokkos::Experimental::GraphNodeRef<
151 TEST_EXECUTION_SPACE,
152 Kokkos::Impl::GraphNodeKernelImpl<TEST_EXECUTION_SPACE, range_policy_t, functor_t, Kokkos::ParallelForTag>,
155 using bulk_B_t = Kokkos::Experimental::GraphNodeRef<
156 TEST_EXECUTION_SPACE,
157 Kokkos::Impl::GraphNodeKernelImpl<TEST_EXECUTION_SPACE, range_policy_t, functor_t, Kokkos::ParallelForTag>,
161 static_assert(std::same_as<typename connect_result_t::predecessor_t, root_t>);
162 static_assert(std::same_as<typename connect_result_t::node_t, bulk_B_t>);
174 const view_s_t data(Kokkos::view_alloc(
exec,
"data - shared space"));
182 | stdexec::then(load_check_add_t{.prev = 6, .value = 3, .data = data.data()}) |
BULK_SUM_INDICES(4, data);
184 using sndr_t =
decltype(sndr);
186 using bulk_data_t = stdexec::__data_of<sndr_t>;
188 static_assert(std::same_as<
189 stdexec::transform_sender_result_t<sndr_t, stdexec::env<>>,
191 stdexec::then_t::__sender<
193 stdexec::__sexpr<stdexec::bulk_t, bulk_data_t, typename BulkTest::schedule_sender_t>
197 Kokkos::RangePolicy<TEST_EXECUTION_SPACE, Kokkos::IndexType<int>>
202 static_assert(std::same_as<stdexec::__domain_of_t<stdexec::env_of_t<sndr_t>>, stdexec::default_domain>);
203 static_assert(std::same_as<
204 stdexec::__detail::__completing_domain_t<stdexec::set_value_t, sndr_t>,
209 static_assert(std::same_as<
214 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
221 testing::ElementsAre(
224 recorded_events.at(0),
229 recorded_events.at(0),
234 recorded_events.at(0),
241 ASSERT_EQ(data(), 15);
249 const view_s_t data(Kokkos::view_alloc(
exec,
"data - shared space"));
258 using chain_t =
decltype(chain);
261 stdexec::get_completion_signatures<chain_t>()
262 == stdexec::completion_signatures<stdexec::set_value_t(), stdexec::set_error_t(std::exception_ptr)>{});
265 std::same_as<stdexec::__completion_domain_of_t<stdexec::set_value_t, chain_t>, stdexec::indeterminate_domain<>>);
268 auto starts_on = stdexec::starts_on(gctx.
get_scheduler(), std::move(chain));
270 using starts_on_t =
decltype(starts_on);
273 static_assert(stdexec::__has_eptr_completion<chain_t>);
274 static_assert(!stdexec::dependent_sender<starts_on_t>);
276 stdexec::get_completion_signatures<starts_on_t>()
277 == stdexec::completion_signatures<stdexec::set_value_t(), stdexec::set_error_t(std::exception_ptr)>{});
281 static_assert(stdexec::__completes_where_it_starts<stdexec::set_value_t, stdexec::env_of_t<chain_t>>);
283 static_assert(std::same_as<
287 static_assert(std::same_as<
288 stdexec::__completion_domain_of_t<stdexec::set_value_t, starts_on_t, stdexec::env<>>,
292 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
298 testing::ElementsAre(
305 ASSERT_EQ(data(), 10);
constexpr std::string dispatch_label(const Exec &, const std::string_view 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.
typename Kokkos::Impl::NodeCtorProps< Kokkos::Impl::DeviceHandle< Exec >, Label >::uniform_type node_props_t
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_sndr_traits()
consteval bool test_bulk_op_state_traits()
consteval bool test_sndr_nothrow_connectable()
auto record_sync_wait(Sndr &&sndr)
consteval bool check_continues_on_after_just_stopped()
auto get_scheduler() const noexcept -> GraphImpl::Scheduler< execution_space >
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.
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 BULK_SUM_INDICES(_size_, _data_)
Add a bulk using Tests::Utils::Functors::SumIndices. // NOLINTNEXTLINE(cppcoreguidelines-macro-usage)...
#define MATCHER_FOR_GRAPH_CREATE(_device_handle_)
#define MATCHER_FOR_GRAPH_ADDNODE(_graph_create_event_variant_, _device_handle_, _predecessor_,...)
#define MATCHER_FOR_GRAPH_SUBMIT(_exec_, _graph_create_event_variant_)
#define MATCHER_FOR_GRAPH_ROOT_NODE_OF(_graph_create_event_)
#define MATCHER_FOR_GRAPH_NODE_OF(_graph_add_node_event_)