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#include "Kokkos_Macros.hpp"
7#ifdef KOKKOS_ENABLE_EXPERIMENTAL_CXX20_MODULES
8import kokkos.core;
9import kokkos.graph;
10#else
11# include "Kokkos_Core.hpp"
12# include "Kokkos_Graph.hpp"
13#endif
14
23
25
26template <>
27struct TransformSenderFor<stdexec::bulk_t> {
28 template <typename Env, typename Data, typename Sndr>
30 Sndr,
36 >
37 >;
38
39 template <typename Env, Kokkos::Execution::Impl::has_parallel_policy Data, typename Sndr>
40 requires(stdexec::__sends<stdexec::set_value_t, Sndr, Env> && graph_completing_sender<Sndr, Env>)
41 auto operator()(const Env& env, stdexec::bulk_t, Data&& data, Sndr&& sndr) const
42 noexcept(std::is_nothrow_constructible_v<
45 Sndr&&
46 >) {
47 auto&& [parallel_policy, shape, functor] = std::forward<Data>(data);
48
49 const auto schd = stdexec::get_completion_scheduler<stdexec::set_value_t>(stdexec::get_env(sndr), env);
50
52 .clsr =
53 {.node_props = Kokkos::Experimental::node_props(
54 Kokkos::Experimental::get_device_handle(schd.state->exec),
56 .functor = stdexec::__forward_like<Data>(functor),
57 .policy_or_iter_space = Impl::make_policy_for_bulk_t<Impl::exec_of_t<Sndr, Env>, Data>{}(
58 Impl::iter_space_for_bulk_t<Data>{stdexec::__forward_like<Data>(data.__shape_)})},
59 .sndr = std::forward<Sndr>(sndr)
60 };
61 }
62
63 template <typename Env, Kokkos::Execution::Impl::has_parallel_policy Data, typename Sndr>
64 requires stdexec::__sends<stdexec::set_value_t, Sndr, Env>
65 auto operator()(const Env&, stdexec::bulk_t, Data&&, Sndr&&) const noexcept {
67 }
68};
69
70} // namespace Kokkos::Execution::GraphImpl
71
72#endif // KOKKOS_EXECUTION_GRAPH_BULK_HPP
Concept for a sender whose completion scheduler is Kokkos::Execution::GraphImpl::Scheduler.
#define KOKKOS_EXECUTION_IMPL_DISPATCH_LABEL(_exec_, _suffix_)
typename Kokkos::Impl::NodeCtorProps< Kokkos::Impl::DeviceHandle< Exec >, Label >::uniform_type node_props_t
auto no_graph_scheduler_in_env() noexcept
Show a better compile diagnostic when there is no Kokkos::Execution::GraphImpl::Scheduler found.
Kokkos::dims< 1, typename Impl::bulk_traits< Data >::shape_t > iter_space_for_bulk_t
Definition bulk.hpp:43
typename Impl::bulk_traits< Data >::functor_t functor_for_bulk_t
Definition bulk.hpp:40
std::invoke_result_t< const MakePolicy &, Args... > make_policy_result_t
Impl::make_policy_t< Exec, Kokkos::IndexType< typename Impl::bulk_traits< Data >::shape_t > > make_policy_for_bulk_t
Definition bulk.hpp:37
typename ExecOf< Args... >::type exec_of_t
Definition get_exec.hpp:42
ParallelForSender< Sndr, node_props_t< Impl::exec_of_t< Sndr, Env >, std::string >, Impl::functor_for_bulk_t< Data >, Impl::make_policy_result_t< Impl::make_policy_for_bulk_t< Impl::exec_of_t< Sndr, Env >, Data >, Impl::iter_space_for_bulk_t< Data > > > trnsfrmd_sndr_t
Definition bulk.hpp:29
auto operator()(const Env &, stdexec::bulk_t, Data &&, Sndr &&) const noexcept
Definition bulk.hpp:65