kokkos-execution
0.0.1
Toggle main menu visibility
Loading...
Searching...
No Matches
get_exec.hpp
Go to the documentation of this file.
1
#ifndef KOKKOS_EXECUTION_IMPL_GET_EXEC_HPP
2
#define KOKKOS_EXECUTION_IMPL_GET_EXEC_HPP
3
4
#include "Kokkos_Core.hpp"
5
6
#include "
kokkos-execution/impl/sender_introspection.hpp
"
7
8
namespace
Kokkos::Execution::Impl
{
9
15
struct
get_exec_t
:
public
stdexec::__query<get_exec_t> {
16
using
stdexec::__query<
get_exec_t
>::operator();
17
};
18
19
inline
constexpr
get_exec_t
get_exec
{};
20
21
template
<
typename
... Args>
22
struct
ExecOf
;
23
25
template
<stdexec::sender Sndr,
typename
... Env>
26
struct
ExecOf
<Sndr, Env...> {
27
using
type
=
typename
completion_scheduler_of_t
<stdexec::set_value_t, Sndr, Env...>
::execution_space
;
28
};
29
31
template
<stdexec::__queryable_with<get_exec_t> T>
32
struct
ExecOf
<T> {
33
using
type
=
typename
std::remove_cvref_t<stdexec::__query_result_t<T, get_exec_t>>
::execution_space
;
34
};
35
36
template
<
typename
... Args>
37
using
exec_of_t
=
typename
ExecOf
<Args...>::type;
38
46
template
<Kokkos::ExecutionSpace Exec>
47
struct
ExecutionSpaceRef
{
48
using
execution_space
= Exec;
49
50
execution_space
const
*
m_exec_ptr
;
51
52
explicit
constexpr
ExecutionSpaceRef
(
const
execution_space
& exec) noexcept
53
:
m_exec_ptr
(&exec) {
54
}
55
56
ExecutionSpaceRef
() =
delete
;
57
ExecutionSpaceRef
(
const
ExecutionSpaceRef
&)
noexcept
=
default
;
58
ExecutionSpaceRef
&
operator=
(
const
ExecutionSpaceRef
&)
noexcept
=
default
;
59
ExecutionSpaceRef
(
ExecutionSpaceRef
&&) noexcept = default;
60
ExecutionSpaceRef
& operator=(
ExecutionSpaceRef
&&) noexcept = default;
61
~
ExecutionSpaceRef
() noexcept = default;
62
63
const
execution_space
&
get
() const noexcept {
64
return
*
m_exec_ptr
;
65
}
66
67
friend
constexpr
auto
operator<=>
(
const
ExecutionSpaceRef
&,
const
ExecutionSpaceRef
&)
noexcept
=
default
;
68
69
[[nodiscard]]
70
constexpr
const
ExecutionSpaceRef
&
query
(
const
get_exec_t
&)
const
noexcept
{
71
return
*
this
;
72
}
73
};
74
75
}
// namespace Kokkos::Execution::Impl
76
77
#endif
// KOKKOS_EXECUTION_IMPL_GET_EXEC_HPP
Kokkos::Execution::Impl
Definition
attributes.hpp:6
Kokkos::Execution::Impl::completion_scheduler_of_t
std::invoke_result_t< stdexec::get_completion_scheduler_t< Tag >, stdexec::env_of_t< Sndr >, Env... > completion_scheduler_of_t
Retrieve the completion scheduler for a given completion tag.
Definition
sender_introspection.hpp:18
Kokkos::Execution::Impl::get_exec
constexpr get_exec_t get_exec
Definition
get_exec.hpp:19
Kokkos::Execution::Impl::exec_of_t
typename ExecOf< Args... >::type exec_of_t
Definition
get_exec.hpp:37
sender_introspection.hpp
Kokkos::Execution::Impl::ExecOf< Sndr, Env... >::type
typename completion_scheduler_of_t< stdexec::set_value_t, Sndr, Env... >::execution_space type
Definition
get_exec.hpp:27
Kokkos::Execution::Impl::ExecOf< T >::type
typename std::remove_cvref_t< stdexec::__query_result_t< T, get_exec_t > >::execution_space type
Definition
get_exec.hpp:33
Kokkos::Execution::Impl::ExecOf
Definition
get_exec.hpp:22
Kokkos::Execution::Impl::ExecutionSpaceRef::operator=
ExecutionSpaceRef & operator=(const ExecutionSpaceRef &) noexcept=default
Kokkos::Execution::Impl::ExecutionSpaceRef::execution_space
Exec execution_space
Definition
get_exec.hpp:48
Kokkos::Execution::Impl::ExecutionSpaceRef::m_exec_ptr
execution_space const * m_exec_ptr
Definition
get_exec.hpp:50
Kokkos::Execution::Impl::ExecutionSpaceRef::ExecutionSpaceRef
ExecutionSpaceRef(const ExecutionSpaceRef &) noexcept=default
Kokkos::Execution::Impl::ExecutionSpaceRef::ExecutionSpaceRef
ExecutionSpaceRef(ExecutionSpaceRef &&) noexcept=default
Kokkos::Execution::Impl::ExecutionSpaceRef::operator<=>
friend constexpr auto operator<=>(const ExecutionSpaceRef &, const ExecutionSpaceRef &) noexcept=default
Kokkos::Execution::Impl::ExecutionSpaceRef::ExecutionSpaceRef
ExecutionSpaceRef()=delete
Kokkos::Execution::Impl::ExecutionSpaceRef::get
const execution_space & get() const noexcept
Definition
get_exec.hpp:63
Kokkos::Execution::Impl::ExecutionSpaceRef::ExecutionSpaceRef
constexpr ExecutionSpaceRef(const execution_space &exec) noexcept
Definition
get_exec.hpp:52
Kokkos::Execution::Impl::ExecutionSpaceRef::query
constexpr const ExecutionSpaceRef & query(const get_exec_t &) const noexcept
Definition
get_exec.hpp:70
Kokkos::Execution::Impl::get_exec_t
Definition
get_exec.hpp:15
execution_space
Kokkos::DefaultExecutionSpace execution_space
kokkos-execution
impl
get_exec.hpp
Generated on
for kokkos-execution by
1.18.0