24#ifndef MORPHEUS_MIRRORCONTAINERS_HPP
25#define MORPHEUS_MIRRORCONTAINERS_HPP
27#include <Morpheus_FormatTraits.hpp>
29#include <impl/Morpheus_MirrorContainers_Impl.hpp>
62template <
template <
class,
class...>
class Container,
class T,
class... P>
64 const Container<T, P...>& src,
65 typename std::enable_if_t<
is_container_v<Container<T, P...>>>* =
nullptr) {
66 using src_type = Container<T, P...>;
67 using dst_type =
typename src_type::HostMirror;
69 return dst_type().allocate(src);
85template <
class Space,
template <
class,
class...>
class Container,
class T,
87typename Impl::MirrorType<Space, Container, T, P...>::container_type
89 const Container<T, P...>& src,
90 typename std::enable_if_t<
is_container_v<Container<T, P...>>>* =
nullptr) {
91 using container_type =
93 return container_type().allocate(src);
110template <
template <
class,
class...>
class Container,
class T,
class... P>
112 const Container<T, P...>& src,
114 Container<T, P...>,
typename Container<T, P...>::HostMirror>>* =
130template <
template <
class,
class...>
class Container,
class T,
class... P>
132 const Container<T, P...>& src,
134 Container<T, P...>,
typename Container<T, P...>::HostMirror>>* =
155template <
class Space,
template <
class,
class...>
class Container,
class T,
157typename Impl::MirrorContainerType<Space, Container, T, P...>::container_type
159 const Container<T, P...>& src,
161 P...>::is_same_memspace &&
179template <
class Space,
template <
class,
class...>
class Container,
class T,
181typename Impl::MirrorContainerType<Space, Container, T, P...>::container_type
183 const Container<T, P...>& src,
185 Space, Container, T, P...>::is_same_memspace &&
188 using container_type =
190 P...>::container_type;
191 return container_type().allocate(src);
Checks if the given type T is a valid Morpheus Container i.e is either a valid matrix or a vector con...
Definition: Morpheus_FormatTraits.hpp:182
Container< T, P... >::HostMirror create_mirror_container(const Container< T, P... > &src, typename std::enable_if_t< is_compatible_v< Container< T, P... >, typename Container< T, P... >::HostMirror > > *=nullptr)
Creates a mirror container on Host (specialization for same space)
Definition: Morpheus_MirrorContainers.hpp:111
Container< T, P... >::HostMirror create_mirror(const Container< T, P... > &src, typename std::enable_if_t< is_container_v< Container< T, P... > > > *=nullptr)
Allocates a mirror with the same characteristics as source on Host (specialization for different spac...
Definition: Morpheus_MirrorContainers.hpp:63
Generic Morpheus interfaces.
Definition: dummy.cpp:24
constexpr bool is_container_v
Short-hand to is_container.
Definition: Morpheus_FormatTraits.hpp:204
constexpr bool is_compatible_v
Short-hand to is_compatible.
Definition: Morpheus_FormatTraits.hpp:313
Definition: Morpheus_MirrorContainers_Impl.hpp:34
Definition: Morpheus_MirrorContainers_Impl.hpp:63