29 template<
typename T,
typename LAMBDA >
45 template<
typename T,
int NDIM,
int USD,
typename INDEX_TYPE,
typename LAMBDA >
49 INDEX_TYPE
const bounds = slice.
size( 0 );
50 for( INDEX_TYPE i = 0; i < bounds; ++i )
66 template<
typename T,
typename LAMBDA,
typename ... INDICES >
69 { f( value, indices ... ); }
85 template<
typename T,
int NDIM,
int USD,
typename INDEX_TYPE,
typename LAMBDA,
typename ... INDICES >
89 INDICES
const ... indices )
91 INDEX_TYPE
const bounds = slice.
size( 0 );
92 for( INDEX_TYPE i = 0; i < bounds; ++i )
107 template<
typename T,
int USD_SRC,
typename INDEX_TYPE >
111 INDEX_TYPE
const bounds = src.
size( 0 );
112 for( INDEX_TYPE i = 0; i < bounds; ++i )
128 template<
typename T,
int NDIM,
int USD_SRC,
int USD_DST,
typename INDEX_TYPE >
132 #ifdef ARRAY_SLICE_CHECK_BOUNDS 133 for(
int i = 1; i < NDIM; ++i )
141 dst( indices ... ) += value;
This class serves to provide a sliced multidimensional interface to the family of LvArray classes...
void forValuesInSlice(T &value, LAMBDA &&f)
Apply the given function to the given value.
Contains the implementation of LvArray::ArraySlice.
constexpr INDEX_TYPE size() const noexcept
void forValuesInSliceWithIndices(T &value, LAMBDA &&f, INDICES const ... indices)
Apply the function f to the value value also passing f any indices used to reach value.
void sumOverFirstDimension(ArraySlice< T const, 1, USD_SRC, INDEX_TYPE > const src, T &dst)
Add the values in src to dst.
#define DISABLE_HD_WARNING
Disable host device warnings.
#define LVARRAY_ERROR_IF_NE(lhs, rhs)
Raise a hard error if two values are not equal.
#define LVARRAY_HOST_DEVICE
Mark a function for both host and device usage.