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/execution_space.hpp
"
4
5
#include "
tests/utils/category.hpp
"
6
#include "
tests/utils/check_scheduler.hpp
"
7
#include "
tests/utils/execution_space_context.hpp
"
8
22
23
namespace
Tests::ExecutionSpaceImpl
{
24
25
using
execution_space_context_t
=
Kokkos::Execution::ExecutionSpaceContext<TEST_EXECUTION_SPACE>
;
26
using
execution_space_scheduler_t
=
Kokkos::Execution::ExecutionSpaceImpl::Scheduler<TEST_EXECUTION_SPACE>
;
27
using
execution_space_schedule_sender_t
=
typename
execution_space_scheduler_t::Sender;
28
using
execution_space_schedule_sender_attrs_t
=
typename
execution_space_schedule_sender_t::Attributes;
29
31
static_assert
(
Tests::Utils::check_scheduler<execution_space_scheduler_t>
());
32
38
TEST(
TEST_CATEGORY
(Scheduler), round_trip_property) {
39
const
execution_space_context_t
ctx{TEST_EXECUTION_SPACE{}};
40
const
execution_space_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
(std::same_as<
50
decltype
(stdexec::schedule(std::declval<const execution_space_scheduler_t&>())),
51
execution_space_schedule_sender_t
52
>);
53
54
return
true
;
55
}
56
static_assert
(
test_scheduler_schedule
());
57
62
consteval
bool
test_schedule_sender_attrs
() {
63
static_assert
(std::same_as<
64
stdexec::env_of_t<execution_space_schedule_sender_t>,
65
const
execution_space_schedule_sender_attrs_t
&
66
>);
67
68
return
true
;
69
}
70
static_assert
(
test_schedule_sender_attrs
());
71
73
consteval
bool
test_scheduler_queries
() {
74
static_assert
(std::same_as<
75
stdexec::__query_result_t<
76
execution_space_scheduler_t
,
77
stdexec::get_completion_domain_t<stdexec::set_value_t>
78
>,
79
Kokkos::Execution::ExecutionSpaceImpl::Domain
80
>);
81
82
static_assert
(std::same_as<
83
stdexec::__query_result_t<
84
execution_space_scheduler_t
,
85
stdexec::get_completion_scheduler_t<stdexec::set_value_t>
86
>,
87
execution_space_scheduler_t
88
>);
89
90
return
true
;
91
}
92
static_assert
(
test_scheduler_queries
());
93
95
consteval
bool
test_schedule_sender_attrs_queries
() {
96
static_assert
(std::same_as<
97
stdexec::__query_result_t<
98
execution_space_schedule_sender_attrs_t
,
99
stdexec::get_completion_scheduler_t<stdexec::set_value_t>
100
>,
101
execution_space_scheduler_t
102
>);
103
104
static_assert
(std::same_as<
105
stdexec::__query_result_t<
106
execution_space_schedule_sender_attrs_t
,
107
stdexec::get_completion_domain_t<stdexec::set_value_t>
108
>,
109
Kokkos::Execution::ExecutionSpaceImpl::Domain
110
>);
111
112
return
true
;
113
}
114
static_assert
(
test_schedule_sender_attrs_queries
());
115
116
}
// namespace Tests::ExecutionSpaceImpl
category.hpp
TEST_CATEGORY
#define TEST_CATEGORY(_name_)
Definition
category.hpp:10
check_scheduler.hpp
execution_space.hpp
execution_space_context.hpp
Tests::ExecutionSpaceImpl
Definition
test_any_sender.cpp:39
Tests::ExecutionSpaceImpl::test_schedule_sender_attrs_queries
consteval bool test_schedule_sender_attrs_queries()
Definition
test_scheduler.cpp:95
Tests::ExecutionSpaceImpl::test_schedule_sender_attrs
consteval bool test_schedule_sender_attrs()
Definition
test_scheduler.cpp:62
Tests::ExecutionSpaceImpl::execution_space_schedule_sender_t
typename execution_space_scheduler_t::Sender execution_space_schedule_sender_t
Definition
test_scheduler.cpp:27
Tests::ExecutionSpaceImpl::execution_space_scheduler_t
Kokkos::Execution::ExecutionSpaceImpl::Scheduler< TEST_EXECUTION_SPACE > execution_space_scheduler_t
Definition
test_scheduler.cpp:26
Tests::ExecutionSpaceImpl::execution_space_context_t
Kokkos::Execution::ExecutionSpaceContext< TEST_EXECUTION_SPACE > execution_space_context_t
Definition
test_scheduler.cpp:25
Tests::ExecutionSpaceImpl::test_scheduler_queries
consteval bool test_scheduler_queries()
Definition
test_scheduler.cpp:73
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:28
Tests::ExecutionSpaceImpl::test_scheduler_schedule
consteval bool test_scheduler_schedule()
Definition
test_scheduler.cpp:48
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:124
Kokkos::Execution::ExecutionSpaceContext::get_scheduler
auto get_scheduler() const noexcept -> ExecutionSpaceImpl::Scheduler< Exec >
Definition
execution_space.hpp:133
Kokkos::Execution::ExecutionSpaceImpl::Domain
Definition
domain.hpp:13
Kokkos::Execution::ExecutionSpaceImpl::Scheduler
Scheduler for a Kokkos execution space.
Definition
execution_space.hpp:31
tests
execution_space
test_scheduler.cpp
Generated on
for kokkos-execution by
1.15.0