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/execution_space_context.hpp
"
5
19
20
namespace
Tests::ExecutionSpaceImpl
{
21
22
using
execution_space_context_t
=
Kokkos::Execution::ExecutionSpaceContext<TEST_EXECUTION_SPACE>
;
23
using
execution_space_scheduler_t
=
Kokkos::Execution::ExecutionSpaceImpl::Scheduler<TEST_EXECUTION_SPACE>
;
24
using
execution_space_schedule_sender_t
=
typename
execution_space_scheduler_t::Sender;
25
using
execution_space_schedule_sender_attrs_t
=
typename
execution_space_schedule_sender_t::Attributes;
26
28
static_assert
(
Tests::Utils::check_scheduler<execution_space_scheduler_t>
());
29
35
TEST(Scheduler, round_trip_property) {
36
const
execution_space_context_t
ctx{TEST_EXECUTION_SPACE{}};
37
const
execution_space_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
(std::same_as<
47
decltype
(stdexec::schedule(std::declval<const execution_space_scheduler_t&>())),
48
execution_space_schedule_sender_t
49
>);
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<
61
stdexec::env_of_t<execution_space_schedule_sender_t>,
62
const
execution_space_schedule_sender_attrs_t
&
63
>);
64
65
return
true
;
66
}
67
static_assert
(
test_schedule_sender_attrs
());
68
70
consteval
bool
test_scheduler_queries
() {
71
static_assert
(std::same_as<
72
stdexec::__query_result_t<
73
execution_space_scheduler_t
,
74
stdexec::get_completion_domain_t<stdexec::set_value_t>
75
>,
76
Kokkos::Execution::ExecutionSpaceImpl::Domain
77
>);
78
79
static_assert
(std::same_as<
80
stdexec::__query_result_t<
81
execution_space_scheduler_t
,
82
stdexec::get_completion_scheduler_t<stdexec::set_value_t>
83
>,
84
execution_space_scheduler_t
85
>);
86
87
return
true
;
88
}
89
static_assert
(
test_scheduler_queries
());
90
92
consteval
bool
test_schedule_sender_attrs_queries
() {
93
static_assert
(std::same_as<
94
stdexec::__query_result_t<
95
execution_space_schedule_sender_attrs_t
,
96
stdexec::get_completion_scheduler_t<stdexec::set_value_t>
97
>,
98
execution_space_scheduler_t
99
>);
100
101
static_assert
(std::same_as<
102
stdexec::__query_result_t<
103
execution_space_schedule_sender_attrs_t
,
104
stdexec::get_completion_domain_t<stdexec::set_value_t>
105
>,
106
Kokkos::Execution::ExecutionSpaceImpl::Domain
107
>);
108
109
return
true
;
110
}
111
static_assert
(
test_schedule_sender_attrs_queries
());
112
113
}
// namespace Tests::ExecutionSpaceImpl
check_scheduler.hpp
execution_space_context.hpp
Tests::ExecutionSpaceImpl
Definition
test_any_sender.cpp:33
Tests::ExecutionSpaceImpl::test_schedule_sender_attrs_queries
consteval bool test_schedule_sender_attrs_queries()
Definition
test_scheduler.cpp:92
Tests::ExecutionSpaceImpl::test_schedule_sender_attrs
consteval bool test_schedule_sender_attrs()
Definition
test_scheduler.cpp:59
Tests::ExecutionSpaceImpl::execution_space_schedule_sender_t
typename execution_space_scheduler_t::Sender execution_space_schedule_sender_t
Definition
test_scheduler.cpp:24
Tests::ExecutionSpaceImpl::execution_space_scheduler_t
Kokkos::Execution::ExecutionSpaceImpl::Scheduler< TEST_EXECUTION_SPACE > execution_space_scheduler_t
Definition
test_scheduler.cpp:23
Tests::ExecutionSpaceImpl::execution_space_context_t
Kokkos::Execution::ExecutionSpaceContext< TEST_EXECUTION_SPACE > execution_space_context_t
Definition
test_scheduler.cpp:22
Tests::ExecutionSpaceImpl::test_scheduler_queries
consteval bool test_scheduler_queries()
Definition
test_scheduler.cpp:70
Tests::ExecutionSpaceImpl::execution_space_schedule_sender_attrs_t
typename execution_space_schedule_sender_t::Attributes execution_space_schedule_sender_attrs_t
Definition
test_scheduler.cpp:25
Tests::ExecutionSpaceImpl::test_scheduler_schedule
consteval bool test_scheduler_schedule()
Definition
test_scheduler.cpp:45
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::ExecutionSpaceContext
Execution context using a Kokkos execution space under the hood.
Definition
execution_space.hpp:127
Kokkos::Execution::ExecutionSpaceContext::get_scheduler
auto get_scheduler() const noexcept -> ExecutionSpaceImpl::Scheduler< Exec >
Definition
execution_space.hpp:136
Kokkos::Execution::ExecutionSpaceImpl::Domain
Definition
domain.hpp:14
Kokkos::Execution::ExecutionSpaceImpl::Scheduler
Scheduler for a Kokkos execution space.
Definition
execution_space.hpp:34
tests
execution_space
test_scheduler.cpp
Generated on
for kokkos-execution by
1.15.0