kokkos-execution 0.0.1
Loading...
Searching...
No Matches
test_scheduler.cpp
Go to the documentation of this file.
1#include "gtest/gtest.h"
2
5
19
21
24using execution_space_schedule_sender_t = typename execution_space_scheduler_t::Sender;
25using execution_space_schedule_sender_attrs_t = typename execution_space_schedule_sender_t::Attributes;
26
29
35TEST(Scheduler, round_trip_property) {
36 const execution_space_context_t ctx{TEST_EXECUTION_SPACE{}};
38 ASSERT_EQ(stdexec::get_completion_scheduler<stdexec::set_value_t>(stdexec::get_env(stdexec::schedule(sch))), sch);
39}
40
45consteval bool test_scheduler_schedule() {
46 static_assert(std::same_as<
47 decltype(stdexec::schedule(std::declval<const execution_space_scheduler_t&>())),
49 >);
50
51 return true;
52}
53static_assert(test_scheduler_schedule());
54
60 static_assert(std::same_as<
61 stdexec::env_of_t<execution_space_schedule_sender_t>,
63 >);
64
65 return true;
66}
67static_assert(test_schedule_sender_attrs());
68
70consteval bool test_scheduler_queries() {
71 static_assert(std::same_as<
72 stdexec::__query_result_t<
74 stdexec::get_completion_domain_t<stdexec::set_value_t>
75 >,
77 >);
78
79 static_assert(std::same_as<
80 stdexec::__query_result_t<
82 stdexec::get_completion_scheduler_t<stdexec::set_value_t>
83 >,
85 >);
86
87 return true;
88}
89static_assert(test_scheduler_queries());
90
93 static_assert(std::same_as<
94 stdexec::__query_result_t<
96 stdexec::get_completion_scheduler_t<stdexec::set_value_t>
97 >,
99 >);
100
101 static_assert(std::same_as<
102 stdexec::__query_result_t<
104 stdexec::get_completion_domain_t<stdexec::set_value_t>
105 >,
107 >);
108
109 return true;
110}
112
113} // namespace Tests::ExecutionSpaceImpl
consteval bool test_schedule_sender_attrs_queries()
consteval bool test_schedule_sender_attrs()
typename execution_space_scheduler_t::Sender execution_space_schedule_sender_t
Kokkos::Execution::ExecutionSpaceImpl::Scheduler< TEST_EXECUTION_SPACE > execution_space_scheduler_t
Kokkos::Execution::ExecutionSpaceContext< TEST_EXECUTION_SPACE > execution_space_context_t
consteval bool test_scheduler_queries()
typename execution_space_schedule_sender_t::Attributes execution_space_schedule_sender_attrs_t
consteval bool test_scheduler_schedule()
consteval bool check_scheduler()
Check that the given type models the stdexec::scheduler concept.
Execution context using a Kokkos execution space under the hood.
auto get_scheduler() const noexcept -> ExecutionSpaceImpl::Scheduler< Exec >
Scheduler for a Kokkos execution space.