kokkos-execution 0.0.1
Loading...
Searching...
No Matches
test_scoped_region.cpp
Go to the documentation of this file.
3
8
20
22
23using namespace Kokkos::utils::callbacks;
24
37
39consteval bool test_sndr_traits() {
40 using schd_sndr_t = typename ScopedRegionTest::schedule_sender_t;
41
42 using scoped_region_sndr_t =
43 decltype(std::declval<schd_sndr_t>() | Kokkos::Execution::Profiling::scoped_region("the name of my nice scoped region", stdexec::then(KOKKOS_LAMBDA(){})));
44
45 static_assert(stdexec::__nothrow_connectable<scoped_region_sndr_t, Tests::Utils::SinkReceiver>);
46
47 return true;
48}
49static_assert(test_sndr_traits());
50
56TEST_F(ScopedRegionTest, many) {
57 const view_s_t data(Kokkos::view_alloc("data - shared space", exec));
58
59 const context_t esc{exec};
60
61 auto chain = stdexec::schedule(esc.get_scheduler())
63 "the name of my nice scoped region", THEN_INCREMENT(data) | THEN_INCREMENT(data));
64
65 ASSERT_THAT(
66 recorder_listener_t::record([chain = std::move(chain)]() mutable { stdexec::sync_wait(std::move(chain)); }),
67 testing::ElementsAre(
69 MATCHER_FOR_PUSH_REGION("the name of my nice scoped region"),
75}
76
77} // namespace Tests::ExecutionSpaceImpl
#define MATCHER_FOR_PUSH_REGION(_label_)
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_POP_REGION()
#define MATCHER_FOR_BEGIN_FENCE(_exec_, _label_)
RecorderListener< EventDiscardMatcher< TEST_EXECUTION_SPACE >, BeginFenceEvent, BeginParallelForEvent, PushRegionEvent, PopRegionEvent > recorder_listener_t
#define THEN_INCREMENT(_data_)
Add a then using Tests::Utils::Functors::Increment that may throw. // NOLINTNEXTLINE(cppcoreguideline...
Definition increment.hpp:35
constexpr Kokkos::Execution::ExecutionSpaceImpl::ScopedRegion scoped_region
consteval bool test_sndr_traits()
Definition test_bulk.cpp:38
Matcher to filter out events that are just noise for tests.
auto get_scheduler() const noexcept -> ExecutionSpaceImpl::Scheduler< Exec >
decltype(stdexec::schedule(std::declval< scheduler_t >())) schedule_sender_t
Definition context.hpp:27
Kokkos::Execution::ExecutionSpaceContext< Exec > context_t
Definition context.hpp:25