|
AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/main/src/axom/core/ArrayBase.hpp>
Public Types | |
| using | StagingBuffer = DeviceStagingBuffer< T > |
Public Member Functions | |
| ArrayOps (int allocId, bool preferDevice) | |
| void | init (T *data, IndexType begin, IndexType nelems) |
| Default-initializes the "new" segment of an array. More... | |
| void | fill (T *array, IndexType begin, IndexType nelems, const T &value) |
| Fills an uninitialized array with objects of type T. More... | |
| void | fill_range (T *array, IndexType begin, IndexType nelems, const T *values, MemorySpace valueSpace) |
| Fills an uninitialized array with a range of objects of type T. More... | |
| template<typename... Args> | |
| void | emplace (T *array, IndexType i, Args &&... args) |
| Constructs a new element in uninitialized memory. More... | |
| void | destroy (T *array, IndexType begin, IndexType nelems) |
| Calls the destructor on a range of typed elements in the array. More... | |
| void | move (T *array, IndexType src_begin, IndexType src_end, IndexType dst) |
| Moves a range of data in the array. More... | |
| void | realloc_move (T *array, IndexType nelems, T *values) |
| Moves a range of elements to a new allocation. More... | |
Static Public Attributes | |
| constexpr static MemorySpace | space {MemorySpace::Dynamic} |
| using axom::detail::ArrayOps< T >::StagingBuffer = DeviceStagingBuffer<T> |
|
inline |
|
inline |
Default-initializes the "new" segment of an array.
| [in,out] | data | The data to initialize |
| [in] | begin | The beginning of the subset of data that should be initialized |
| [in] | nelems | the number of elements to initialize |
References AXOM_LAMBDA, axom::utilities::annotations::begin(), axom::detail::DeviceStagingBuffer< T >::getStagingBuffer(), and axom::detail::ArrayOps< T >::space.
|
inline |
Fills an uninitialized array with objects of type T.
| [in,out] | array | the array to fill |
| [in] | begin | the index in the array to begin filling elements at |
| [in] | nelems | the number of elements to fill the array with |
| [in] | value | the value to set each array element to |
References AXOM_LAMBDA, axom::utilities::annotations::begin(), axom::detail::DeviceStagingBuffer< T >::getStagingBuffer(), and axom::detail::ArrayOps< T >::space.
|
inline |
Fills an uninitialized array with a range of objects of type T.
| [in,out] | array | the array to fill |
| [in] | begin | the index at which to begin placing elements |
| [in] | nelems | the number of elements in the range to fill the array with |
| [in] | values | the values to set each array element to |
| [in] | valueSpace | the memory space in which values resides |
References axom::utilities::annotations::begin(), axom::copy(), axom::detail::DeviceStagingBuffer< T >::getStagingBuffer(), and axom::detail::ArrayOps< T >::space.
|
inline |
Constructs a new element in uninitialized memory.
| [in,out] | array | the array to construct in |
| [in] | i | the array index in which to construct the new object |
| [in] | args | the arguments to forward to constructor of the element. |
References AXOM_UNLIKELY, axom::copy(), and axom::detail::ArrayOps< T >::space.
|
inline |
Calls the destructor on a range of typed elements in the array.
| [in,out] | array | the array with elements to destroy |
| [in] | begin | the start index of the range of elements to destroy |
| [in] | nelems | the number of elements to destroy |
References axom::utilities::annotations::begin(), axom::detail::DeviceStagingBuffer< T >::getStagingBuffer(), and axom::detail::ArrayOps< T >::space.
|
inline |
Moves a range of data in the array.
| [in,out] | array | the array with elements to move |
| [in] | src_begin | the start index of the source range |
| [in] | src_end | the end index of the source range, exclusive |
| [in] | dst | the destination index of the range of elements |
References axom::copy(), axom::deallocate(), and axom::detail::ArrayOps< T >::space.
|
inline |
Moves a range of elements to a new allocation.
| [in,out] | array | the array to move the elements to. |
| [in] | nelems | the number of elements to move. |
| [in] | values | the destination index of the range of elements |
References axom::copy(), axom::detail::ArrayOps< T >::destroy(), and axom::detail::ArrayOps< T >::space.
|
staticconstexpr |