kokkos-execution
0.0.1
Toggle main menu visibility
Loading...
Searching...
No Matches
stopped.hpp
Go to the documentation of this file.
1
#ifndef KOKKOS_EXECUTION_TESTS_UTILS_SCHEDULERS_STOPPED_HPP
2
#define KOKKOS_EXECUTION_TESTS_UTILS_SCHEDULERS_STOPPED_HPP
3
4
#include "
kokkos-execution/stdexec.hpp
"
5
6
#include "
kokkos-execution/impl/immovable.hpp
"
7
#include "
kokkos-execution/impl/macros.hpp
"
8
9
#include "
tests/utils/schedulers/attributes.hpp
"
10
11
namespace
Tests::Utils::Schedulers
{
22
struct
Stopped
{
23
public
:
24
using
scheduler_concept
= stdexec::scheduler_tag;
25
26
private
:
27
struct
Sender
;
28
29
public
:
30
[[nodiscard]]
31
constexpr
auto
schedule
() const noexcept ->
Sender
{
32
return
{};
33
}
34
35
template
<stdexec::__one_of<stdexec::set_value_t, stdexec::set_stopped_t> Tag>
36
[[nodiscard]]
37
constexpr
auto
query
(stdexec::get_completion_scheduler_t<Tag>)
const
noexcept
->
Stopped
{
38
return
{};
39
}
40
41
[[nodiscard]]
42
friend
bool
operator==
(
const
Stopped
&,
const
Stopped
&)
noexcept
=
default
;
43
44
private
:
45
template
<stdexec::receiver Rcvr>
46
struct
OpState
:
Kokkos::Execution::Impl::Immovable
{
47
void
start
() &
noexcept
{
48
stdexec::set_stopped(std::move(
rcvr
));
49
}
50
51
Rcvr
rcvr
;
52
};
53
54
struct
Sender
{
55
using
sender_concept
= stdexec::sender_tag;
56
57
using
completion_signatures
= stdexec::completion_signatures<stdexec::set_value_t(), stdexec::set_stopped_t()>;
58
59
template
<stdexec::receiver_of<completion_signatures> Rcvr>
60
constexpr
auto
connect
(Rcvr rcvr) &&
KOKKOS_EXECUTION_RETURNS_BRACED
(
OpState<Rcvr>
, {}, std::move(rcvr))
61
62
[[nodiscard]]
63
constexpr
auto
get_env
()
const
noexcept
->
Attributes<Stopped, stdexec::set_value_t, stdexec::set_stopped_t>
{
64
return
{};
65
}
66
};
67
};
68
69
}
// namespace Tests::Utils::Schedulers
70
71
#endif
// KOKKOS_EXECUTION_TESTS_UTILS_SCHEDULERS_STOPPED_HPP
immovable.hpp
stdexec.hpp
macros.hpp
KOKKOS_EXECUTION_RETURNS_BRACED
#define KOKKOS_EXECUTION_RETURNS_BRACED(_type_,...)
Define a function by returning a list-initialized object of an explicit type.
Definition
macros.hpp:23
Tests::Utils::Schedulers
Definition
attributes.hpp:6
Kokkos::Execution::Impl::Immovable
Immovable type.
Definition
immovable.hpp:19
Tests::Utils::Schedulers::Attributes
Inspired by https://github.com/NVIDIA/stdexec/blob/2184dd714f82df1e00d39961817be97f31c02744/test/test...
Definition
attributes.hpp:10
Tests::Utils::Schedulers::Stopped::OpState
Definition
stopped.hpp:46
Tests::Utils::Schedulers::Stopped::OpState::rcvr
Rcvr rcvr
Definition
stopped.hpp:51
Tests::Utils::Schedulers::Stopped::OpState::start
void start() &noexcept
Definition
stopped.hpp:47
Tests::Utils::Schedulers::Stopped::Sender
Definition
stopped.hpp:54
Tests::Utils::Schedulers::Stopped::Sender::get_env
constexpr auto get_env() const noexcept -> Attributes< Stopped, stdexec::set_value_t, stdexec::set_stopped_t >
Definition
stopped.hpp:63
Tests::Utils::Schedulers::Stopped::Sender::sender_concept
stdexec::sender_tag sender_concept
Definition
stopped.hpp:55
Tests::Utils::Schedulers::Stopped::Sender::completion_signatures
stdexec::completion_signatures< stdexec::set_value_t(), stdexec::set_stopped_t()> completion_signatures
Definition
stopped.hpp:57
Tests::Utils::Schedulers::Stopped::Sender::connect
constexpr auto connect(Rcvr rcvr) &&noexcept(noexcept(OpState< Rcvr >{{}, std::move(rcvr)})) -> OpState< Rcvr >
Definition
stopped.hpp:60
Tests::Utils::Schedulers::Stopped
Scheduler that returns a sender that always completes on the stop channel.
Definition
stopped.hpp:22
Tests::Utils::Schedulers::Stopped::scheduler_concept
stdexec::scheduler_tag scheduler_concept
Definition
stopped.hpp:24
Tests::Utils::Schedulers::Stopped::operator==
friend bool operator==(const Stopped &, const Stopped &) noexcept=default
Tests::Utils::Schedulers::Stopped::schedule
constexpr auto schedule() const noexcept -> Sender
Definition
stopped.hpp:31
Tests::Utils::Schedulers::Stopped::query
constexpr auto query(stdexec::get_completion_scheduler_t< Tag >) const noexcept -> Stopped
Definition
stopped.hpp:37
attributes.hpp
tests
utils
schedulers
stopped.hpp
Generated on
for kokkos-execution by
1.18.0