4#include "exec/fork_join.hpp"
5#include "exec/static_thread_pool.hpp"
35using namespace Kokkos::utils::callbacks;
52 const view_s_t data(Kokkos::view_alloc(
"data - shared space"));
54 experimental::execution::static_thread_pool pool{4};
58 stdexec::schedule(pool.get_scheduler())
60 | experimental::execution::fork_join(
63 | stdexec::continues_on(pool.get_scheduler()),
68 | stdexec::continues_on(stdexec::inline_scheduler{})
71 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
83 ASSERT_EQ(data(), 14);
92 const view_s_t data(Kokkos::view_alloc(
exec,
"data - shared space"));
98 | experimental::execution::fork_join(
103 static_assert(stdexec::__sender_for<
decltype(sndr), experimental::execution::fork_join_t>);
105 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
110 ASSERT_THAT(recorded_events, [&]() {
112 return testing::ElementsAre(
117 return testing::ElementsAre(
123 ASSERT_EQ(data(), 3);
132 const view_s_t data(Kokkos::view_alloc(
exec,
"data - shared space"));
138 | experimental::execution::fork_join(
143 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
147 ASSERT_THAT(recorded_events, [&]() {
149 return testing::ElementsAre(
157 return testing::ElementsAre(
165 ASSERT_EQ(data(), 3);
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
#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.
#define THEN_INCREMENT_ATOMIC(_data_)
Same as THEN_INCREMENT, using Tests::Utils::atomic_add. // NOLINTNEXTLINE(cppcoreguidelines-macro-usa...
constexpr check_scheduler_type_t< Tag, Schd > check_scheduler_type
auto record_sync_wait(Sndr &&sndr)
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.
#define BULK_SUM_INDICES(_size_, _data_)
Add a bulk using Tests::Utils::Functors::SumIndices. // NOLINTNEXTLINE(cppcoreguidelines-macro-usage)...