AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
Provides a view over a generic array container. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/v0.6.1/src/axom/core/ArrayView.hpp>
Public Types | |
using | value_type = T |
using | ArrayViewIterator = ArrayIteratorBase< ArrayView< T, DIM, SPACE > > |
Public Member Functions | |
ArrayView () | |
Default constructor. More... | |
AXOM_HOST_DEVICE IndexType | size () const |
Return the number of elements stored in the data array. More... | |
ArrayViewIterator | begin () |
Returns an ArrayViewIterator to the first element of the Array. More... | |
ArrayViewIterator | end () |
Returns an ArrayViewIterator to the element following the last element of the Array. More... | |
int | getAllocatorID () const |
Get the ID for the umpire allocator. More... | |
AXOM_HOST_DEVICE T & | operator() (Args... args) |
Dimension-aware accessor, returns a reference to the given value. More... | |
AXOM_HOST_DEVICE const T & | operator() (Args... args) const |
AXOM_HOST_DEVICE const StackArray< IndexType, DIM > & | shape () const |
Returns the dimensions of the Array. More... | |
AXOM_HOST_DEVICE const StackArray< IndexType, DIM > & | strides () const |
Returns the strides of the Array. More... | |
void | insert (IndexType pos, const ArrayBase< T, DIM, OtherArrayType > &other) |
Appends an Array to the end of the calling object. More... | |
ArrayView to wrap a pointer and provide indexing semantics | |
template<typename... Args> | |
ArrayView (T *data, Args... args) | |
Generic constructor for an ArrayView of arbitrary dimension with external data. More... | |
template<typename OtherArrayType > | |
ArrayView (ArrayBase< T, DIM, OtherArrayType > &other) | |
Constructor for transferring between memory spaces. More... | |
AXOM_HOST_DEVICE T * | data () |
Return a pointer to the array of data. More... | |
AXOM_HOST_DEVICE const T * | data () const |
AXOM_HOST_DEVICE T & | operator[] (const IndexType idx) |
Accessor, returns a reference to the given value. For multidimensional arrays, indexes into the (flat) raw data. More... | |
AXOM_HOST_DEVICE const T & | operator[] (const IndexType idx) const |
Static Public Attributes | |
static constexpr int | dimension = DIM |
static constexpr MemorySpace | space = SPACE |
Protected Member Functions | |
IndexType | blockSize () const |
Returns the minimum "chunk size" that should be allocated For example, 2 would be the chunk size of a 2D array whose second dimension is of size 2. This is used when resizing/reallocating; it wouldn't make sense to have a capacity of 3 in the array described above. More... | |
void | updateStrides () |
Updates the internal striding information to a row-major format Intended to be called after m_dims is updated. In the future, this class will support different striding schemes (e.g., column-major) and/or user-provided striding. More... | |
Protected Attributes | |
StackArray< IndexType, DIM > | m_dims |
The sizes (extents?) in each dimension. More... | |
StackArray< IndexType, DIM > | m_strides |
The strides in each dimension. More... | |
Provides a view over a generic array container.
The ArrayView expresses a non-owning relationship over a pointer
T | the type of the values to hold. |
DIM | The dimension of the array. |
using axom::ArrayView< T, DIM, SPACE >::value_type = T |
using axom::ArrayView< T, DIM, SPACE >::ArrayViewIterator = ArrayIteratorBase<ArrayView<T, DIM, SPACE> > |
|
inline |
Default constructor.
References axom::ArrayView< T, DIM, SPACE >::data().
axom::ArrayView< T, DIM, SPACE >::ArrayView | ( | T * | data, |
Args... | args | ||
) |
Generic constructor for an ArrayView of arbitrary dimension with external data.
[in] | data | the external data this ArrayView will wrap. |
[in] | args | The parameter pack containing the "shape" of the ArrayView |
References axom::Dynamic, and axom::detail::packProduct().
axom::ArrayView< T, DIM, SPACE >::ArrayView | ( | ArrayBase< T, DIM, OtherArrayType > & | other | ) |
Constructor for transferring between memory spaces.
[in] | other | The array in a different memory space to copy from |
Array
-> ArrayView
or from dynamic memory spaces to an ArrayView
of explicitly specified space. References axom::Dynamic, and axom::utilities::processAbort().
|
inline |
Return the number of elements stored in the data array.
Referenced by axom::ArrayView< T, DIM, SPACE >::end().
|
inline |
Returns an ArrayViewIterator to the first element of the Array.
|
inline |
Returns an ArrayViewIterator to the element following the last element of the Array.
References axom::ArrayView< T, DIM, SPACE >::size().
|
inline |
Return a pointer to the array of data.
Referenced by axom::ArrayView< T, DIM, SPACE >::ArrayView().
|
inline |
|
inline |
Get the ID for the umpire allocator.
|
inlineinherited |
Dimension-aware accessor, returns a reference to the given value.
[in] | args | the parameter pack of indices in each dimension. |
|
inlineinherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inlineinherited |
Accessor, returns a reference to the given value. For multidimensional arrays, indexes into the (flat) raw data.
[in] | idx | the position of the value to return. |
|
inlineinherited |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inlineinherited |
Returns the dimensions of the Array.
|
inlineinherited |
Returns the strides of the Array.
|
inlineinherited |
|
inlineprotectedinherited |
Returns the minimum "chunk size" that should be allocated For example, 2 would be the chunk size of a 2D array whose second dimension is of size 2. This is used when resizing/reallocating; it wouldn't make sense to have a capacity of 3 in the array described above.
|
inlineprotectedinherited |
Updates the internal striding information to a row-major format Intended to be called after m_dims
is updated. In the future, this class will support different striding schemes (e.g., column-major) and/or user-provided striding.
|
static |
|
static |
|
protectedinherited |
The sizes (extents?) in each dimension.
|
protectedinherited |
The strides in each dimension.