LvArray
Namespaces | Functions
memcpy.hpp File Reference

Contains the implementation of LvArray::memcpy. More...

#include "ArrayView.hpp"
#include "umpireInterface.hpp"
#include <cstring>
Include dependency graph for memcpy.hpp:

Go to the source code of this file.

Namespaces

 LvArray
 The top level namespace.
 

Functions

template<int N_LEFT, typename T , int NDIM, int USD, typename INDEX_TYPE >
std::enable_if_t< N_LEFT==0, ArraySlice< T, NDIM, USD, INDEX_TYPE > > LvArray::internal::slice (ArraySlice< T, NDIM, USD, INDEX_TYPE > const curSlice, INDEX_TYPE const *)
 Specialization for when all the indices have been consumed. More...
 
template<int N_LEFT, typename T , int NDIM, int USD, typename INDEX_TYPE >
std::enable_if_t< N_LEFT !=0, ArraySlice< T, NDIM - N_LEFT, USD - N_LEFT, INDEX_TYPE > > LvArray::internal::slice (ArraySlice< T, NDIM, USD, INDEX_TYPE > const curSlice, INDEX_TYPE const *const remainingIndices)
 Slice curSlice until all of remainingIndices have been consumed. More...
 
template<typename T , int NDIM, int USD, typename DST_INDEX_TYPE , typename SRC_INDEX_TYPE >
void LvArray::memcpy (ArraySlice< T, NDIM, USD, DST_INDEX_TYPE > const dst, ArraySlice< T const, NDIM, USD, SRC_INDEX_TYPE > const src)
 Use memcpy to copy src in to dst. More...
 
template<typename T , int NDIM, int USD, typename DST_INDEX_TYPE , typename SRC_INDEX_TYPE >
camp::resources::Event LvArray::memcpy (camp::resources::Resource &resource, ArraySlice< T, NDIM, USD, DST_INDEX_TYPE > const dst, ArraySlice< T const, NDIM, USD, SRC_INDEX_TYPE > const src)
 Use memcpy to (maybe asynchronously) copy src in to dst. More...
 
template<std::size_t N_DST_INDICES, std::size_t N_SRC_INDICES, typename T , int DST_NDIM, int DST_USD, typename DST_INDEX_TYPE , template< typename > class DST_BUFFER, int SRC_NDIM, int SRC_USD, typename SRC_INDEX_TYPE , template< typename > class SRC_BUFFER>
void LvArray::memcpy (ArrayView< T, DST_NDIM, DST_USD, DST_INDEX_TYPE, DST_BUFFER > const &dst, std::array< DST_INDEX_TYPE, N_DST_INDICES > const &dstIndices, ArrayView< T const, SRC_NDIM, SRC_USD, SRC_INDEX_TYPE, SRC_BUFFER > const &src, std::array< SRC_INDEX_TYPE, N_SRC_INDICES > const &srcIndices)
 Copy the values from a slice of src into a slice of dst. More...
 
template<std::size_t N_DST_INDICES, std::size_t N_SRC_INDICES, typename T , int DST_NDIM, int DST_USD, typename DST_INDEX_TYPE , template< typename > class DST_BUFFER, int SRC_NDIM, int SRC_USD, typename SRC_INDEX_TYPE , template< typename > class SRC_BUFFER>
camp::resources::Event LvArray::memcpy (camp::resources::Resource &resource, ArrayView< T, DST_NDIM, DST_USD, DST_INDEX_TYPE, DST_BUFFER > const &dst, std::array< DST_INDEX_TYPE, N_DST_INDICES > const &dstIndices, ArrayView< T const, SRC_NDIM, SRC_USD, SRC_INDEX_TYPE, SRC_BUFFER > const &src, std::array< SRC_INDEX_TYPE, N_SRC_INDICES > const &srcIndices)
 Copy the values from a slice of src into a slice of dst using resource (may be asynchronous). More...
 

Detailed Description

Contains the implementation of LvArray::memcpy.

Function Documentation

◆ slice() [1/2]

template<int N_LEFT, typename T , int NDIM, int USD, typename INDEX_TYPE >
std::enable_if_t< N_LEFT == 0, ArraySlice< T, NDIM, USD, INDEX_TYPE > > LvArray::internal::slice ( ArraySlice< T, NDIM, USD, INDEX_TYPE > const  curSlice,
INDEX_TYPE const *   
)

Specialization for when all the indices have been consumed.

Returns
curSlice.
Template Parameters
N_LEFTThe number of indices left to consume, this is a specialization for N_LEFT == 0.
TThe type of values in the slice.
NDIMThe number of dimensions in the slice.
USDThe unit stride dimension of the slice.
INDEX_TYPEThe index type of the slice.
Parameters
curSliceThe slice to return.

◆ slice() [2/2]

template<int N_LEFT, typename T , int NDIM, int USD, typename INDEX_TYPE >
std::enable_if_t< N_LEFT != 0, ArraySlice< T, NDIM - N_LEFT, USD - N_LEFT, INDEX_TYPE > > LvArray::internal::slice ( ArraySlice< T, NDIM, USD, INDEX_TYPE > const  curSlice,
INDEX_TYPE const *const  remainingIndices 
)

Slice curSlice until all of remainingIndices have been consumed.

Template Parameters
N_LEFTThe number of indices left to consume.
TThe type of values in the slice.
NDIMThe number of dimensions in the slice.
USDThe unit stride dimension of the slice.
INDEX_TYPEThe index type of the slice.
Parameters
curSliceThe ArraySlice to further slice.
remainingIndicesThe indices used to slice curSlice.
Returns
curSlice[ remainingIndices[ 0 ] ][ remainingIndices[ 1 ] ][ ... ]
.