24#ifndef MORPHEUS_CUSTOMBACKEND_HPP
25#define MORPHEUS_CUSTOMBACKEND_HPP
27#include <Morpheus_SpaceTraits.hpp>
28#include <fwd/Morpheus_Fwd_Spaces.hpp>
74template <
typename Space>
76 static_assert(has_execution_space_v<Space>,
77 "Space needs to have a valid Execution Space!");
78 static_assert(has_memory_space_v<Space>,
79 "Space needs to have a valid Memory Space!");
82 typename Space::execution_space;
84 typename Space::memory_space;
106#if defined(MORPHEUS_ENABLE_SERIAL)
114#if defined(MORPHEUS_ENABLE_OPENMP)
122#if defined(MORPHEUS_ENABLE_CUDA)
132#if defined(MORPHEUS_ENABLE_HIP)
154#if defined(MORPHEUS_ENABLE_SERIAL)
160#if defined(MORPHEUS_ENABLE_OPENMP)
166#if defined(MORPHEUS_ENABLE_CUDA)
175#if defined(MORPHEUS_ENABLE_HIP)
190struct is_custom_backend_helper : std::false_type {};
192template <
typename Space>
193struct is_custom_backend_helper<
CustomBackend<Space>> : std::true_type {};
211 typename std::remove_cv<T>::type>::type;
234 U*,
typename std::enable_if<is_custom_backend_v<typename U::backend> ||
235 is_custom_backend_v<U>>::type* =
nullptr);
238 static no& test(...);
241 static const bool value =
sizeof(test<T>(
nullptr)) ==
sizeof(yes);
Checks if the given type T has a valid custom backend i.e has a CustomBackend container.
Definition: Morpheus_CustomBackend.hpp:228
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
constexpr bool is_custom_backend_v
Short-hand to is_custom_backend.
Definition: Morpheus_CustomBackend.hpp:219
constexpr bool has_custom_backend_v
Short-hand to has_custom_backend.
Definition: Morpheus_CustomBackend.hpp:249
Morpheus::CustomBackend< Kokkos::HIPSpace > HIPSpace
The Custom HIP memory space.
Definition: Morpheus_CustomBackend.hpp:140
Morpheus::CustomBackend< Kokkos::Serial > Serial
A Custom Space that launches kernels in serial using the Serial backend.
Definition: Morpheus_CustomBackend.hpp:110
Morpheus::CustomBackend< Kokkos::DefaultExecutionSpace > DefaultExecutionSpace
A Custom Space that launches kernels in the default Space.
Definition: Morpheus_CustomBackend.hpp:101
Morpheus::CustomBackend< Kokkos::CudaSpace > CudaSpace
The Custom Cuda memory space.
Definition: Morpheus_CustomBackend.hpp:129
Morpheus::CustomBackend< Kokkos::OpenMP > OpenMP
A Custom Space that launches kernels in parallel using the OpenMP backend.
Definition: Morpheus_CustomBackend.hpp:118
Morpheus::CustomBackend< Kokkos::HostSpace > HostSpace
The Custom Host memory space.
Definition: Morpheus_CustomBackend.hpp:104
Morpheus::CustomBackend< Kokkos::HIP > HIP
A Custom Space that launches kernels in parallel using the HIP backend.
Definition: Morpheus_CustomBackend.hpp:136
Morpheus::CustomBackend< Kokkos::Cuda > Cuda
A Custom Space that launches kernels in parallel using the Cuda backend.
Definition: Morpheus_CustomBackend.hpp:126
Morpheus::CustomBackend< Kokkos::DefaultHostExecutionSpace > DefaultHostExecutionSpace
A Custom Space that launches kernels in the default Host Space.
Definition: Morpheus_CustomBackend.hpp:97
Generic Morpheus interfaces.
Definition: dummy.cpp:24
A wrapper that converts a valid space into a custom backend.
Definition: Morpheus_CustomBackend.hpp:75
typename Space::execution_space execution_space
Execution space of custom backend.
Definition: Morpheus_CustomBackend.hpp:82
typename Space::memory_space memory_space
Memory space of the custom backend.
Definition: Morpheus_CustomBackend.hpp:84
A type that binds together the execution, memory space and backend.
Definition: Morpheus_Spaces.hpp:39