kokkos-execution
0.0.1
Toggle main menu visibility
Loading...
Searching...
No Matches
make_op_state.hpp
Go to the documentation of this file.
1
#ifndef KOKKOS_EXECUTION_IMPL_MAKE_OP_STATE_HPP
2
#define KOKKOS_EXECUTION_IMPL_MAKE_OP_STATE_HPP
3
4
#include "
kokkos-execution/stdexec.hpp
"
5
6
#include "
kokkos-execution/impl/sender_concepts.hpp
"
7
8
namespace
Kokkos::Execution::Impl
{
9
10
template
<
typename
DomainType,
template
<
typename
...>
typename
OpStateType>
11
struct
MakeOpState
{
12
13
template
<
typename
Sndr,
typename
Rcvr,
typename
... Clsrs>
14
struct
Huddle
{
15
using
type
= OpStateType<Sndr, Rcvr, Clsrs...>;
16
17
// NOLINTNEXTLINE(cppcoreguidelines-rvalue-reference-param-not-moved)
18
constexpr
auto
operator()
(Sndr&& sndr, Rcvr rcvr, Clsrs... clsrs)
const
19
noexcept
(std::is_nothrow_constructible_v<
type
, Sndr&&, Rcvr&&, Clsrs&&...>) ->
type
{
20
return
type
(std::forward<Sndr>(sndr), std::move(rcvr), std::move(clsrs)...);
21
}
22
};
23
24
template
<
Impl::dispatching_sender
Sndr,
typename
Rcvr,
typename
... Clsrs>
25
struct
Huddle
<Sndr, Rcvr, Clsrs...> {
26
using
child_of_sndr_t
= stdexec::__child_of<Sndr>;
27
using
clsr_of_sndr_t
=
typename
stdexec::transform_sender_result_t<Sndr, stdexec::env_of_t<Rcvr>>::closure_t;
28
29
using
huddle_fn_t
=
Huddle
<
child_of_sndr_t
, Rcvr,
clsr_of_sndr_t
, Clsrs...>;
30
using
type
=
typename
huddle_fn_t::type
;
31
32
static
constexpr
bool
sndr_has_nothrow_transform_sender
= stdexec::__detail::__has_nothrow_transform_sender<
33
DomainType,
34
stdexec::set_value_t,
35
Sndr&&,
36
stdexec::env_of_t<Rcvr>
37
>;
38
39
static
constexpr
bool
is_nothrow_huddle
=
40
std::is_nothrow_invocable_v<
huddle_fn_t
,
child_of_sndr_t
&&, Rcvr&&,
clsr_of_sndr_t
&&, Clsrs&&...>;
41
48
// NOLINTNEXTLINE(cppcoreguidelines-rvalue-reference-param-not-moved)
49
constexpr
auto
operator()
(Sndr&& sndr, Rcvr&& rcvr, Clsrs... clsrs)
const
50
noexcept
(
sndr_has_nothrow_transform_sender
&&
is_nothrow_huddle
) ->
type
{
51
auto
trnsfrmd_sndr = stdexec::transform_sender(std::forward<Sndr>(sndr), stdexec::get_env(rcvr));
52
return
huddle_fn_t
{}(
53
stdexec::__forward_like<Sndr>(trnsfrmd_sndr.sndr),
54
std::forward<Rcvr>(rcvr),
55
std::move(trnsfrmd_sndr.clsr),
56
std::move(clsrs)...);
57
}
58
};
59
};
60
61
}
// namespace Kokkos::Execution::Impl
62
63
#endif
// KOKKOS_EXECUTION_IMPL_MAKE_OP_STATE_HPP
Kokkos::Execution::Impl::dispatching_sender
Concept that constrains the type of a sender that dispatches a functor for execution.
Definition
sender_concepts.hpp:11
sender_concepts.hpp
stdexec.hpp
Kokkos::Execution::Impl
Definition
attributes.hpp:6
Kokkos::Execution::Impl::MakeOpState::Huddle< Sndr, Rcvr, Clsrs... >::operator()
constexpr auto operator()(Sndr &&sndr, Rcvr &&rcvr, Clsrs... clsrs) const noexcept(sndr_has_nothrow_transform_sender &&is_nothrow_huddle) -> type
Definition
make_op_state.hpp:49
Kokkos::Execution::Impl::MakeOpState::Huddle< Sndr, Rcvr, Clsrs... >::sndr_has_nothrow_transform_sender
static constexpr bool sndr_has_nothrow_transform_sender
Definition
make_op_state.hpp:32
Kokkos::Execution::Impl::MakeOpState::Huddle< Sndr, Rcvr, Clsrs... >::is_nothrow_huddle
static constexpr bool is_nothrow_huddle
Definition
make_op_state.hpp:39
Kokkos::Execution::Impl::MakeOpState::Huddle< Sndr, Rcvr, Clsrs... >::type
typename huddle_fn_t::type type
Definition
make_op_state.hpp:30
Kokkos::Execution::Impl::MakeOpState::Huddle< Sndr, Rcvr, Clsrs... >::huddle_fn_t
Huddle< child_of_sndr_t, Rcvr, clsr_of_sndr_t, Clsrs... > huddle_fn_t
Definition
make_op_state.hpp:29
Kokkos::Execution::Impl::MakeOpState::Huddle< Sndr, Rcvr, Clsrs... >::clsr_of_sndr_t
typename stdexec::transform_sender_result_t< Sndr, stdexec::env_of_t< Rcvr > >::closure_t clsr_of_sndr_t
Definition
make_op_state.hpp:27
Kokkos::Execution::Impl::MakeOpState::Huddle< Sndr, Rcvr, Clsrs... >::child_of_sndr_t
stdexec::__child_of< Sndr > child_of_sndr_t
Definition
make_op_state.hpp:26
Kokkos::Execution::Impl::MakeOpState::Huddle
Definition
make_op_state.hpp:14
Kokkos::Execution::Impl::MakeOpState::Huddle::type
OpStateType< Sndr, Rcvr, Clsrs... > type
Definition
make_op_state.hpp:15
Kokkos::Execution::Impl::MakeOpState::Huddle::operator()
constexpr auto operator()(Sndr &&sndr, Rcvr rcvr, Clsrs... clsrs) const noexcept(std::is_nothrow_constructible_v< type, Sndr &&, Rcvr &&, Clsrs &&... >) -> type
Definition
make_op_state.hpp:18
Kokkos::Execution::Impl::MakeOpState
Definition
make_op_state.hpp:11
kokkos-execution
impl
make_op_state.hpp
Generated on
for kokkos-execution by
1.18.0