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
23namespace Tests::GraphImpl {
24
27using graph_schedule_sender_t = typename graph_scheduler_t::Sender;
28using graph_schedule_sender_attrs_t = typename graph_schedule_sender_t::Attributes;
29
32
38TEST(TEST_CATEGORY(Scheduler), round_trip_property) {
39 const graph_context_t ctx{TEST_EXECUTION_SPACE{}};
40 const graph_scheduler_t sch = ctx.get_scheduler();
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(
50 std::same_as<decltype(stdexec::schedule(std::declval<const graph_scheduler_t&>())), graph_schedule_sender_t>);
51
52 return true;
53}
54static_assert(test_scheduler_schedule());
55
61 static_assert(std::same_as<stdexec::env_of_t<graph_schedule_sender_t>, const graph_schedule_sender_attrs_t&>);
62
63 return true;
64}
65static_assert(test_schedule_sender_attrs());
66
68consteval bool test_scheduler_queries() {
69 static_assert(std::same_as<
70 stdexec::__query_result_t<graph_scheduler_t, stdexec::get_completion_domain_t<stdexec::set_value_t>>,
72 >);
73
74 static_assert(
75 std::same_as<
76 stdexec::__query_result_t<graph_scheduler_t, stdexec::get_completion_scheduler_t<stdexec::set_value_t>>,
78 >);
79
80 return true;
81}
82static_assert(test_scheduler_queries());
83
86 static_assert(std::same_as<
87 stdexec::__query_result_t<
89 stdexec::get_completion_scheduler_t<stdexec::set_value_t>
90 >,
92 >);
93
94 static_assert(std::same_as<
95 stdexec::__query_result_t<
97 stdexec::get_completion_domain_t<stdexec::set_value_t>
98 >,
100 >);
101
102 return true;
103}
105
106} // namespace Tests::GraphImpl
#define TEST_CATEGORY(_name_)
Definition category.hpp:10
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:117
auto get_scheduler() const noexcept -> GraphImpl::Scheduler< Exec >
Definition graph.hpp:126
Scheduler for a Kokkos::Experimental::Graph.
Definition graph.hpp:24