24#ifndef MORPHEUS_SPACES_HPP
25#define MORPHEUS_SPACES_HPP
27#include <Morpheus_CustomBackend.hpp>
28#include <Morpheus_GenericBackend.hpp>
38template <
class ExecutionSpace,
class MemorySpace,
class BackendSpace>
41 "ExecutionSpace does not have a valid execution_space trait");
43 "MemorySpace does not have a valid memory_space trait");
46 "BackendSpace must be either a custom or generic backend.");
47 using backend =
typename BackendSpace::backend;
49 typename ExecutionSpace::execution_space;
51 typename MemorySpace::memory_space;
68 U*,
typename std::enable_if<
69 is_custom_backend_v<typename U::backend> ||
70 is_generic_backend_v<typename U::backend>>::type* =
nullptr);
76 static const bool value =
sizeof(test<T>(
nullptr)) ==
sizeof(yes);
99 keep_exe = Kokkos::Impl::MemorySpaceAccess<
100 typename S::execution_space::memory_space,
101 Kokkos::HostSpace>::accessible
108 Kokkos::Impl::MemorySpaceAccess<Kokkos::HostSpace,
109 typename S::memory_space>::accessible
112 using wrapped_space =
typename std::conditional<
113 is_execution_space_v<S> || is_memory_space_v<S> ||
118 using backend =
typename std::conditional<
119 keep_exe && keep_mem,
121 typename std::conditional<
124 typename wrapped_space::memory_space, wrapped_space>,
Checks if the given type T has a valid supported backend.
Definition: Morpheus_Spaces.hpp:62
Checks if the given type T has a valid supported execution space.
Definition: Morpheus_SpaceTraits.hpp:154
Checks if the given type T has a valid supported memory space.
Definition: Morpheus_SpaceTraits.hpp:81
Checks if the given type T is a valid generic backend i.e is a GenericBackend container....
Definition: Morpheus_GenericBackend.hpp:171
typename Impl::is_custom_backend_helper< typename std::remove_cv< T >::type >::type is_custom_backend
Checks if the given type T is a valid custom backend i.e is a CustomBackend container.
Definition: Morpheus_CustomBackend.hpp:211
Generic Morpheus interfaces.
Definition: dummy.cpp:24
constexpr bool has_backend_v
Short-hand to has_backend.
Definition: Morpheus_Spaces.hpp:85
A wrapper that converts a valid space into a custom backend.
Definition: Morpheus_CustomBackend.hpp:75
A type that binds together the execution, memory space and backend.
Definition: Morpheus_Spaces.hpp:39
typename BackendSpace::backend backend
The type of backend.
Definition: Morpheus_Spaces.hpp:47
typename MemorySpace::memory_space memory_space
Memory Space for the data.
Definition: Morpheus_Spaces.hpp:51
typename ExecutionSpace::execution_space execution_space
Execution Space to run in.
Definition: Morpheus_Spaces.hpp:49
A wrapper that converts a valid space into a generic backend.
Definition: Morpheus_GenericBackend.hpp:68
Given a space S, the HostMirror will generate the appropriate Host backend.
Definition: Morpheus_Spaces.hpp:94