1#ifndef KOKKOS_EXECUTION_PARALLEL_FOR_HPP
2#define KOKKOS_EXECUTION_PARALLEL_FOR_HPP
12template <stdexec::sender Sndr,
typename Label,
typename Functor, Kokkos::ExecutionPolicy ExecPolicy>
19 template <
typename Functor, Kokkos::ExecutionPolicy ExecPolicy>
20 constexpr auto operator()(std::string label, ExecPolicy policy, Functor functor)
const {
21 return stdexec::__closure(*
this, std::move(label), std::move(policy), std::move(functor));
24 template <
typename Functor, Kokkos::ExecutionPolicy ExecPolicy>
25 constexpr auto operator()(ExecPolicy policy, Functor functor)
const {
26 return this->
operator()(
"", std::move(policy), std::move(functor));
29 template <
typename Functor, std::
integral T>
30 constexpr auto operator()(std::string label,
const T work_count, Functor functor)
const {
32 typename Kokkos::Impl::FunctorPolicyExecutionSpace<std::remove_cvref_t<Functor>,
void>
::execution_space;
33 using policy_t = Kokkos::RangePolicy<execution_space>;
35 return this->
operator()(std::move(label), policy_t(0, work_count), std::move(functor));
39 template <
typename Functor, std::
integral T>
40 constexpr auto operator()(
const T work_count, Functor functor)
const {
41 return this->
operator()(
"", work_count, std::move(functor));
44 template <stdexec::sender Sndr,
typename Functor, Kokkos::ExecutionPolicy ExecPolicy>
45 constexpr auto operator()(Sndr&& sndr, std::string label, ExecPolicy policy, Functor functor)
const {
47 {std::move(label), std::move(functor), std::move(policy)}, std::forward<Sndr>(sndr));
53template <
typename Label,
typename Functor, Kokkos::ExecutionPolicy ExecPolicy>
64template <stdexec::sender Sndr,
typename Label,
typename Functor, Kokkos::ExecutionPolicy ExecPolicy>
65struct ParallelForSender : stdexec::__tuple<parallel_for_t, ParallelForData<Label, Functor, ExecPolicy>, Sndr> {
68 using base_t = stdexec::__tuple<parallel_for_t, ParallelForData<Label, Functor, ExecPolicy>, Sndr>;
78 template <stdexec::receiver Rcvr>
81 template <stdexec::receiver Rcvr>
82 constexpr auto connect(Rcvr)
const & =
delete;
87 stdexec::__get<idx_sndr>(
static_cast<const base_t&
>(*
this)))
#define KOKKOS_EXECUTION_IMPL_FORWARDING_ATTRIBUTES_GET_ENV(_type_, _obj_)
#define KOKKOS_EXECUTION_COMPL_SIGS_ADD(_sndr_type_,...)
Completion signatures of _sndr_type_.
constexpr parallel_for_t parallel_for
ParallelForSender(ParallelForData< Label, Functor, ExecPolicy > data, Sndr &&sndr)
constexpr auto connect(Rcvr) const &=delete
stdexec::sender_t sender_concept
stdexec::__tuple< parallel_for_t, ParallelForData< Label, Functor, ExecPolicy >, Sndr > base_t
static constexpr size_t idx_sndr
constexpr auto connect(Rcvr) &&=delete
Custom algorithm for the Kokkos::parallel_for construct.
constexpr auto operator()(std::string label, const T work_count, Functor functor) const
constexpr auto operator()(const T work_count, Functor functor) const
constexpr auto operator()(Sndr &&sndr, std::string label, ExecPolicy policy, Functor functor) const
constexpr auto operator()(std::string label, ExecPolicy policy, Functor functor) const
constexpr auto operator()(ExecPolicy policy, Functor functor) const
Kokkos::DefaultExecutionSpace execution_space