|
LvArray
|
Contains functions to aid in multidimensional indexing. More...
Classes | |
| struct | ConditionalMultiply |
| A helper struct to multiply two numbers. More... | |
| struct | ConditionalMultiply< true > |
| A specialization of ConditionalMultiply that skips the multiplication. More... | |
Functions | |
| template<int SIZE, typename T > | |
| LVARRAY_HOST_DEVICE constexpr std::enable_if_t<(SIZE==1), T > | multiplyAll (T const *const LVARRAY_RESTRICT values) |
| template<int SIZE, typename T > | |
| LVARRAY_HOST_DEVICE constexpr std::enable_if_t<(SIZE > 1), T > | multiplyAll (T const *const LVARRAY_RESTRICT values) |
| template<int USD, typename INDEX_TYPE , typename INDEX > | |
| LVARRAY_HOST_DEVICE constexpr INDEX_TYPE | getLinearIndex (INDEX_TYPE const *const LVARRAY_RESTRICT strides, INDEX const index) |
| Get the index into a one dimensional space. More... | |
| template<int USD, typename INDEX_TYPE , typename INDEX , typename ... REMAINING_INDICES> | |
| LVARRAY_HOST_DEVICE constexpr INDEX_TYPE | getLinearIndex (INDEX_TYPE const *const LVARRAY_RESTRICT strides, INDEX const index, REMAINING_INDICES const ... indices) |
| Get the index into a a multidimensional space. More... | |
| std::string | getIndexString () |
| template<typename INDEX , typename ... REMAINING_INDICES> | |
| std::string | getIndexString (INDEX const index, REMAINING_INDICES const ... indices) |
| template<typename INDEX_TYPE , typename ... INDICES> | |
| std::string | printDimsAndIndices (INDEX_TYPE const *const LVARRAY_RESTRICT dims, INDICES const ... indices) |
| template<typename INDEX_TYPE , typename ... INDICES> | |
| LVARRAY_HOST_DEVICE constexpr bool | invalidIndices (INDEX_TYPE const *const LVARRAY_RESTRICT dims, INDICES const ... indices) |
| template<typename INDEX_TYPE , typename ... INDICES> | |
| LVARRAY_HOST_DEVICE void | checkIndices (INDEX_TYPE const *const LVARRAY_RESTRICT dims, INDICES const ... indices) |
Check that the indices are with dims , if not the program is aborted. More... | |
| template<typename PERMUTATION , typename INDEX_TYPE , camp::idx_t NDIM> | |
| LVARRAY_HOST_DEVICE typeManipulation::CArray< INDEX_TYPE, NDIM > | calculateStrides (typeManipulation::CArray< INDEX_TYPE, NDIM > const &dims) |
| Calculate the strides given the dimensions and permutation. More... | |
Contains functions to aid in multidimensional indexing.
|
inline |
Calculate the strides given the dimensions and permutation.
| PERMUTATION | The permutation to apply to the dimensions to calculate the strides. |
| INDEX_TYPE | The integral type used for the dimensions of the space. |
| NDIM | The number of dimensions. |
| dims | The size of each dimension. |
|
inline |
Check that the indices are with dims , if not the program is aborted.
| INDEX_TYPE | The integral type used for the dimensions of the space. |
| INDICES | A variadic pack of the integral types of the indices. |
| dims | A pointer to the dimensions of the space. |
| indices | A variadic pack of the indices. |
|
inline |
| std::string LvArray::indexing::getIndexString | ( | INDEX const | index, |
| REMAINING_INDICES const ... | indices | ||
| ) |
| INDEX | The integral type of the first index. |
| REMAINING_INDICES | A variadic pack of the integral types of the remaining indices. |
| index | The first index. |
| indices | A variadic pack of indices to the remaining dimensions. |
|
inline |
Get the index into a one dimensional space.
| USD | The unit stride dimension of strides. |
| INDEX_TYPE | The integral type of the strides and the type to return. |
| INDEX | The integral type of the index. |
| strides | A pointer to the stride of the dimension. |
| index | The index into the dimension. |
|
inline |
Get the index into a a multidimensional space.
| USD | The unit stride dimension of strides. |
| INDEX_TYPE | The integral type of the strides and the type to return. |
| INDEX | The integral type of the first index. |
| REMAINING_INDICES | A variadic pack of the integral types of the remaining indices. |
| strides | A pointer to the strides of the dimension. |
| index | The index into the first dimension. |
| indices | A variadic pack of the indices to the remaining dimensions. |
strides with ( index, indices ... ).
|
inline |
| INDEX_TYPE | The integral type used for the dimensions of the space. |
| INDICES | A variadic pack of the integral types of the indices. |
| dims | A pointer to the dimensions of the space. |
| indices | A variadic pack of the indices. |
|
inline |
| SIZE | The number of values to multiply together. |
| T | The type of the values. |
values, values + SIZE ) | values | A pointer to the values to multiply together. |
|
inline |
| SIZE | The number of values to multiply together. |
| T | The type of the values. |
values, values + SIZE ) | values | A pointer to the values to multiply together. |
| std::string LvArray::indexing::printDimsAndIndices | ( | INDEX_TYPE const *const LVARRAY_RESTRICT | dims, |
| INDICES const ... | indices | ||
| ) |
| INDEX_TYPE | The integral type of the dimensions. |
| INDICES | A variadic pack of the integral types of the indices. |
| dims | A pointer to the dimensions of the space. |
| indices | A variadic pack of indices. |
1.8.13