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/category.hpp
"
6
#include "
tests/utils/check_scheduler.hpp
"
7
#include "
tests/utils/graph_context.hpp
"
8
22
23
namespace
Tests::GraphImpl
{
24
25
using
graph_context_t
=
Kokkos::Execution::GraphContext<TEST_EXECUTION_SPACE>
;
26
using
graph_scheduler_t
=
Kokkos::Execution::GraphImpl::Scheduler<TEST_EXECUTION_SPACE>
;
27
using
graph_schedule_sender_t
=
typename
graph_scheduler_t::Sender;
28
using
graph_schedule_sender_attrs_t
=
typename
graph_schedule_sender_t::Attributes;
29
31
static_assert
(
Tests::Utils::check_scheduler<graph_scheduler_t>
());
32
38
TEST(
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
48
consteval
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
}
54
static_assert
(
test_scheduler_schedule
());
55
60
consteval
bool
test_schedule_sender_attrs
() {
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
}
65
static_assert
(
test_schedule_sender_attrs
());
66
68
consteval
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>>,
71
Kokkos::Execution::GraphImpl::Domain
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>>,
77
graph_scheduler_t
78
>);
79
80
return
true
;
81
}
82
static_assert
(
test_scheduler_queries
());
83
85
consteval
bool
test_schedule_sender_attrs_queries
() {
86
static_assert
(std::same_as<
87
stdexec::__query_result_t<
88
graph_schedule_sender_attrs_t
,
89
stdexec::get_completion_scheduler_t<stdexec::set_value_t>
90
>,
91
graph_scheduler_t
92
>);
93
94
static_assert
(std::same_as<
95
stdexec::__query_result_t<
96
graph_schedule_sender_attrs_t
,
97
stdexec::get_completion_domain_t<stdexec::set_value_t>
98
>,
99
Kokkos::Execution::GraphImpl::Domain
100
>);
101
102
return
true
;
103
}
104
static_assert
(
test_schedule_sender_attrs_queries
());
105
106
}
// namespace Tests::GraphImpl
category.hpp
TEST_CATEGORY
#define TEST_CATEGORY(_name_)
Definition
category.hpp:10
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:60
Tests::GraphImpl::test_schedule_sender_attrs_queries
consteval bool test_schedule_sender_attrs_queries()
Definition
test_scheduler.cpp:85
Tests::GraphImpl::graph_schedule_sender_t
typename graph_scheduler_t::Sender graph_schedule_sender_t
Definition
test_scheduler.cpp:27
Tests::GraphImpl::test_scheduler_schedule
consteval bool test_scheduler_schedule()
Definition
test_scheduler.cpp:48
Tests::GraphImpl::graph_scheduler_t
Kokkos::Execution::GraphImpl::Scheduler< TEST_EXECUTION_SPACE > graph_scheduler_t
Definition
test_scheduler.cpp:26
Tests::GraphImpl::test_scheduler_queries
consteval bool test_scheduler_queries()
Definition
test_scheduler.cpp:68
Tests::GraphImpl::graph_context_t
Kokkos::Execution::GraphContext< TEST_EXECUTION_SPACE > graph_context_t
Definition
test_scheduler.cpp:25
Tests::GraphImpl::graph_schedule_sender_attrs_t
typename graph_schedule_sender_t::Attributes graph_schedule_sender_attrs_t
Definition
test_scheduler.cpp:28
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:117
Kokkos::Execution::GraphContext::get_scheduler
auto get_scheduler() const noexcept -> GraphImpl::Scheduler< Exec >
Definition
graph.hpp:126
Kokkos::Execution::GraphImpl::Domain
Definition
domain.hpp:13
Kokkos::Execution::GraphImpl::Scheduler
Scheduler for a Kokkos::Experimental::Graph.
Definition
graph.hpp:24
tests
graph
test_scheduler.cpp
Generated on
for kokkos-execution by
1.15.0