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
4
8
22
24
27using execution_space_schedule_sender_t = typename execution_space_scheduler_t::Sender;
28using execution_space_schedule_sender_attrs_t = typename execution_space_schedule_sender_t::Attributes;
29
32
38TEST(TEST_CATEGORY(Scheduler), round_trip_property) {
39 const execution_space_context_t ctx{TEST_EXECUTION_SPACE{}};
41 ASSERT_EQ(stdexec::get_completion_scheduler<stdexec::set_value_t>(stdexec::get_env(stdexec::schedule(sch))), sch);
42}
43
48consteval bool test_scheduler_schedule() {
49 static_assert(std::same_as<
50 decltype(stdexec::schedule(std::declval<const execution_space_scheduler_t&>())),
52 >);
53
54 return true;
55}
56
57static_assert(test_scheduler_schedule());
58
64 static_assert(std::same_as<
65 stdexec::env_of_t<execution_space_schedule_sender_t>,
67 >);
68
69 return true;
70}
71
72static_assert(test_schedule_sender_attrs());
73
75consteval bool test_scheduler_queries() {
76 static_assert(std::same_as<
77 stdexec::__query_result_t<
79 stdexec::get_completion_domain_t<stdexec::set_value_t>
80 >,
82 >);
83
84 static_assert(std::same_as<
85 stdexec::__query_result_t<
87 stdexec::get_completion_scheduler_t<stdexec::set_value_t>
88 >,
90 >);
91
92 return true;
93}
94
95static_assert(test_scheduler_queries());
96
99 static_assert(std::same_as<
100 stdexec::__query_result_t<
102 stdexec::get_completion_scheduler_t<stdexec::set_value_t>
103 >,
105 >);
106
107 static_assert(std::same_as<
108 stdexec::__query_result_t<
110 stdexec::get_completion_domain_t<stdexec::set_value_t>
111 >,
113 >);
114
115 return true;
116}
117
119
122 constexpr auto completions = stdexec::completion_signatures<stdexec::set_value_t()>{};
123
124 static_assert(stdexec::get_completion_signatures<execution_space_schedule_sender_t>() == completions);
125
126 return true;
127}
128
130
131} // namespace Tests::ExecutionSpaceImpl
#define TEST_CATEGORY(_name_)
Definition category.hpp:10
consteval bool test_schedule_sender_attrs_queries()
consteval bool test_schedule_sender_completion_signatures()
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< execution_space >
Scheduler for a Kokkos execution space.