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}
56static_assert(test_scheduler_schedule());
57
63 static_assert(std::same_as<
64 stdexec::env_of_t<execution_space_schedule_sender_t>,
66 >);
67
68 return true;
69}
70static_assert(test_schedule_sender_attrs());
71
73consteval bool test_scheduler_queries() {
74 static_assert(std::same_as<
75 stdexec::__query_result_t<
77 stdexec::get_completion_domain_t<stdexec::set_value_t>
78 >,
80 >);
81
82 static_assert(std::same_as<
83 stdexec::__query_result_t<
85 stdexec::get_completion_scheduler_t<stdexec::set_value_t>
86 >,
88 >);
89
90 return true;
91}
92static_assert(test_scheduler_queries());
93
96 static_assert(std::same_as<
97 stdexec::__query_result_t<
99 stdexec::get_completion_scheduler_t<stdexec::set_value_t>
100 >,
102 >);
103
104 static_assert(std::same_as<
105 stdexec::__query_result_t<
107 stdexec::get_completion_domain_t<stdexec::set_value_t>
108 >,
110 >);
111
112 return true;
113}
115
116} // namespace Tests::ExecutionSpaceImpl
#define TEST_CATEGORY(_name_)
Definition category.hpp:10
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.