kokkos-execution
0.0.1
Loading...
Searching...
No Matches
execution_space.hpp
Go to the documentation of this file.
1
#ifndef KOKKOS_EXECUTION_EXECUTION_SPACE_HPP
2
#define KOKKOS_EXECUTION_EXECUTION_SPACE_HPP
3
4
#include "
kokkos-execution/stdexec.hpp
"
5
6
#include "Kokkos_Core.hpp"
7
8
#include "
kokkos-execution/execution_space/bulk.hpp
"
9
#include "
kokkos-execution/execution_space/continues_on.hpp
"
10
#include "
kokkos-execution/execution_space/domain.hpp
"
11
#include "
kokkos-execution/execution_space/get_exec.hpp
"
12
#include "
kokkos-execution/execution_space/parallel_for.hpp
"
13
#include "
kokkos-execution/execution_space/schedule_from.hpp
"
14
#include "
kokkos-execution/execution_space/scoped_region.hpp
"
15
#include "
kokkos-execution/execution_space/sync_wait.hpp
"
16
#include "
kokkos-execution/execution_space/then.hpp
"
17
18
namespace
Kokkos::Execution
{
19
20
namespace
ExecutionSpaceImpl
{
21
22
template
<Kokkos::ExecutionSpace Exec>
23
struct
State
{
24
Exec
exec
;
25
};
26
33
template
<Kokkos::ExecutionSpace Exec>
34
struct
Scheduler
{
36
using
scheduler_concept
= stdexec::scheduler_t;
37
38
using
execution_space
= Exec;
39
40
template
<stdexec::receiver Rcvr>
41
struct
OpState
{
42
using
operation_state_concept
= stdexec::operation_state_t;
43
44
Rcvr
rcvr
;
45
47
void
start
() &
noexcept
{
48
stdexec::set_value(std::move(
rcvr
));
49
}
50
};
51
52
struct
Sender
{
53
using
sender_concept
= stdexec::sender_t;
54
55
using
completion_signatures
= stdexec::completion_signatures<stdexec::set_value_t()>;
56
58
struct
Attributes
{
59
template
<
typename
... Env>
60
[[nodiscard]]
61
constexpr
auto
62
query
(stdexec::get_completion_scheduler_t<stdexec::set_value_t>, Env...) const noexcept ->
Scheduler
{
63
return
{
state
};
64
}
65
66
template
<
typename
... Env>
67
[[nodiscard]]
68
constexpr
auto
69
query
(stdexec::get_completion_domain_t<stdexec::set_value_t>, Env...) const noexcept ->
Domain
{
70
return
{};
71
}
72
73
State<Exec>
*
state
;
74
};
75
76
template
<stdexec::receiver_of<completion_signatures> Rcvr>
77
[[nodiscard]]
78
OpState<Rcvr>
connect
(Rcvr rcvr) &&
noexcept
(std::is_nothrow_move_constructible_v<Rcvr>) {
79
return
{std::move(rcvr)};
80
}
81
82
template
<stdexec::receiver_of<completion_signatures> Rcvr>
83
[[nodiscard]]
84
OpState<Rcvr>
connect
(Rcvr rcvr)
const
&
noexcept
(std::is_nothrow_move_constructible_v<Rcvr>) {
85
return
{std::move(rcvr)};
86
}
87
88
[[nodiscard]]
89
constexpr
auto
get_env
() const noexcept -> const
Attributes
& {
90
return
env
;
91
}
92
93
Attributes
env
;
94
};
95
96
[[nodiscard]]
97
constexpr
auto
schedule
() const noexcept -> Sender {
98
return
{
state
};
99
}
100
101
[[nodiscard]]
102
constexpr
auto
query
(stdexec::get_completion_domain_t<stdexec::set_value_t>)
const
noexcept
->
Domain
{
103
return
{};
104
}
105
106
[[nodiscard]]
107
constexpr
auto
query
(stdexec::get_completion_scheduler_t<stdexec::set_value_t>)
const
noexcept
->
Scheduler
{
108
return
{
state
};
109
}
110
111
[[nodiscard]]
112
friend
bool
operator==
(
const
Scheduler
&,
const
Scheduler
&)
noexcept
=
default
;
113
114
State<Exec>
*
state
;
115
};
116
117
}
// namespace ExecutionSpaceImpl
118
126
template
<Kokkos::ExecutionSpace Exec>
127
struct
ExecutionSpaceContext
{
128
using
state_t
=
ExecutionSpaceImpl::State<Exec>
;
129
130
state_t
m_state
;
131
132
explicit
ExecutionSpaceContext
(Exec exec)
// NOLINT(performance-unnecessary-value-param)
133
:
m_state
{std::move(exec)} {
134
}
135
136
auto
get_scheduler
() const noexcept ->
ExecutionSpaceImpl
::Scheduler<Exec> {
137
return
{
const_cast<
state_t
*
>
(&
m_state
)};
138
}
139
};
140
141
}
// namespace Kokkos::Execution
142
143
#endif
// KOKKOS_EXECUTION_EXECUTION_SPACE_HPP
bulk.hpp
continues_on.hpp
domain.hpp
parallel_for.hpp
sync_wait.hpp
get_exec.hpp
stdexec.hpp
Kokkos::Execution::ExecutionSpaceImpl
Definition
execution_space.hpp:20
Kokkos::Execution
Definition
execution_space.hpp:18
schedule_from.hpp
scoped_region.hpp
Kokkos::Execution::ExecutionSpaceContext::ExecutionSpaceContext
ExecutionSpaceContext(Exec exec)
Definition
execution_space.hpp:132
Kokkos::Execution::ExecutionSpaceContext::get_scheduler
auto get_scheduler() const noexcept -> ExecutionSpaceImpl::Scheduler< Exec >
Definition
execution_space.hpp:136
Kokkos::Execution::ExecutionSpaceContext< TEST_EXECUTION_SPACE >::m_state
state_t m_state
Definition
execution_space.hpp:130
Kokkos::Execution::ExecutionSpaceContext::state_t
ExecutionSpaceImpl::State< Exec > state_t
Definition
execution_space.hpp:128
Kokkos::Execution::ExecutionSpaceImpl::Domain
Definition
domain.hpp:14
Kokkos::Execution::ExecutionSpaceImpl::Scheduler::OpState
Definition
execution_space.hpp:41
Kokkos::Execution::ExecutionSpaceImpl::Scheduler::OpState::rcvr
Rcvr rcvr
Definition
execution_space.hpp:44
Kokkos::Execution::ExecutionSpaceImpl::Scheduler::OpState::start
void start() &noexcept
Definition
execution_space.hpp:47
Kokkos::Execution::ExecutionSpaceImpl::Scheduler::OpState::operation_state_concept
stdexec::operation_state_t operation_state_concept
Definition
execution_space.hpp:42
Kokkos::Execution::ExecutionSpaceImpl::Scheduler::Sender::Attributes
See https://github.com/NVIDIA/stdexec/blob/5076be2b35de2e78330201b888d82c81b8cb428b/include/nvexec/st...
Definition
execution_space.hpp:58
Kokkos::Execution::ExecutionSpaceImpl::Scheduler::Sender::Attributes::query
constexpr auto query(stdexec::get_completion_domain_t< stdexec::set_value_t >, Env...) const noexcept -> Domain
Definition
execution_space.hpp:69
Kokkos::Execution::ExecutionSpaceImpl::Scheduler::Sender::Attributes::state
State< Exec > * state
Definition
execution_space.hpp:73
Kokkos::Execution::ExecutionSpaceImpl::Scheduler::Sender::Attributes::query
constexpr auto query(stdexec::get_completion_scheduler_t< stdexec::set_value_t >, Env...) const noexcept -> Scheduler
Definition
execution_space.hpp:62
Kokkos::Execution::ExecutionSpaceImpl::Scheduler::Sender
Definition
execution_space.hpp:52
Kokkos::Execution::ExecutionSpaceImpl::Scheduler::Sender::connect
OpState< Rcvr > connect(Rcvr rcvr) &&noexcept(std::is_nothrow_move_constructible_v< Rcvr >)
Definition
execution_space.hpp:78
Kokkos::Execution::ExecutionSpaceImpl::Scheduler::Sender::connect
OpState< Rcvr > connect(Rcvr rcvr) const &noexcept(std::is_nothrow_move_constructible_v< Rcvr >)
Definition
execution_space.hpp:84
Kokkos::Execution::ExecutionSpaceImpl::Scheduler::Sender::env
Attributes env
Definition
execution_space.hpp:93
Kokkos::Execution::ExecutionSpaceImpl::Scheduler::Sender::get_env
constexpr auto get_env() const noexcept -> const Attributes &
Definition
execution_space.hpp:89
Kokkos::Execution::ExecutionSpaceImpl::Scheduler::Sender::sender_concept
stdexec::sender_t sender_concept
Definition
execution_space.hpp:53
Kokkos::Execution::ExecutionSpaceImpl::Scheduler::Sender::completion_signatures
stdexec::completion_signatures< stdexec::set_value_t()> completion_signatures
Definition
execution_space.hpp:55
Kokkos::Execution::ExecutionSpaceImpl::Scheduler
Scheduler for a Kokkos execution space.
Definition
execution_space.hpp:34
Kokkos::Execution::ExecutionSpaceImpl::Scheduler< TEST_EXECUTION_SPACE >::state
State< Exec > * state
Definition
execution_space.hpp:114
Kokkos::Execution::ExecutionSpaceImpl::Scheduler::scheduler_concept
stdexec::scheduler_t scheduler_concept
As per https://eel.is/c++draft/exec.sched#1.
Definition
execution_space.hpp:36
Kokkos::Execution::ExecutionSpaceImpl::Scheduler::operator==
friend bool operator==(const Scheduler &, const Scheduler &) noexcept=default
Kokkos::Execution::ExecutionSpaceImpl::Scheduler::schedule
constexpr auto schedule() const noexcept -> Sender
Definition
execution_space.hpp:97
Kokkos::Execution::ExecutionSpaceImpl::Scheduler::query
constexpr auto query(stdexec::get_completion_domain_t< stdexec::set_value_t >) const noexcept -> Domain
Definition
execution_space.hpp:102
Kokkos::Execution::ExecutionSpaceImpl::Scheduler::query
constexpr auto query(stdexec::get_completion_scheduler_t< stdexec::set_value_t >) const noexcept -> Scheduler
Definition
execution_space.hpp:107
Kokkos::Execution::ExecutionSpaceImpl::Scheduler::execution_space
Exec execution_space
Definition
execution_space.hpp:38
Kokkos::Execution::ExecutionSpaceImpl::State
Definition
execution_space.hpp:23
Kokkos::Execution::ExecutionSpaceImpl::State::exec
Exec exec
Definition
execution_space.hpp:24
then.hpp
kokkos-execution
execution_space.hpp
Generated on
for kokkos-execution by
1.15.0