kokkos-execution
0.0.1
Toggle main menu visibility
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
4
#include "
kokkos-execution/stdexec.hpp
"
5
6
#include "Kokkos_Macros.hpp"
7
#ifdef KOKKOS_ENABLE_EXPERIMENTAL_CXX20_MODULES
8
import
kokkos.core;
9
import
kokkos.graph;
10
#else
11
# include "Kokkos_Core.hpp"
12
# include "Kokkos_Graph.hpp"
13
#endif
14
15
#include "
kokkos-execution/graph/node_props.hpp
"
16
#include "
kokkos-execution/graph/parallel_for.hpp
"
17
#include "
kokkos-execution/graph/sender_concepts.hpp
"
18
#include "
kokkos-execution/impl/bulk.hpp
"
19
#include "
kokkos-execution/impl/dispatch_label.hpp
"
20
#include "
kokkos-execution/impl/env.hpp
"
21
#include "
kokkos-execution/impl/sender_concepts.hpp
"
22
#include "
kokkos-execution/impl/sender_introspection.hpp
"
23
24
namespace
Kokkos::Execution::GraphImpl
{
25
26
template
<>
27
struct
TransformSenderFor
<
stdexec
::bulk_t> {
28
template
<
typename
Env,
typename
Data,
typename
Sndr>
29
using
trnsfrmd_sndr_t
=
ParallelForSender
<
30
Sndr,
31
node_props_t<Impl::exec_of_t<Sndr, Env>
, std::string>,
32
Impl::functor_for_bulk_t<Data>
,
33
Impl::make_policy_result_t
<
34
Impl::make_policy_for_bulk_t<Impl::exec_of_t<Sndr, Env>
, Data>,
35
Impl::iter_space_for_bulk_t<Data>
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<
43
trnsfrmd_sndr_t<Env, Data, Sndr>
,
44
typename
trnsfrmd_sndr_t<Env, Data, Sndr>::closure_t
,
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
51
return
trnsfrmd_sndr_t<Env, Data, Sndr>
{
52
.clsr =
53
{.node_props = Kokkos::Experimental::node_props(
54
Kokkos::Experimental::get_device_handle(schd.state->exec),
55
std::string(
KOKKOS_EXECUTION_IMPL_DISPATCH_LABEL
((
Impl::exec_of_t<Sndr, Env>
),
": bulk"
))),
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 {
66
return
no_graph_scheduler_in_env<stdexec::bulk_t, Sndr, Env>
();
67
}
68
};
69
70
}
// namespace Kokkos::Execution::GraphImpl
71
72
#endif
// KOKKOS_EXECUTION_GRAPH_BULK_HPP
Kokkos::Execution::GraphImpl::graph_completing_sender
Concept for a sender whose completion scheduler is Kokkos::Execution::GraphImpl::Scheduler.
Definition
sender_concepts.hpp:12
dispatch_label.hpp
KOKKOS_EXECUTION_IMPL_DISPATCH_LABEL
#define KOKKOS_EXECUTION_IMPL_DISPATCH_LABEL(_exec_, _suffix_)
Definition
dispatch_label.hpp:51
parallel_for.hpp
sender_concepts.hpp
bulk.hpp
env.hpp
sender_concepts.hpp
stdexec.hpp
Kokkos::Execution::GraphImpl
Definition
graph.hpp:26
Kokkos::Execution::GraphImpl::node_props_t
typename Kokkos::Impl::NodeCtorProps< Kokkos::Impl::DeviceHandle< Exec >, Label >::uniform_type node_props_t
Definition
node_props.hpp:19
Kokkos::Execution::GraphImpl::no_graph_scheduler_in_env
auto no_graph_scheduler_in_env() noexcept
Show a better compile diagnostic when there is no Kokkos::Execution::GraphImpl::Scheduler found.
Definition
diagnostics.hpp:31
Kokkos::Execution::Impl::iter_space_for_bulk_t
Kokkos::dims< 1, typename Impl::bulk_traits< Data >::shape_t > iter_space_for_bulk_t
Definition
bulk.hpp:43
Kokkos::Execution::Impl::functor_for_bulk_t
typename Impl::bulk_traits< Data >::functor_t functor_for_bulk_t
Definition
bulk.hpp:40
Kokkos::Execution::Impl::make_policy_result_t
std::invoke_result_t< const MakePolicy &, Args... > make_policy_result_t
Definition
make_policy.hpp:77
Kokkos::Execution::Impl::make_policy_for_bulk_t
Impl::make_policy_t< Exec, Kokkos::IndexType< typename Impl::bulk_traits< Data >::shape_t > > make_policy_for_bulk_t
Definition
bulk.hpp:37
Kokkos::Execution::Impl::exec_of_t
typename ExecOf< Args... >::type exec_of_t
Definition
get_exec.hpp:42
stdexec
Definition
when_all.hpp:16
node_props.hpp
sender_introspection.hpp
Kokkos::Execution::GraphImpl::ParallelForSender
Definition
parallel_for.hpp:58
Kokkos::Execution::GraphImpl::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 > > >::closure_t
ParallelForClosure< node_props_t< Impl::exec_of_t< Sndr, Env >, std::string >, Impl::functor_for_bulk_t< Data >, ExecPolicyOrIterSpace > closure_t
Definition
parallel_for.hpp:61
Kokkos::Execution::GraphImpl::TransformSenderFor< stdexec::bulk_t >::trnsfrmd_sndr_t
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
Kokkos::Execution::GraphImpl::TransformSenderFor< stdexec::bulk_t >::operator()
auto operator()(const Env &, stdexec::bulk_t, Data &&, Sndr &&) const noexcept
Definition
bulk.hpp:65
Kokkos::Execution::GraphImpl::TransformSenderFor
Definition
graph_fwd.hpp:29
kokkos-execution
graph
bulk.hpp
Generated on
for kokkos-execution by
1.18.0