Morpheus 1.0.0
Dynamic matrix type and algorithms for sparse matrices
Loading...
Searching...
No Matches
Functions

Mirroring Operations on Containers. More...

Collaboration diagram for Mirroring:

Functions

template<template< class, class... > class Container, class T , class... P>
Container< T, P... >::HostMirror Morpheus::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 space) More...
 
template<class Space , template< class, class... > class Container, class T , class... P>
Impl::MirrorType< Space, Container, T, P... >::container_type Morpheus::create_mirror (const Container< T, P... > &src, typename std::enable_if_t< is_container_v< Container< T, P... > > > *=nullptr)
 Create a mirror in a new space (specialization for different space) More...
 
template<template< class, class... > class Container, class T , class... P>
Container< T, P... >::HostMirror Morpheus::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) More...
 
template<template< class, class... > class Container, class T , class... P>
Container< T, P... >::HostMirror Morpheus::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 different space) More...
 
template<class Space , template< class, class... > class Container, class T , class... P>
Impl::MirrorContainerType< Space, Container, T, P... >::container_type Morpheus::create_mirror_container (const Container< T, P... > &src, typename std::enable_if< Impl::MirrorContainerType< Space, Container, T, P... >::is_same_memspace &&is_container< Container< T, P... > >::value >::type *=nullptr)
 Create a mirror container in a new space (specialization for same space) More...
 
template<class Space , template< class, class... > class Container, class T , class... P>
Impl::MirrorContainerType< Space, Container, T, P... >::container_type Morpheus::create_mirror_container (const Container< T, P... > &src, typename std::enable_if<!Impl::MirrorContainerType< Space, Container, T, P... >::is_same_memspace &&is_container< Container< T, P... > >::value >::type *=nullptr)
 Creates a mirror container in a new space (specialization for different space) More...
 

Detailed Description

Mirroring Operations on Containers.

Function Documentation

◆ create_mirror() [1/2]

template<template< class, class... > class Container, class T , class... P>
Container< T, P... >::HostMirror Morpheus::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 space)

Template Parameters
Container
TThe type of values held by the container
PProperties of the container
Parameters
srcThe source container we are mirroring from
Returns
typename Container<T, P...>::HostMirror A mirror of the original container on Host
Note
create_mirror operation always issues a new allocation and doesn't copy elements from source to mirror.

◆ create_mirror() [2/2]

template<class Space , template< class, class... > class Container, class T , class... P>
Impl::MirrorType< Space, Container, T, P... >::container_type Morpheus::create_mirror ( const Container< T, P... > &  src,
typename std::enable_if_t< is_container_v< Container< T, P... > > > *  = nullptr 
)

Create a mirror in a new space (specialization for different space)

Template Parameters
SpaceThe new space in which the mirror is created
Container
TThe type of values held by the container
PProperties of the container
Parameters
srcThe source container we are mirroring from
Returns
Impl::MirrorType<Space, Container, T, P...>::container_type A mirror of the original container in Space
Note
create_mirror operation always issues a new allocation.

◆ create_mirror_container() [1/4]

template<class Space , template< class, class... > class Container, class T , class... P>
Impl::MirrorContainerType< Space, Container, T, P... >::container_type Morpheus::create_mirror_container ( const Container< T, P... > &  src,
typename std::enable_if< Impl::MirrorContainerType< Space, Container, T, P... >::is_same_memspace &&is_container< Container< T, P... > >::value >::type *  = nullptr 
)

Create a mirror container in a new space (specialization for same space)

Template Parameters
SpaceThe new space in which the mirror is created
ContainerThe type of the container to mirror
TThe type of values held by the container
PProperties of the container
Parameters
srcThe source container we are mirroring from
Returns
Impl::MirrorContainerType<Space, Container, T, P...>::container_type Same type as source
Note
Here no actual mirror is created as the source container already lives in the same space with resulting container. As a result the resulting container aliases the source.

◆ create_mirror_container() [2/4]

template<class Space , template< class, class... > class Container, class T , class... P>
Impl::MirrorContainerType< Space, Container, T, P... >::container_type Morpheus::create_mirror_container ( const Container< T, P... > &  src,
typename std::enable_if<!Impl::MirrorContainerType< Space, Container, T, P... >::is_same_memspace &&is_container< Container< T, P... > >::value >::type *  = nullptr 
)

Creates a mirror container in a new space (specialization for different space)

Template Parameters
SpaceThe new space in which the mirror is created
ContainerThe type of the container to mirror
TThe type of values held by the container
PProperties of the container
Parameters
srcThe source container we are mirroring from
Returns
Impl::MirrorContainerType<Space, Container, T, P...>::container_type A mirror of the original container in Space

◆ create_mirror_container() [3/4]

template<template< class, class... > class Container, class T , class... P>
Container< T, P... >::HostMirror Morpheus::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)

Template Parameters
ContainerThe type of the container to mirror
TThe type of values held by the container
PProperties of the container
Parameters
srcThe source container we are mirroring from
Returns
Container<T, P...>::HostMirror The Host Mirror type of source container
Note
Here no actual mirror is created as the source container already lives on Host. As a result the resulting container aliases the source.

◆ create_mirror_container() [4/4]

template<template< class, class... > class Container, class T , class... P>
Container< T, P... >::HostMirror Morpheus::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 different space)

Template Parameters
ContainerThe type of the container to mirror
TThe type of values held by the container
PProperties of the container
Parameters
srcThe source container we are mirroring from
Returns
Container<T, P...>::HostMirror The Host Mirror type of source container