kokkos-execution 0.0.1
Loading...
Searching...
No Matches
bulk.hpp
Go to the documentation of this file.
1#ifndef KOKKOS_EXECUTION_GRAPH_BULK_HPP
2#define KOKKOS_EXECUTION_GRAPH_BULK_HPP
3
5
6#if defined(KOKKOS_EXECUTION_ENABLE_DEBUG_LOGGING)
7# include "plog/Log.h"
8#endif
9
10#include "Kokkos_Graph.hpp"
11
19
21
22template <>
23struct TransformSenderFor<stdexec::bulk_t> {
24 template <typename Env, typename Data, typename Sndr>
26 Sndr,
27 std::string,
29 Kokkos::RangePolicy<Impl::exec_of_t<Sndr, Env>>
30 >;
31
32 template <typename Env, Kokkos::Execution::Impl::has_parallel_policy Data, typename Sndr>
33 requires stdexec::__sends<stdexec::set_value_t, Sndr, Env>
35 const Env& env,
36 stdexec::bulk_t,
37 Data&& data, // NOLINT(cppcoreguidelines-missing-std-forward)
38 Sndr&& sndr) const
39 noexcept(std::is_nothrow_constructible_v<
42 Sndr&&
43 >) {
45 auto& [parallel_policy, shape, functor] = data;
46
47 auto schd = stdexec::get_completion_scheduler<stdexec::set_value_t>(stdexec::get_env(sndr), env);
48
50 .clsr =
51 {.node_props = Kokkos::Experimental::node_props(
52 std::string(Impl::dispatch_label<Impl::exec_of_t<Sndr, Env>, ": bulk">()),
53 Kokkos::Experimental::get_device_handle(schd.state->exec)),
54 .functor = stdexec::__forward_like<Data>(functor),
55 .policy = Kokkos::RangePolicy<Impl::exec_of_t<Sndr, Env>>(0, shape)},
56 .sndr = std::forward<Sndr>(sndr)
57 };
58 } else {
60 }
61 }
62};
63
64} // namespace Kokkos::Execution::GraphImpl
65
66#endif // KOKKOS_EXECUTION_GRAPH_BULK_HPP
Concept for a sender whose completion scheduler is Kokkos::Execution::GraphImpl::Scheduler.
auto no_graph_scheduler_in_env() noexcept
Show a better compile diagnostic when there is no Kokkos::Execution::GraphImpl::Scheduler found.
BulkTraits< std::remove_cvref_t< Data > > bulk_traits
Definition bulk.hpp:26
typename completion_scheduler_of_t< stdexec::set_value_t, Sndr, Env... >::execution_space exec_of_t
Type of the execution space extracted from a sender's completion scheduler.
consteval std::string_view dispatch_label() noexcept
View the dispatch label as a std::string_view.
ParallelForClosure< Label, Functor, ExecPolicy > closure_t
auto operator()(const Env &env, stdexec::bulk_t, Data &&data, Sndr &&sndr) const noexcept(std::is_nothrow_constructible_v< trnsfrmd_sndr_t< Env, Data, Sndr >, typename trnsfrmd_sndr_t< Env, Data, Sndr >::closure_t, Sndr && >)
Definition bulk.hpp:34
ParallelForSender< Sndr, std::string, typename Kokkos::Execution::Impl::bulk_traits< Data >::functor_t, Kokkos::RangePolicy< Impl::exec_of_t< Sndr, Env > > > trnsfrmd_sndr_t
Definition bulk.hpp:25