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) && (KOKKOS_COMPILER_GNU == 1420 || KOKKOS_COMPILER_GNU == 1520)
21
template
<
typename
... Booleans>
22
struct
gcc_mor_helper {
23
static
constexpr
bool
value = (Booleans::value || ...);
24
};
25
26
template
<
typename
... Booleans>
27
static
constexpr
bool
gcc_mor_v = gcc_mor_helper<Booleans...>::value;
28
#endif
29
31
struct
GraphComposition
{
33
struct
Attach
{ };
34
36
struct
Create
{ };
37
39
template
<
typename
... Queryables>
40
using
policy_t
= std::conditional_t<
41
#if defined(KOKKOS_COMPILER_GNU) && (KOKKOS_COMPILER_GNU == 1420 || KOKKOS_COMPILER_GNU == 1520)
42
gcc_mor_v<stdexec::__mbool<stdexec::__queryable_with<Queryables, get_node_t>>...>,
43
#else
44
(stdexec::__queryable_with<Queryables, get_node_t> || ...),
45
#endif
46
Attach
,
47
Create
48
>;
49
50
template
<
typename
Exec,
typename
... Queryables>
51
struct
node_helper_t
;
52
53
template
<
typename
Exec,
typename
... Queryables>
54
requires
std::same_as<
policy_t
<Queryables...>,
Create
>
55
struct
node_helper_t
<Exec, Queryables...> {
56
using
type
=
typename
Kokkos::Experimental::Graph<Exec>::root_t;
57
};
58
59
template
<
typename
Exec,
typename
FirstQueryable,
typename
... RestOfQueryables>
60
requires
(
61
std::same_as<
policy_t
<FirstQueryable, RestOfQueryables...>,
Attach
>
62
&& stdexec::__queryable_with<FirstQueryable, get_node_t>)
63
struct
node_helper_t<Exec, FirstQueryable, RestOfQueryables...>
{
64
using
type
= stdexec::__query_result_t<FirstQueryable, get_node_t>;
65
};
66
67
template
<
typename
Exec,
typename
FirstQueryable,
typename
... RestOfQueryables>
68
requires
(std::same_as<
policy_t
<FirstQueryable, RestOfQueryables...>,
Attach
>)
69
struct
node_helper_t<Exec, FirstQueryable, RestOfQueryables...>
{
70
using
type
=
typename
node_helper_t
<Exec, RestOfQueryables...>
::type
;
71
};
72
77
template
<
typename
Exec,
typename
... Queryables>
78
using
node_t
=
typename
node_helper_t
<Exec, Queryables...>::type;
79
};
80
81
}
// namespace Kokkos::Execution::GraphImpl
82
83
#endif
// KOKKOS_EXECUTION_GRAPH_GET_GRAPH_HPP
get_node.hpp
stdexec.hpp
Kokkos::Execution::GraphImpl
Definition
graph.hpp:20
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:33
Kokkos::Execution::GraphImpl::GraphComposition::Create
Create a new graph and attach after the root node.
Definition
get_graph.hpp:36
Kokkos::Execution::GraphImpl::GraphComposition::node_helper_t< Exec, FirstQueryable, RestOfQueryables... >::type
stdexec::__query_result_t< FirstQueryable, get_node_t > type
Definition
get_graph.hpp:64
Kokkos::Execution::GraphImpl::GraphComposition::node_helper_t< Exec, Queryables... >::type
typename Kokkos::Experimental::Graph< Exec >::root_t type
Definition
get_graph.hpp:56
Kokkos::Execution::GraphImpl::GraphComposition::node_helper_t
Definition
get_graph.hpp:51
Kokkos::Execution::GraphImpl::GraphComposition
Inspired by https://github.com/NVIDIA/stdexec/blob/8c5eedd0fcf9a8ebcdb75d988f72f88efcf64a37/include/s...
Definition
get_graph.hpp:31
Kokkos::Execution::GraphImpl::GraphComposition::node_t
typename node_helper_t< Exec, Queryables... >::type node_t
Definition
get_graph.hpp:78
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:40
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