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<
67 Kokkos::RangePolicy<TEST_EXECUTION_SPACE>
73 static_assert(std::same_as<Kokkos::Execution::Impl::exec_of_t<bulk_sndr_t>, TEST_EXECUTION_SPACE>);
87 static_assert(stdexec::__detail::__has_nothrow_transform_sender<
94 using sndr_bulk_maythrow_on_move_t =
97 static_assert(!stdexec::__detail::__has_nothrow_transform_sender<
100 sndr_bulk_maythrow_on_move_t&&,
112 stdexec::parallel_policy,
122 using sndr_t =
decltype(stdexec::bulk(
123 stdexec::schedule(std::declval<typename BulkTest::context_t>().get_scheduler()),
128 static_assert(!std::is_const_v<sndr_t>);
131 using op_state_from_sndr_const_ref_t = stdexec::connect_result_t<const sndr_t&, Tests::Utils::SinkReceiver>;
133 static_assert(std::same_as<
134 op_state_from_sndr_const_ref_t,
141 Kokkos::RangePolicy<TEST_EXECUTION_SPACE>
152 constexpr size_t size = 10;
154 const view_s_t data(Kokkos::view_alloc(
exec,
"data - shared space"));
160 using chain_t =
decltype(chain);
163 static_assert(std::same_as<stdexec::__domain_of_t<stdexec::env_of_t<chain_t>>, stdexec::default_domain>);
164 static_assert(std::same_as<
165 stdexec::__detail::__completing_domain_t<stdexec::set_value_t, chain_t>,
170 static_assert(std::same_as<
171 decltype(stdexec::get_completion_scheduler<stdexec::set_value_t>(stdexec::get_env(chain))),
175 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
179 testing::ElementsAre(
183 ASSERT_EQ(data(), size / 2 * (size - 1));
221 constexpr size_t size = 10;
223 const view_s_t data(Kokkos::view_alloc(
exec,
"data - shared space"));
225 std::atomic<size_t> count = 0;
231 stdexec::sender
auto sndr =
232 stdexec::read_env(stdexec::get_allocator)
238 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
242 ASSERT_THAT(recorded_events, [&]() {
244 return testing::ElementsAre(
249 return testing::ElementsAre(
255 ASSERT_EQ(data(), size / 2 * (size - 1));
257 ASSERT_EQ(value, 42);
constexpr std::string dispatch_label(const Exec &, Label &&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< Exec >
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)...