4#include "exec/static_thread_pool.hpp"
29using namespace Kokkos::utils::callbacks;
42 const view_s_t data(Kokkos::view_alloc(
exec,
"data - shared space"));
52 | stdexec::continues_on(stdexec::inline_scheduler{})
56 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
58 const auto recorded_events = recorder_listener_t::record(
59 [chain = std::move(chain)]()
mutable {
60 stdexec::sync_wait(std::move(chain));
74 const view_s_t data(Kokkos::view_alloc(
"data - shared space"));
81 stdexec::schedule(stdexec::inline_scheduler{})
88 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
90 const auto recorded_events = recorder_listener_t::record(
91 [chain = std::move(chain)]()
mutable {
92 stdexec::sync_wait(std::move(chain));
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.";
125 const auto recorded_events = recorder_listener_t::record(
126 [chain = std::move(chain)]()
mutable {
127 stdexec::sync_wait(std::move(chain));
132 testing::ElementsAre(
136 ASSERT_EQ(data(), 12);
141 const view_s_t data(Kokkos::view_alloc(
exec,
"data - shared space"));
145 experimental::execution::static_thread_pool pool{1};
153 | stdexec::continues_on(pool.get_scheduler())
157 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
159 const auto recorded_events = recorder_listener_t::record(
160 [chain = std::move(chain)]()
mutable {
161 stdexec::sync_wait(std::move(chain));
166 testing::ElementsAre(
170 ASSERT_EQ(data(), 8);
175 const view_s_t data(Kokkos::view_alloc(
"data - shared space"));
179 experimental::execution::static_thread_pool pool{1};
184 stdexec::schedule(pool.get_scheduler())
191 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
193 const auto recorded_events = recorder_listener_t::record(
194 [chain = std::move(chain)]()
mutable {
195 stdexec::sync_wait(std::move(chain));
200 testing::ElementsAre(
204 ASSERT_EQ(data(), 8);
209 const view_s_t data(Kokkos::view_alloc(
"data - shared space"));
213 experimental::execution::static_thread_pool pool{1};
218 stdexec::schedule(pool.get_scheduler())
224 | stdexec::continues_on(pool.get_scheduler())
228 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
230 const auto recorded_events = recorder_listener_t::record(
231 [chain = std::move(chain)]()
mutable {
232 stdexec::sync_wait(std::move(chain));
237 testing::ElementsAre(
241 ASSERT_EQ(data(), 12);
246 const view_s_t data(Kokkos::view_alloc(
exec,
"data - shared space"));
250 experimental::execution::static_thread_pool pool{1};
258 | stdexec::continues_on(pool.get_scheduler())
265 ASSERT_EQ(data(), 0) <<
"Eager execution is not allowed.";
267 const auto recorded_events = recorder_listener_t::record(
268 [chain = std::move(chain)]()
mutable {
269 stdexec::sync_wait(std::move(chain));
274 testing::ElementsAre(
280 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_)
static constexpr bool on_device
RecorderListener< BeginFenceEvent, BeginParallelForEvent > recorder_listener_t
#define KOKKOS_EXECUTION_STDEXEC_PRAGMA_DIAGNOSTIC_IGNORED
Basic list of ignored diagnostics when including anything from stdexec.
void show_exec_space_id(const Exec &exec, std::string_view label="", std::ostream &out=std::cout)
constexpr bool on_device()
auto get_scheduler() const noexcept -> ExecutionSpaceImpl::Scheduler< Exec >
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.