24#ifndef MORPHEUS_GENERICBACKEND_HPP
25#define MORPHEUS_GENERICBACKEND_HPP
27#include <Morpheus_SpaceTraits.hpp>
67template <
typename Space>
69 static_assert(has_execution_space_v<Space>,
70 "Space needs to have a valid Execution Space!");
71 static_assert(has_memory_space_v<Space>,
72 "Space needs to have a valid Memory Space!");
75 typename Space::execution_space;
77 typename Space::memory_space;
100#if defined(MORPHEUS_ENABLE_SERIAL)
107#if defined(MORPHEUS_ENABLE_OPENMP)
114#if defined(MORPHEUS_ENABLE_CUDA)
124#if defined(MORPHEUS_ENABLE_HIP)
131using HIPSpace = Morpheus::GenericSpace<Kokkos::HIPSpace>;
141struct is_generic_backend_helper : std::false_type {};
143template <
typename Space>
144struct is_generic_backend_helper<GenericBackend<Space>> : std::true_type {};
147using is_generic_backend =
typename Impl::is_generic_backend_helper<
148 typename std::remove_cv<T>::type>::type;
178 typename std::enable_if<
184 static no& test(...);
187 static const bool value =
sizeof(test<T>(
nullptr)) ==
sizeof(yes);
211 U*,
typename std::enable_if<is_generic_backend_v<typename U::backend> ||
212 is_generic_backend_v<U>>::type* =
nullptr);
215 static no& test(...);
218 static const bool value =
sizeof(test<T>(
nullptr)) ==
sizeof(yes);
Checks if the given type T has a valid generic backend i.e has a GenericBackend container....
Definition: Morpheus_GenericBackend.hpp:205
Checks if the given type T is a valid supported execution space.
Definition: Morpheus_SpaceTraits.hpp:111
Checks if the given type T is a valid generic backend i.e is a GenericBackend container....
Definition: Morpheus_GenericBackend.hpp:171
Checks if the given type T is a valid supported memory space.
Definition: Morpheus_SpaceTraits.hpp:46
constexpr bool has_generic_backend_v
Short-hand to has_generic_backend.
Definition: Morpheus_GenericBackend.hpp:226
constexpr bool is_generic_backend_v
Short-hand to is_generic_backend.
Definition: Morpheus_GenericBackend.hpp:195
Morpheus::GenericSpace< Kokkos::HIPSpace > HIPSpace
The Generic HIP memory space.
Definition: Morpheus_GenericBackend.hpp:131
Generic Morpheus interfaces.
Definition: dummy.cpp:24
A type that binds together the execution, memory space and backend.
Definition: Morpheus_Spaces.hpp:39
A wrapper that converts a valid space into a generic backend.
Definition: Morpheus_GenericBackend.hpp:68
typename Space::memory_space memory_space
Memory space of generic backend.
Definition: Morpheus_GenericBackend.hpp:77
typename Space::execution_space execution_space
Execution space of generic backend.
Definition: Morpheus_GenericBackend.hpp:75