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
#if defined(KOKKOS_EXECUTION_ENABLE_DEBUG_LOGGING)
7
# include "plog/Log.h"
8
#endif
9
10
#include "Kokkos_Graph.hpp"
11
12
#include "
kokkos-execution/graph/parallel_for.hpp
"
13
#include "
kokkos-execution/graph/sender_concepts.hpp
"
14
#include "
kokkos-execution/impl/bulk.hpp
"
15
#include "
kokkos-execution/impl/dispatch_label.hpp
"
16
#include "
kokkos-execution/impl/env.hpp
"
17
#include "
kokkos-execution/impl/sender_concepts.hpp
"
18
#include "
kokkos-execution/impl/sender_introspection.hpp
"
19
20
namespace
Kokkos::Execution::GraphImpl
{
21
22
template
<>
23
struct
TransformSenderFor
<
stdexec
::bulk_t> {
24
template
<
typename
Env,
typename
Data,
typename
Sndr>
25
using
trnsfrmd_sndr_t
=
ParallelForSender
<
26
Sndr,
27
std::string,
28
typename
Kokkos::Execution::Impl::bulk_traits<Data>::functor_t
,
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>
34
auto
operator()
(
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<
40
trnsfrmd_sndr_t<Env, Data, Sndr>
,
41
typename
trnsfrmd_sndr_t<Env, Data, Sndr>::closure_t
,
42
Sndr&&
43
>) {
44
if
constexpr
(
graph_completing_sender<Sndr, Env>
) {
45
auto
& [parallel_policy, shape, functor] = data;
46
47
const
auto
schd = stdexec::get_completion_scheduler<stdexec::set_value_t>(stdexec::get_env(sndr), env);
48
49
return
trnsfrmd_sndr_t<Env, Data, Sndr>
{
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
{
59
return
no_graph_scheduler_in_env<stdexec::bulk_t, Sndr, Env>
();
60
}
61
}
62
};
63
64
}
// namespace Kokkos::Execution::GraphImpl
65
66
#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
parallel_for.hpp
sender_concepts.hpp
bulk.hpp
env.hpp
sender_concepts.hpp
stdexec.hpp
Kokkos::Execution::GraphImpl
Definition
graph.hpp:20
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
sender_concepts.hpp:31
Kokkos::Execution::Impl::bulk_traits
BulkTraits< std::remove_cvref_t< Data > > bulk_traits
Definition
bulk.hpp:26
Kokkos::Execution::Impl::exec_of_t
typename ExecOf< Args... >::type exec_of_t
Definition
get_exec.hpp:37
Kokkos::Execution::Impl::dispatch_label
consteval std::string_view dispatch_label() noexcept
View the dispatch label as a std::string_view.
Definition
dispatch_label.hpp:47
stdexec
Definition
when_all.hpp:16
sender_introspection.hpp
Kokkos::Execution::GraphImpl::ParallelForSender
Definition
parallel_for.hpp:42
Kokkos::Execution::GraphImpl::ParallelForSender::closure_t
ParallelForClosure< Label, Functor, ExecPolicy > closure_t
Definition
parallel_for.hpp:45
Kokkos::Execution::GraphImpl::TransformSenderFor< stdexec::bulk_t >::operator()
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
Kokkos::Execution::GraphImpl::TransformSenderFor< stdexec::bulk_t >::trnsfrmd_sndr_t
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
Kokkos::Execution::GraphImpl::TransformSenderFor
Definition
graph_fwd.hpp:21
kokkos-execution
graph
bulk.hpp
Generated on
for kokkos-execution by
1.18.0