33using namespace Kokkos::utils::callbacks;
55 using bulk_sndr_t = stdexec::transform_sender_result_t<
56 decltype(stdexec::bulk(std::declval<schd_sndr_t>(), stdexec::par, 1, std::declval<functor_t>())),
60 static_assert(std::same_as<
68 Kokkos::RangePolicy<TEST_EXECUTION_SPACE, Kokkos::IndexType<int>>,
76 static_assert(std::same_as<Kokkos::Execution::Impl::exec_of_t<bulk_sndr_t>, TEST_EXECUTION_SPACE>);
91 static_assert(stdexec::__detail::__has_nothrow_transform_sender<
98 using sndr_bulk_maythrow_on_move_t =
101 static_assert(!stdexec::__detail::__has_nothrow_transform_sender<
103 stdexec::set_value_t,
104 sndr_bulk_maythrow_on_move_t&&,
108 using sndr_bulk_maythrow_on_copy_t =
111 static_assert(!stdexec::__detail::__has_nothrow_transform_sender<
113 stdexec::set_value_t,
114 const sndr_bulk_maythrow_on_copy_t&,
119 !
noexcept(stdexec::transform_sender(std::declval<const sndr_bulk_maythrow_on_copy_t&>(), stdexec::env<>{})));
130 stdexec::parallel_policy,
140 using sndr_t =
decltype(stdexec::bulk(
141 stdexec::schedule(std::declval<typename BulkTest::context_t>().get_scheduler()),
146 static_assert(!std::is_const_v<sndr_t>);
149 using op_state_from_sndr_const_ref_t = stdexec::connect_result_t<const sndr_t&, Tests::Utils::SinkReceiver>;
151 static_assert(std::same_as<
152 op_state_from_sndr_const_ref_t,
157 TEST_EXECUTION_SPACE,
160 Kokkos::RangePolicy<TEST_EXECUTION_SPACE, Kokkos::IndexType<int>>,
174 constexpr size_t size = 10;
176 const view_s_t data(Kokkos::view_alloc(
exec,
"data - shared space"));
182 using chain_t =
decltype(chain);
185 static_assert(std::same_as<stdexec::__domain_of_t<stdexec::env_of_t<chain_t>>, stdexec::default_domain>);
186 static_assert(std::same_as<
187 stdexec::__detail::__completing_domain_t<stdexec::set_value_t, chain_t>,
192 static_assert(std::same_as<
193 decltype(stdexec::get_completion_scheduler<stdexec::set_value_t>(stdexec::get_env(chain))),
197 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
201 testing::ElementsAre(
205 ASSERT_EQ(data(), size / 2 * (size - 1));
243 constexpr size_t size = 10;
245 const view_s_t data(Kokkos::view_alloc(
exec,
"data - shared space"));
247 std::atomic<size_t> count = 0;
253 stdexec::sender
auto sndr =
254 stdexec::read_env(stdexec::get_allocator)
260 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
264 ASSERT_THAT(recorded_events, [&]() {
266 return testing::ElementsAre(
271 return testing::ElementsAre(
277 ASSERT_EQ(data(), size / 2 * (size - 1));
279 ASSERT_EQ(value, 42);
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_BEGIN_PFOR(_exec_, _label_)
#define MATCHER_FOR_RECORD_EVENT(_exec_)
#define MATCHER_FOR_BEGIN_FENCE(_exec_, _label_)
RecorderListener< EventDiscardMatcher< TEST_EXECUTION_SPACE >, BeginFenceEvent, BeginParallelForEvent, Kokkos::Execution::Impl::RecordEvent, Kokkos::Execution::Impl::WaitEvent > recorder_listener_t
Concept for a sender whose completion scheduler is Kokkos::Execution::ExecutionSpaceImpl::Scheduler.
Concept that constrains the type of a sender that dispatches a functor for execution.
constexpr bool test_op_state_passed_by_const_ref()
consteval bool test_sndr_traits()
consteval bool test_sndr_nothrow_transformable()
auto record_sync_wait(Sndr &&sndr)
consteval bool check_continues_on_after_just_stopped()
constexpr check_rcvr_env_queryable_with_t< true, Queries... > check_rcvr_env_queryable_with
auto round_trip_allocate(Allocator &allocator, T &&value)
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.
Event to be sent to Kokkos::utils::callbacks::dispatch when calling wait.
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::ExecutionSpaceContext< Exec > context_t
Count construction, move/copy construction, move/copy assignment and destruction atomically on host.
static std::atomic< unsigned int > move_assignments
static std::atomic< unsigned int > copy_constructions
static std::atomic< unsigned int > copy_assignments
A receiver that can handle all completions and does nothing with them.
A minimal tracking allocator.
#define BULK_SUM_INDICES(_size_, _data_)
Add a bulk using Tests::Utils::Functors::SumIndices. // NOLINTNEXTLINE(cppcoreguidelines-macro-usage)...