26using namespace Kokkos::utils::callbacks;
41TEST_F(
OnTest, on_same_execution_space_instance) {
53 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
56 recorder_listener_t::record([chain = std::move(chain)]()
mutable { stdexec::sync_wait(std::move(chain)); }),
72TEST_F(
OnTest, on_another_execution_space_instance_same_type) {
75 const auto [exec_A, exec_B] = Kokkos::Experimental::partition_space(
exec, 1, 1);
85 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
87 const auto recorded_events = recorder_listener_t::record(
88 [chain = std::move(chain)]()
mutable { stdexec::sync_wait(std::move(chain)); });
101 testing::ElementsAre(
110 ASSERT_EQ(data(), 3) <<
"A synchronization is missing.";
119TEST_F(
OnTest, many_execution_space_instances_of_different_type) {
120 const view_s_t data(Kokkos::view_alloc(
exec,
"data - shared space"));
133 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
135 const auto recorded_events = recorder_listener_t::record(
136 [chain = std::move(chain)]()
mutable { stdexec::sync_wait(std::move(chain)); });
141 testing::ElementsAre(
149 testing::ElementsAre(
158 ASSERT_EQ(data(), 3) <<
"A synchronization is missing.";
constexpr std::string dispatch_label(const Exec &, Label &&label)
Get the dispatch label from Exec and label.
#define MATCHER_FOR_BEGIN_PFOR(_exec_, _label_)
#define MATCHER_FOR_BEGIN_FENCE(_exec_, _label_)
RecorderListener< EventDiscardMatcher< TEST_EXECUTION_SPACE >, BeginFenceEvent, BeginParallelForEvent > recorder_listener_t
#define THEN_INCREMENT(_data_)
Add a then using Tests::Utils::Functors::Increment that may throw. // NOLINTNEXTLINE(cppcoreguideline...
constexpr check_scheduler_type_t< Tag, Schd > check_scheduler_type
void show_exec_space_id(const Exec &exec, std::string_view label="", std::ostream &out=std::cout)
bool are_same_instances(const Exec &exec, const OtherExec &other_exec)
Execution context using a Kokkos execution space under the hood.
auto get_scheduler() const noexcept -> ExecutionSpaceImpl::Scheduler< Exec >
Kokkos::View< value_t, Kokkos::SharedSpace > view_s_t
Kokkos::Execution::ExecutionSpaceContext< Exec > context_t
Kokkos::DefaultHostExecutionSpace host_execution_space