kokkos-execution 0.0.1
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
5
9
15
16namespace Tests::Utils {
17
18template <typename NodeType, stdexec::sender Sndr>
20
21template <typename NodeType>
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
35template <typename NodeType, stdexec::sender Sndr>
37 using sender_concept = stdexec::sender_tag;
38
39 Sndr sndr; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members)
40
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
58};
59
61template <typename NodeType>
62inline 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
#define KOKKOS_EXECUTION_COMPL_SIGS_KEEP(_decayed_self_type_, _sndr_type_)
#define KOKKOS_EXECUTION_IMPL_FORWARDING_ATTRIBUTES_GET_ENV(_type_, _obj_)
constexpr check_node_type_t< NodeType > check_node_type
The provided type NodeType is compared without cv type qualifiers during 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 && >
constexpr auto operator()() const noexcept
constexpr auto operator()(Sndr &&sndr) const
#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...