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 "
kokkos-execution/graph.hpp
"
4
5
#include "
tests/utils/check_scheduler.hpp
"
6
#include "
tests/utils/graph_context.hpp
"
7
21
22
namespace
Tests::GraphImpl
{
23
24
using
graph_context_t
=
Kokkos::Execution::GraphContext<TEST_EXECUTION_SPACE>
;
25
using
graph_scheduler_t
=
Kokkos::Execution::GraphImpl::Scheduler<TEST_EXECUTION_SPACE>
;
26
using
graph_schedule_sender_t
=
typename
graph_scheduler_t::Sender;
27
using
graph_schedule_sender_attrs_t
=
typename
graph_schedule_sender_t::Attributes;
28
30
static_assert
(
Tests::Utils::check_scheduler<graph_scheduler_t>
());
31
37
TEST(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
47
consteval
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
}
53
static_assert
(
test_scheduler_schedule
());
54
59
consteval
bool
test_schedule_sender_attrs
() {
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
}
64
static_assert
(
test_schedule_sender_attrs
());
65
67
consteval
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>>,
70
Kokkos::Execution::GraphImpl::Domain
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>>,
76
graph_scheduler_t
77
>);
78
79
return
true
;
80
}
81
static_assert
(
test_scheduler_queries
());
82
84
consteval
bool
test_schedule_sender_attrs_queries
() {
85
static_assert
(std::same_as<
86
stdexec::__query_result_t<
87
graph_schedule_sender_attrs_t
,
88
stdexec::get_completion_scheduler_t<stdexec::set_value_t>
89
>,
90
graph_scheduler_t
91
>);
92
93
static_assert
(std::same_as<
94
stdexec::__query_result_t<
95
graph_schedule_sender_attrs_t
,
96
stdexec::get_completion_domain_t<stdexec::set_value_t>
97
>,
98
Kokkos::Execution::GraphImpl::Domain
99
>);
100
101
return
true
;
102
}
103
static_assert
(
test_schedule_sender_attrs_queries
());
104
105
}
// namespace Tests::GraphImpl
check_scheduler.hpp
graph.hpp
graph_context.hpp
Tests::GraphImpl
Definition
events.hpp:8
Tests::GraphImpl::test_schedule_sender_attrs
consteval bool test_schedule_sender_attrs()
Definition
test_scheduler.cpp:59
Tests::GraphImpl::test_schedule_sender_attrs_queries
consteval bool test_schedule_sender_attrs_queries()
Definition
test_scheduler.cpp:84
Tests::GraphImpl::graph_schedule_sender_t
typename graph_scheduler_t::Sender graph_schedule_sender_t
Definition
test_scheduler.cpp:26
Tests::GraphImpl::test_scheduler_schedule
consteval bool test_scheduler_schedule()
Definition
test_scheduler.cpp:47
Tests::GraphImpl::graph_scheduler_t
Kokkos::Execution::GraphImpl::Scheduler< TEST_EXECUTION_SPACE > graph_scheduler_t
Definition
test_scheduler.cpp:25
Tests::GraphImpl::test_scheduler_queries
consteval bool test_scheduler_queries()
Definition
test_scheduler.cpp:67
Tests::GraphImpl::graph_context_t
Kokkos::Execution::GraphContext< TEST_EXECUTION_SPACE > graph_context_t
Definition
test_scheduler.cpp:24
Tests::GraphImpl::graph_schedule_sender_attrs_t
typename graph_schedule_sender_t::Attributes graph_schedule_sender_attrs_t
Definition
test_scheduler.cpp:27
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:13
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