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 graph_schedule_sender_t = typename graph_scheduler_t::Sender;
25using graph_schedule_sender_attrs_t = typename graph_schedule_sender_t::Attributes;
26
29
35TEST(Scheduler, round_trip_property) {
36 const graph_context_t ctx{TEST_EXECUTION_SPACE{}};
37 const graph_scheduler_t sch = ctx.get_scheduler();
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(
47 std::same_as<decltype(stdexec::schedule(std::declval<const graph_scheduler_t&>())), graph_schedule_sender_t>);
48
49 return true;
50}
51static_assert(test_scheduler_schedule());
52
58 static_assert(std::same_as<stdexec::env_of_t<graph_schedule_sender_t>, const graph_schedule_sender_attrs_t&>);
59
60 return true;
61}
62static_assert(test_schedule_sender_attrs());
63
65consteval bool test_scheduler_queries() {
66 static_assert(std::same_as<
67 stdexec::__query_result_t<graph_scheduler_t, stdexec::get_completion_domain_t<stdexec::set_value_t>>,
69 >);
70
71 static_assert(
72 std::same_as<
73 stdexec::__query_result_t<graph_scheduler_t, stdexec::get_completion_scheduler_t<stdexec::set_value_t>>,
75 >);
76
77 return true;
78}
79static_assert(test_scheduler_queries());
80
83 static_assert(std::same_as<
84 stdexec::__query_result_t<
86 stdexec::get_completion_scheduler_t<stdexec::set_value_t>
87 >,
89 >);
90
91 static_assert(std::same_as<
92 stdexec::__query_result_t<
94 stdexec::get_completion_domain_t<stdexec::set_value_t>
95 >,
97 >);
98
99 return true;
100}
102
103} // namespace Tests::GraphImpl
consteval bool test_schedule_sender_attrs()
consteval bool test_schedule_sender_attrs_queries()
typename graph_scheduler_t::Sender graph_schedule_sender_t
consteval bool test_scheduler_schedule()
Kokkos::Execution::GraphImpl::Scheduler< TEST_EXECUTION_SPACE > graph_scheduler_t
consteval bool test_scheduler_queries()
Kokkos::Execution::GraphContext< TEST_EXECUTION_SPACE > graph_context_t
typename graph_schedule_sender_t::Attributes graph_schedule_sender_attrs_t
consteval bool check_scheduler()
Check that the given type models the stdexec::scheduler concept.
Execution context using Kokkos::Experimental::Graph under the hood.
Definition graph.hpp:108
auto get_scheduler() const noexcept -> GraphImpl::Scheduler< Exec >
Definition graph.hpp:117
Scheduler for a Kokkos::Experimental::Graph.
Definition graph.hpp:21