kokkos-execution
0.0.1
Toggle main menu visibility
Loading...
Searching...
No Matches
check_node_type.hpp
Go to the documentation of this file.
1
#ifndef KOKKOS_EXECUTION_TESTS_UTILS_CHECK_NODE_TYPE_HPP
2
#define KOKKOS_EXECUTION_TESTS_UTILS_CHECK_NODE_TYPE_HPP
3
4
#include "
kokkos-execution/stdexec.hpp
"
5
6
#include "
kokkos-execution/graph/get_node.hpp
"
7
#include "
kokkos-execution/impl/attributes.hpp
"
8
#include "
kokkos-execution/impl/completion_signatures.hpp
"
9
15
16
namespace
Tests::Utils
{
17
18
template
<
typename
NodeType, stdexec::sender Sndr>
19
struct
CheckNodeTypeSender
;
20
21
template
<
typename
NodeType>
22
struct
check_node_type_t
{
23
[[nodiscard]]
24
constexpr
auto
operator()
() const noexcept {
25
return
stdexec::__closure(*
this
);
26
}
27
28
template
<stdexec::sender Sndr>
29
[[nodiscard]]
30
constexpr
auto
operator()
(Sndr&& sndr)
const
{
31
return
CheckNodeTypeSender<NodeType, Sndr>
{std::forward<Sndr>(sndr)};
32
}
33
};
34
35
template
<
typename
NodeType, stdexec::sender Sndr>
36
struct
CheckNodeTypeSender
{
37
using
sender_concept
= stdexec::sender_tag;
38
39
Sndr
sndr
;
// NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
40
41
KOKKOS_EXECUTION_COMPL_SIGS_KEEP
(
CheckNodeTypeSender
, Sndr)
42
43
template
<stdexec::__decays_to<CheckNodeTypeSender> Self, stdexec::receiver Rcvr>
44
[[nodiscard]]
45
constexpr
STDEXEC_EXPLICIT_THIS_BEGIN(
46
auto
connect
)(
this
Self&& self, Rcvr rcvr)
// NOLINT(cppcoreguidelines-missing-std-forward)
47
noexcept
(stdexec::__nothrow_connectable<
KOKKOS_EXECUTION_IMPL_MEMBER_CVREF_T
(Self,
sndr
), Rcvr&&>)
48
-> stdexec::connect_result_t<
KOKKOS_EXECUTION_IMPL_MEMBER_CVREF_T
(Self,
sndr
), Rcvr&&> {
49
using
op_state_t = stdexec::connect_result_t<
KOKKOS_EXECUTION_IMPL_MEMBER_CVREF_T
(Self,
sndr
), Rcvr&&>;
50
static_assert
(stdexec::__queryable_with<op_state_t, Kokkos::Execution::GraphImpl::get_node_t>);
51
using
node_t = stdexec::__query_result_t<op_state_t, Kokkos::Execution::GraphImpl::get_node_t>;
52
static_assert
(std::same_as<std::remove_cvref_t<node_t>, std::remove_cvref_t<NodeType>>);
53
return
stdexec::connect(std::forward<Self>(self).
sndr
, std::move(rcvr));
54
}
55
STDEXEC_EXPLICIT_THIS_END(
connect
)
56
57
KOKKOS_EXECUTION_IMPL_FORWARDING_ATTRIBUTES_GET_ENV
(Sndr,
sndr
)
58
};
59
61
template <typename NodeType>
62
inline constexpr
check_node_type_t
<NodeType>
check_node_type
{};
63
64
}
// namespace Tests::Utils
65
66
#endif
// KOKKOS_EXECUTION_TESTS_UTILS_CHECK_NODE_TYPE_HPP
completion_signatures.hpp
KOKKOS_EXECUTION_COMPL_SIGS_KEEP
#define KOKKOS_EXECUTION_COMPL_SIGS_KEEP(_decayed_self_type_, _sndr_type_)
Definition
completion_signatures.hpp:43
get_node.hpp
attributes.hpp
KOKKOS_EXECUTION_IMPL_FORWARDING_ATTRIBUTES_GET_ENV
#define KOKKOS_EXECUTION_IMPL_FORWARDING_ATTRIBUTES_GET_ENV(_type_, _obj_)
Definition
attributes.hpp:30
stdexec.hpp
Tests::Utils
Definition
test_sync_wait.cpp:20
Tests::Utils::check_node_type
constexpr check_node_type_t< NodeType > check_node_type
The provided type NodeType is compared without cv type qualifiers during connect.
Definition
check_node_type.hpp:62
Tests::Utils::CheckNodeTypeSender
Definition
check_node_type.hpp:36
Tests::Utils::CheckNodeTypeSender::sndr
Sndr sndr
Definition
check_node_type.hpp:39
Tests::Utils::CheckNodeTypeSender::sender_concept
stdexec::sender_tag sender_concept
Definition
check_node_type.hpp:37
Tests::Utils::CheckNodeTypeSender::connect
constexpr auto connect(this Self &&self, Rcvr rcvr) noexcept(stdexec::__nothrow_connectable< KOKKOS_EXECUTION_IMPL_MEMBER_CVREF_T(Self, sndr), Rcvr && >) -> stdexec::connect_result_t< KOKKOS_EXECUTION_IMPL_MEMBER_CVREF_T(Self, sndr), Rcvr && >
Definition
check_node_type.hpp:46
Tests::Utils::check_node_type_t
Definition
check_node_type.hpp:22
Tests::Utils::check_node_type_t::operator()
constexpr auto operator()() const noexcept
Definition
check_node_type.hpp:24
Tests::Utils::check_node_type_t::operator()
constexpr auto operator()(Sndr &&sndr) const
Definition
check_node_type.hpp:30
KOKKOS_EXECUTION_IMPL_MEMBER_CVREF_T
#define KOKKOS_EXECUTION_IMPL_MEMBER_CVREF_T(_Self_, _member_)
Yields the type of member _member_ as accessed from expression _Self_, preserving the cv and ref qual...
Definition
type_traits.hpp:17
tests
utils
check_node_type.hpp
Generated on
for kokkos-execution by
1.18.0