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
7
21
22namespace Tests::GraphImpl {
23
26using graph_schedule_sender_t = typename graph_scheduler_t::Sender;
27using graph_schedule_sender_attrs_t = typename graph_schedule_sender_t::Attributes;
28
31
37TEST(Scheduler, round_trip_property) {
38 const graph_context_t ctx{TEST_EXECUTION_SPACE{}};
39 const graph_scheduler_t sch = ctx.get_scheduler();
40 ASSERT_EQ(stdexec::get_completion_scheduler<stdexec::set_value_t>(stdexec::get_env(stdexec::schedule(sch))), sch);
41}
42
47consteval bool test_scheduler_schedule() {
48 static_assert(
49 std::same_as<decltype(stdexec::schedule(std::declval<const graph_scheduler_t&>())), graph_schedule_sender_t>);
50
51 return true;
52}
53static_assert(test_scheduler_schedule());
54
60 static_assert(std::same_as<stdexec::env_of_t<graph_schedule_sender_t>, const graph_schedule_sender_attrs_t&>);
61
62 return true;
63}
64static_assert(test_schedule_sender_attrs());
65
67consteval bool test_scheduler_queries() {
68 static_assert(std::same_as<
69 stdexec::__query_result_t<graph_scheduler_t, stdexec::get_completion_domain_t<stdexec::set_value_t>>,
71 >);
72
73 static_assert(
74 std::same_as<
75 stdexec::__query_result_t<graph_scheduler_t, stdexec::get_completion_scheduler_t<stdexec::set_value_t>>,
77 >);
78
79 return true;
80}
81static_assert(test_scheduler_queries());
82
85 static_assert(std::same_as<
86 stdexec::__query_result_t<
88 stdexec::get_completion_scheduler_t<stdexec::set_value_t>
89 >,
91 >);
92
93 static_assert(std::same_as<
94 stdexec::__query_result_t<
96 stdexec::get_completion_domain_t<stdexec::set_value_t>
97 >,
99 >);
100
101 return true;
102}
104
105} // 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