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_EXECUTION_SPACE_BULK_HPP
2
#define KOKKOS_EXECUTION_EXECUTION_SPACE_BULK_HPP
3
4
#include "
kokkos-execution/execution_space/execution_space_fwd.hpp
"
5
6
#include "
kokkos-execution/execution_space/parallel_for.hpp
"
7
#include "
kokkos-execution/execution_space/sender_concepts.hpp
"
8
#include "
kokkos-execution/impl/bulk.hpp
"
9
#include "
kokkos-execution/impl/dispatch_label.hpp
"
10
#include "
kokkos-execution/impl/sender_introspection.hpp
"
11
12
namespace
Kokkos::Execution::ExecutionSpaceImpl
{
13
14
template
<>
15
struct
TransformSenderFor
<
stdexec
::bulk_t> {
16
template
<
typename
Env,
typename
Data,
typename
Sndr>
17
using
trnsfrmd_sndr_t
=
ParallelForSender
<
18
stdexec::bulk_t,
19
Sndr,
20
std::string_view,
21
typename
Kokkos::Execution::Impl::bulk_traits<Data>::functor_t
,
22
Kokkos::RangePolicy<Impl::exec_of_t<Sndr, Env>>
23
>;
24
25
template
<
typename
Env, Kokkos::Execution::Impl::has_parallel_policy Data,
typename
Sndr>
26
requires
stdexec::__sends<stdexec::set_value_t, Sndr, Env>
27
auto
operator()
(
28
const
Env& env,
29
stdexec::bulk_t,
30
Data&& data,
// NOLINT(cppcoreguidelines-missing-std-forward)
31
Sndr&& sndr)
const
32
noexcept
(std::is_nothrow_constructible_v<
33
trnsfrmd_sndr_t<Env, Data, Sndr>
,
34
typename
trnsfrmd_sndr_t<Env, Data, Sndr>::closure_t
&&,
35
Sndr&&
36
>) {
37
if
constexpr
(
execution_space_completing_sender<Sndr, Env>
) {
38
auto
& [parallel_policy, shape, functor] = data;
39
40
const
auto
schd = stdexec::get_completion_scheduler<stdexec::set_value_t>(stdexec::get_env(sndr), env);
41
42
return
trnsfrmd_sndr_t<Env, Data, Sndr>
{
43
{{
Impl::dispatch_label<Impl::exec_of_t<Sndr, Env>
,
": bulk"
>(),
44
stdexec::__forward_like<Data>(functor),
45
Kokkos::RangePolicy<Impl::exec_of_t<Sndr, Env>>(schd.state->exec, 0, shape)}},
46
std::forward<Sndr>(sndr)};
47
}
else
{
48
return
no_execution_space_scheduler_in_env<stdexec::bulk_t, Sndr, Env>
();
49
}
50
}
51
};
52
53
}
// namespace Kokkos::Execution::ExecutionSpaceImpl
54
55
#endif
// KOKKOS_EXECUTION_EXECUTION_SPACE_BULK_HPP
Kokkos::Execution::ExecutionSpaceImpl::execution_space_completing_sender
Concept for a sender whose completion scheduler is Kokkos::Execution::ExecutionSpaceImpl::Scheduler.
Definition
sender_concepts.hpp:12
dispatch_label.hpp
parallel_for.hpp
sender_concepts.hpp
execution_space_fwd.hpp
bulk.hpp
Kokkos::Execution::ExecutionSpaceImpl
Definition
execution_space.hpp:22
Kokkos::Execution::ExecutionSpaceImpl::no_execution_space_scheduler_in_env
auto no_execution_space_scheduler_in_env() noexcept
Show a better compile diagnostic when there is no Kokkos::Execution::ExecutionSpaceImpl::Scheduler fo...
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::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::ExecutionSpaceImpl::ParallelForSender
Definition
parallel_for.hpp:37
Kokkos::Execution::ExecutionSpaceImpl::ParallelForSender::closure_t
ParallelForClosure< Label, Functor, ExecPolicy > closure_t
Definition
parallel_for.hpp:40
Kokkos::Execution::ExecutionSpaceImpl::TransformSenderFor< stdexec::bulk_t >::trnsfrmd_sndr_t
ParallelForSender< stdexec::bulk_t, Sndr, std::string_view, typename Kokkos::Execution::Impl::bulk_traits< Data >::functor_t, Kokkos::RangePolicy< Impl::exec_of_t< Sndr, Env > > > trnsfrmd_sndr_t
Definition
bulk.hpp:17
Kokkos::Execution::ExecutionSpaceImpl::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:27
Kokkos::Execution::ExecutionSpaceImpl::TransformSenderFor
Definition
execution_space_fwd.hpp:12
kokkos-execution
execution_space
bulk.hpp
Generated on
for kokkos-execution by
1.18.0