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
3
#include "
tests/utils/check_scheduler.hpp
"
4
#include "
tests/utils/graph_context.hpp
"
5
19
20
namespace
Tests::GraphImpl
{
21
22
using
graph_context_t
=
Kokkos::Execution::GraphContext<TEST_EXECUTION_SPACE>
;
23
using
graph_scheduler_t
=
Kokkos::Execution::GraphImpl::Scheduler<TEST_EXECUTION_SPACE>
;
24
using
graph_schedule_sender_t
=
typename
graph_scheduler_t::Sender;
25
using
graph_schedule_sender_attrs_t
=
typename
graph_schedule_sender_t::Attributes;
26
28
static_assert
(
Tests::Utils::check_scheduler<graph_scheduler_t>
());
29
35
TEST(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
45
consteval
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
}
51
static_assert
(
test_scheduler_schedule
());
52
57
consteval
bool
test_schedule_sender_attrs
() {
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
}
62
static_assert
(
test_schedule_sender_attrs
());
63
65
consteval
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>>,
68
Kokkos::Execution::GraphImpl::Domain
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>>,
74
graph_scheduler_t
75
>);
76
77
return
true
;
78
}
79
static_assert
(
test_scheduler_queries
());
80
82
consteval
bool
test_schedule_sender_attrs_queries
() {
83
static_assert
(std::same_as<
84
stdexec::__query_result_t<
85
graph_schedule_sender_attrs_t
,
86
stdexec::get_completion_scheduler_t<stdexec::set_value_t>
87
>,
88
graph_scheduler_t
89
>);
90
91
static_assert
(std::same_as<
92
stdexec::__query_result_t<
93
graph_schedule_sender_attrs_t
,
94
stdexec::get_completion_domain_t<stdexec::set_value_t>
95
>,
96
Kokkos::Execution::GraphImpl::Domain
97
>);
98
99
return
true
;
100
}
101
static_assert
(
test_schedule_sender_attrs_queries
());
102
103
}
// namespace Tests::GraphImpl
check_scheduler.hpp
graph_context.hpp
Tests::GraphImpl
Definition
test_scheduler.cpp:20
Tests::GraphImpl::test_schedule_sender_attrs
consteval bool test_schedule_sender_attrs()
Definition
test_scheduler.cpp:57
Tests::GraphImpl::test_schedule_sender_attrs_queries
consteval bool test_schedule_sender_attrs_queries()
Definition
test_scheduler.cpp:82
Tests::GraphImpl::graph_schedule_sender_t
typename graph_scheduler_t::Sender graph_schedule_sender_t
Definition
test_scheduler.cpp:24
Tests::GraphImpl::test_scheduler_schedule
consteval bool test_scheduler_schedule()
Definition
test_scheduler.cpp:45
Tests::GraphImpl::graph_scheduler_t
Kokkos::Execution::GraphImpl::Scheduler< TEST_EXECUTION_SPACE > graph_scheduler_t
Definition
test_scheduler.cpp:23
Tests::GraphImpl::test_scheduler_queries
consteval bool test_scheduler_queries()
Definition
test_scheduler.cpp:65
Tests::GraphImpl::graph_context_t
Kokkos::Execution::GraphContext< TEST_EXECUTION_SPACE > graph_context_t
Definition
test_scheduler.cpp:22
Tests::GraphImpl::graph_schedule_sender_attrs_t
typename graph_schedule_sender_t::Attributes graph_schedule_sender_attrs_t
Definition
test_scheduler.cpp:25
Tests::Utils::check_scheduler
consteval bool check_scheduler()
Check that the given type models the stdexec::scheduler concept.
Definition
check_scheduler.hpp:10
Kokkos::Execution::GraphContext
Execution context using Kokkos::Experimental::Graph under the hood.
Definition
graph.hpp:108
Kokkos::Execution::GraphContext::get_scheduler
auto get_scheduler() const noexcept -> GraphImpl::Scheduler< Exec >
Definition
graph.hpp:117
Kokkos::Execution::GraphImpl::Domain
Definition
domain.hpp:8
Kokkos::Execution::GraphImpl::Scheduler
Scheduler for a Kokkos::Experimental::Graph.
Definition
graph.hpp:21
tests
graph
test_scheduler.cpp
Generated on
for kokkos-execution by
1.15.0