kokkos-execution 0.0.1
Loading...
Searching...
No Matches
check_rcvr_env.hpp
Go to the documentation of this file.
1#ifndef KOKKOS_EXECUTION_TESTS_UTILS_CHECK_RCVR_ENV_HPP
2#define KOKKOS_EXECUTION_TESTS_UTILS_CHECK_RCVR_ENV_HPP
3
5
9
10namespace Tests::Utils {
11
12template <typename ExpectedEnv, typename Sndr>
14 using sender_concept = stdexec::sender_tag;
15
16 Sndr sndr;
17
19
20 template <stdexec::__decays_to<CheckRcvrEnvSender> Self, stdexec::receiver Rcvr>
21 [[nodiscard]]
22 constexpr STDEXEC_EXPLICIT_THIS_BEGIN(
23 auto connect)(this Self&& self, Rcvr rcvr) // NOLINT(cppcoreguidelines-missing-std-forward)
24 noexcept(stdexec::__nothrow_connectable<KOKKOS_EXECUTION_IMPL_MEMBER_CVREF_T(Self, sndr), Rcvr&&>)
25 -> stdexec::connect_result_t<KOKKOS_EXECUTION_IMPL_MEMBER_CVREF_T(Self, sndr), Rcvr&&> {
26 static_assert(std::same_as<ExpectedEnv, stdexec::env_of_t<Rcvr>>);
27 return stdexec::connect(std::forward<Self>(self).sndr, std::move(rcvr));
28 }
29 STDEXEC_EXPLICIT_THIS_END(connect)
30
32};
33
35template <typename ExpectedEnv>
37 [[nodiscard]]
38 constexpr auto operator()() const noexcept {
39 return stdexec::__closure(*this);
40 }
41
42 template <stdexec::sender Sndr>
43 [[nodiscard]]
44 constexpr auto operator()(Sndr&& sndr) const {
45 return CheckRcvrEnvSender<ExpectedEnv, Sndr>{std::forward<Sndr>(sndr)};
46 }
47};
48
49template <typename ExpectedEnv>
51
52} // namespace Tests::Utils
53
54#endif // KOKKOS_EXECUTION_TESTS_UTILS_CHECK_RCVR_ENV_HPP
#define KOKKOS_EXECUTION_IMPL_FORWARDING_ATTRIBUTES_GET_ENV(_type_, _obj_)
#define KOKKOS_EXECUTION_COMPL_SIGS_KEEP(_decayed_self_type_, _sndr_type_)
constexpr check_rcvr_env_t< ExpectedEnv > check_rcvr_env
Check that the receiver environment is of type ExpectedEnv.
constexpr auto operator()(Sndr &&sndr) const
constexpr auto operator()() const noexcept
#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...