kokkos-execution 0.0.1
Loading...
Searching...
No Matches
node_props.hpp
Go to the documentation of this file.
1#ifndef KOKKOS_EXECUTION_GRAPH_NODE_PROPS_HPP
2#define KOKKOS_EXECUTION_GRAPH_NODE_PROPS_HPP
3
4#include "Kokkos_Macros.hpp"
5#ifdef KOKKOS_ENABLE_EXPERIMENTAL_CXX20_MODULES
6import kokkos.core;
7import kokkos.graph_impl;
8#else
9# include "Kokkos_Core.hpp"
10#endif
11
15
17
18template <Kokkos::ExecutionSpace Exec, typename Label>
19using node_props_t = typename Kokkos::Impl::NodeCtorProps<Kokkos::Impl::DeviceHandle<Exec>, Label>::uniform_type;
20
21template <Kokkos::ExecutionSpace Exec, typename Data>
23constexpr auto make_node_props(const Exec& exec, Data&& data) STDEXEC_AUTO_RETURN(
24 Kokkos::Experimental::node_props(
25 Kokkos::Experimental::get_device_handle(exec),
27
28template <Kokkos::ExecutionSpace Exec, typename Data>
29constexpr auto make_node_props(const Exec& exec, Data&&)
30 STDEXEC_AUTO_RETURN(Kokkos::Experimental::node_props(Kokkos::Experimental::get_device_handle(exec)))
31
32template <Kokkos::ExecutionSpace Exec, typename Data>
33using make_node_props_t = decltype(make_node_props(std::declval<const Exec&>(), std::declval<Data&&>()));
34
36template <Kokkos::ExecutionSpace Exec>
37auto device_handle_of(const Kokkos::Impl::NodeCtorProp<Kokkos::Impl::DeviceHandle<Exec>>&)
38 -> std::type_identity<Kokkos::Impl::DeviceHandle<Exec>>;
39
40template <typename T>
41using device_handle_of_t = typename decltype(device_handle_of(std::declval<const T&>()))::type;
42
43template <typename>
44struct ExecOf;
45
51template <Kokkos::ExecutionSpace Exec>
52struct ExecOf<Kokkos::Impl::DeviceHandle<Exec>> : std::type_identity<Exec> { };
53
54template <typename T>
55using exec_of_t = typename ExecOf<T>::type;
56
62template <typename T, typename PropsContainer>
63requires Kokkos::Impl::NodeProperties<std::remove_cvref_t<PropsContainer>>
64decltype(auto) get_label_or_display_string_of(PropsContainer&& props) {
65 if constexpr (std::remove_cvref_t<PropsContainer>::template has<std::string>) {
66 return Kokkos::Impl::get_property<std::string>(std::forward<PropsContainer>(props));
67 } else {
69 }
70}
71
72} // namespace Kokkos::Execution::GraphImpl
73
74#endif // KOKKOS_EXECUTION_GRAPH_NODE_PROPS_HPP
auto device_handle_of(const Kokkos::Impl::NodeCtorProp< Kokkos::Impl::DeviceHandle< Exec > > &) -> std::type_identity< Kokkos::Impl::DeviceHandle< Exec > >
Retrieve the Kokkos::Impl::DeviceHandle type from a node properties type.
decltype(auto) get_label_or_display_string_of(PropsContainer &&props)
If the node properties contain a label, return it. Otherwise, use the display string of T.
decltype(make_node_props(std::declval< const Exec & >(), std::declval< Data && >())) make_node_props_t
constexpr auto make_node_props(const Exec &exec, Data &&data) noexcept(noexcept(Kokkos::Experimental::node_props(Kokkos::Experimental::get_device_handle(exec), Impl::as_convertible_to_string(Impl::get_property< Impl::Label >(std::forward< Data >(data)))))) -> decltype(Kokkos::Experimental::node_props(Kokkos::Experimental::get_device_handle(exec), Impl::as_convertible_to_string(Impl::get_property< Impl::Label >(std::forward< Data >(data)))))
typename ExecOf< T >::type exec_of_t
typename decltype(device_handle_of(std::declval< const T & >()))::type device_handle_of_t
typename Kokkos::Impl::NodeCtorProps< Kokkos::Impl::DeviceHandle< Exec >, Label >::uniform_type node_props_t
constexpr auto as_convertible_to_string(T &&value) noexcept(noexcept(std::forward< T >(value))) -> decltype(std::forward< T >(value))
Convert to a value usable as a std::string.
Definition label.hpp:75
constexpr auto display_string_of() noexcept -> std::string_view
Definition type_info.hpp:20
constexpr decltype(auto) get_property(Data &&data) noexcept