4#include "exec/static_thread_pool.hpp"
29using namespace Kokkos::utils::callbacks;
46 const view_s_t data(Kokkos::view_alloc(
exec,
"data - shared space"));
56 | stdexec::continues_on(stdexec::inline_scheduler{})
60 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
76 const view_s_t data(Kokkos::view_alloc(
"data - shared space"));
83 stdexec::schedule(stdexec::inline_scheduler{})
90 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
101 ASSERT_EQ(data(), 8);
106 const view_s_t data(Kokkos::view_alloc(
"data - shared space"));
113 stdexec::schedule(stdexec::inline_scheduler{})
119 | stdexec::continues_on(stdexec::inline_scheduler{})
123 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
130 testing::ElementsAre(
134 ASSERT_EQ(data(), 12);
139 const view_s_t data(Kokkos::view_alloc(
exec,
"data - shared space"));
143 experimental::execution::static_thread_pool pool{1};
151 | stdexec::continues_on(pool.get_scheduler())
155 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
162 testing::ElementsAre(
166 ASSERT_EQ(data(), 8);
171 const view_s_t data(Kokkos::view_alloc(
"data - shared space"));
175 experimental::execution::static_thread_pool pool{1};
180 stdexec::schedule(pool.get_scheduler())
187 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
196 testing::ElementsAre(
200 ASSERT_EQ(data(), 8);
205 const view_s_t data(Kokkos::view_alloc(
"data - shared space"));
209 experimental::execution::static_thread_pool pool{1};
214 stdexec::schedule(pool.get_scheduler())
220 | stdexec::continues_on(pool.get_scheduler())
224 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
233 testing::ElementsAre(
237 ASSERT_EQ(data(), 12);
242 const view_s_t data(Kokkos::view_alloc(
exec,
"data - shared space"));
246 experimental::execution::static_thread_pool pool{1};
254 | stdexec::continues_on(pool.get_scheduler())
261 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
270 testing::ElementsAre(
276 ASSERT_EQ(data(), 12);
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, Kokkos::Execution::Impl::RecordEvent, Kokkos::Execution::Impl::WaitEvent > recorder_listener_t
#define KOKKOS_EXECUTION_THREADS_THROWS_ON_SYNC_WAIT_ASSERT_AND_SKIP(_sndr_)
#define KOKKOS_EXECUTION_STDEXEC_PRAGMA_DIAGNOSTIC_IGNORED
Basic list of ignored diagnostics when including anything from stdexec.
auto record_sync_wait(Sndr &&sndr)
void show_exec_space_id(const Exec &exec, std::string_view label="", std::ostream &out=std::cout)
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.
Kokkos::View< value_t, Kokkos::SharedSpace > view_s_t
Kokkos::Execution::ExecutionSpaceContext< Exec > context_t
Load the value at data and check it is equal to prev. Then, add value to it.