kokkos-execution
0.0.1
Toggle main menu visibility
Loading...
Searching...
No Matches
get_graph.hpp
Go to the documentation of this file.
1
#ifndef KOKKOS_EXECUTION_GRAPH_GET_GRAPH_HPP
2
#define KOKKOS_EXECUTION_GRAPH_GET_GRAPH_HPP
3
4
#include "
kokkos-execution/stdexec.hpp
"
5
6
#include "
kokkos-execution/graph/get_node.hpp
"
7
8
namespace
Kokkos::Execution::GraphImpl
{
9
15
struct
get_graph_t
:
public
stdexec::__query<get_graph_t> { };
16
17
inline
constexpr
get_graph_t
get_graph
{};
18
19
#if defined(KOKKOS_COMPILER_GNU) \
20
&& (KOKKOS_COMPILER_GNU == 1420 || KOKKOS_COMPILER_GNU == 1520 || KOKKOS_COMPILER_GNU == 1601)
22
template
<
typename
... Booleans>
23
struct
gcc_mor_helper {
24
static
constexpr
bool
value = (Booleans::value || ...);
25
};
26
27
template
<
typename
... Booleans>
28
static
constexpr
bool
gcc_mor_v = gcc_mor_helper<Booleans...>::value;
29
#endif
30
32
struct
GraphComposition
{
34
struct
Attach
{ };
35
37
struct
Create
{ };
38
40
template
<
typename
... Queryables>
41
using
policy_t
= std::conditional_t<
42
#if defined(KOKKOS_COMPILER_GNU) \
43
&& (KOKKOS_COMPILER_GNU == 1420 || KOKKOS_COMPILER_GNU == 1520 || KOKKOS_COMPILER_GNU == 1601)
44
gcc_mor_v<stdexec::__mbool<stdexec::__queryable_with<Queryables, get_node_t>>...>,
45
#else
46
(stdexec::__queryable_with<Queryables, get_node_t> || ...),
47
#endif
48
Attach
,
49
Create
50
>;
51
52
template
<
typename
Exec,
typename
... Queryables>
53
struct
node_helper_t
;
54
55
template
<
typename
Exec,
typename
... Queryables>
56
requires
std::same_as<
policy_t
<Queryables...>,
Create
>
57
struct
node_helper_t
<Exec, Queryables...> {
58
using
type
=
typename
Kokkos::Experimental::Graph<Exec>::root_t;
59
};
60
61
template
<
typename
Exec,
typename
FirstQueryable,
typename
... RestOfQueryables>
62
requires
(
63
std::same_as<
policy_t
<FirstQueryable, RestOfQueryables...>,
Attach
>
64
&& stdexec::__queryable_with<FirstQueryable, get_node_t>)
65
struct
node_helper_t<Exec, FirstQueryable, RestOfQueryables...>
{
66
using
type
= stdexec::__query_result_t<FirstQueryable, get_node_t>;
67
};
68
69
template
<
typename
Exec,
typename
FirstQueryable,
typename
... RestOfQueryables>
70
requires
(std::same_as<
policy_t
<FirstQueryable, RestOfQueryables...>,
Attach
>)
71
struct
node_helper_t<Exec, FirstQueryable, RestOfQueryables...>
{
72
using
type
=
typename
node_helper_t
<Exec, RestOfQueryables...>
::type
;
73
};
74
79
template
<
typename
Exec,
typename
... Queryables>
80
using
node_t
=
typename
node_helper_t
<Exec, Queryables...>::type;
81
};
82
83
}
// namespace Kokkos::Execution::GraphImpl
84
85
#endif
// KOKKOS_EXECUTION_GRAPH_GET_GRAPH_HPP
get_node.hpp
stdexec.hpp
Kokkos::Execution::GraphImpl
Definition
graph.hpp:26
Kokkos::Execution::GraphImpl::get_graph
constexpr get_graph_t get_graph
Definition
get_graph.hpp:17
Kokkos::Execution::GraphImpl::GraphComposition::Attach
Attach to the existing graph of the predecessor.
Definition
get_graph.hpp:34
Kokkos::Execution::GraphImpl::GraphComposition::Create
Create a new graph and attach after the root node.
Definition
get_graph.hpp:37
Kokkos::Execution::GraphImpl::GraphComposition::node_helper_t< Exec, FirstQueryable, RestOfQueryables... >::type
stdexec::__query_result_t< FirstQueryable, get_node_t > type
Definition
get_graph.hpp:66
Kokkos::Execution::GraphImpl::GraphComposition::node_helper_t< Exec, Queryables... >::type
typename Kokkos::Experimental::Graph< Exec >::root_t type
Definition
get_graph.hpp:58
Kokkos::Execution::GraphImpl::GraphComposition::node_helper_t
Definition
get_graph.hpp:53
Kokkos::Execution::GraphImpl::GraphComposition
Inspired by https://github.com/NVIDIA/stdexec/blob/8c5eedd0fcf9a8ebcdb75d988f72f88efcf64a37/include/s...
Definition
get_graph.hpp:32
Kokkos::Execution::GraphImpl::GraphComposition::node_t
typename node_helper_t< Exec, Queryables... >::type node_t
Definition
get_graph.hpp:80
Kokkos::Execution::GraphImpl::GraphComposition::policy_t
std::conditional_t<(stdexec::__queryable_with< Queryables, get_node_t >||...), Attach, Create > policy_t
Use the Attach policy if any Queryables is queryable with get_node_t.
Definition
get_graph.hpp:41
Kokkos::Execution::GraphImpl::get_graph_t
Definition
get_graph.hpp:15
kokkos-execution
graph
get_graph.hpp
Generated on
for kokkos-execution by
1.18.0