|
|
| | ArrayOfArraysView ()=default |
| | A constructor to create an uninitialized ArrayOfArraysView. More...
|
| |
| | ArrayOfArraysView (ArrayOfArraysView const &)=default |
| | Default copy constructor. More...
|
| |
| LVARRAY_HOST_DEVICE constexpr | ArrayOfArraysView (ArrayOfArraysView &&src) |
| | Default move constructor. More...
|
| |
| LVARRAY_HOST_DEVICE constexpr | ArrayOfArraysView (INDEX_TYPE const numArrays, BUFFER_TYPE< INDEX_TYPE > const &offsets, BUFFER_TYPE< SIZE_TYPE > const &sizes, BUFFER_TYPE< T > const &values) |
| | Construct a new ArrayOfArraysView from the given buffers. More...
|
| |
| ArrayOfArraysView & | operator= (ArrayOfArraysView const &)=default |
| | Default copy assignment operator. More...
|
| |
| LVARRAY_HOST_DEVICE ArrayOfArraysView & | operator= (ArrayOfArraysView &&src) |
| | Move assignment operator.. More...
|
| |
|
| LVARRAY_HOST_DEVICE constexpr ArrayOfArraysView< T, INDEX_TYPE const, CONST_SIZES, BUFFER_TYPE > | toView () const |
| |
| LVARRAY_HOST_DEVICE constexpr ArrayOfArraysView< T, INDEX_TYPE const, true, BUFFER_TYPE > | toViewConstSizes () const |
| |
| LVARRAY_HOST_DEVICE constexpr ArrayOfArraysView< T const, INDEX_TYPE const, true, BUFFER_TYPE > | toViewConst () const |
| |
|
| LVARRAY_HOST_DEVICE constexpr INDEX_TYPE_NC | size () const |
| |
| LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK INDEX_TYPE_NC | sizeOfArray (INDEX_TYPE const i) const |
| |
| LVARRAY_HOST_DEVICE constexpr SIZE_TYPE const * | getSizes () const |
| |
| LVARRAY_HOST_DEVICE constexpr INDEX_TYPE const * | getOffsets () const |
| |
| LVARRAY_HOST_DEVICE constexpr T const * | getValues () const |
| |
| LVARRAY_HOST_DEVICE CONSTEXPR_WITH_NDEBUG INDEX_TYPE_NC | capacity () const |
| |
| LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK INDEX_TYPE_NC | capacityOfArray (INDEX_TYPE const i) const |
| |
| LVARRAY_HOST_DEVICE constexpr INDEX_TYPE_NC | valueCapacity () const |
| |
|
| LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK ArraySlice< T, 1, 0, INDEX_TYPE_NC > | operator[] (INDEX_TYPE const i) const |
| |
| LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK T & | operator() (INDEX_TYPE const i, INDEX_TYPE const j) const |
| |
|
| template<typename ... ARGS> |
| LVARRAY_HOST_DEVICE void | emplaceBack (INDEX_TYPE const i, ARGS &&... args) const |
| | Append a value to an array. More...
|
| |
| template<typename POLICY , typename ... ARGS> |
| LVARRAY_HOST_DEVICE void | emplaceBackAtomic (INDEX_TYPE const i, ARGS &&... args) const |
| | Append a value to an array in a thread safe manner. More...
|
| |
| template<typename ITER > |
| LVARRAY_HOST_DEVICE void | appendToArray (INDEX_TYPE const i, ITER const first, ITER const last) const |
| | Append values to an array. More...
|
| |
| template<typename ... ARGS> |
| LVARRAY_HOST_DEVICE void | emplace (INDEX_TYPE const i, INDEX_TYPE const j, ARGS &&... args) const |
| | Insert a value into an array. More...
|
| |
| template<typename ITER > |
| LVARRAY_HOST_DEVICE void | insertIntoArray (INDEX_TYPE const i, INDEX_TYPE const j, ITER const first, ITER const last) const |
| | Insert values into an array. More...
|
| |
| LVARRAY_HOST_DEVICE void | eraseFromArray (INDEX_TYPE const i, INDEX_TYPE const j, INDEX_TYPE const n=1) const |
| | Erase values from an array. More...
|
| |
|
| void | registerTouch (MemorySpace const space) const |
| | Touch the memory in space. More...
|
| |
| void | move (MemorySpace const space, bool touch=true) const |
| | Move this ArrayOfArrays to the given memory space. More...
|
| |
|
| | ArrayOfArraysView (bool) |
| | Protected constructor to be used by parent classes. More...
|
| |
|
| void | resize (INDEX_TYPE const newSize, INDEX_TYPE const defaultArrayCapacity=0) |
| | Set the number of arrays. More...
|
| |
| void | reserve (INDEX_TYPE const newCapacity) |
| | Reserve space for the given number of arrays. More...
|
| |
| template<class ... BUFFERS> |
| void | reserveValues (INDEX_TYPE const newValueCapacity, BUFFERS &... buffers) |
| | Reserve space for the given number of values. More...
|
| |
| template<class ... BUFFERS> |
| void | compress (BUFFERS &... buffers) |
| | Compress the arrays so that the values of each array are contiguous with no extra capacity in between. More...
|
| |
| template<typename ... BUFFERS> |
| void | resizeFromOffsets (INDEX_TYPE const numSubArrays, INDEX_TYPE const *const offsets, BUFFERS &... buffers) |
| | Clears the array and creates a new array with the given number of sub-arrays. More...
|
| |
| template<typename POLICY , typename ... BUFFERS> |
| void | resizeFromCapacities (INDEX_TYPE const numSubArrays, INDEX_TYPE const *const capacities, BUFFERS &... buffers) |
| | Clears the array and creates a new array with the given number of sub-arrays. More...
|
| |
|
| void | assimilate (ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE > &&src) |
| | Steal the resources of src, clearing it in the process. More...
|
| |
| template<typename ... BUFFERS> |
| void | resizeImpl (INDEX_TYPE const newSize, INDEX_TYPE const defaultArrayCapacity, BUFFERS &... buffers) |
| | Set the number of arrays. More...
|
| |
| template<class ... BUFFERS> |
| void | free (BUFFERS &... buffers) |
| | Destroy all the objects held by this array and free all associated memory. More...
|
| |
| template<class ... PAIRS_OF_BUFFERS> |
| void | setEqualTo (INDEX_TYPE const srcNumArrays, INDEX_TYPE const srcMaxOffset, BUFFER_TYPE< INDEX_TYPE > const &srcOffsets, BUFFER_TYPE< INDEX_TYPE > const &srcSizes, BUFFER_TYPE< T > const &srcValues, PAIRS_OF_BUFFERS &&... pairs) |
| | Set this ArrayOfArraysView equal to the provided arrays. More...
|
| |
| template<class ... BUFFERS> |
| void | setCapacityOfArray (INDEX_TYPE const i, INDEX_TYPE const newCapacity, BUFFERS &... buffers) |
| | Set the capacity of the given array. More...
|
| |
| template<typename U > |
| void | setName (std::string const &name) |
| | Set the name to be displayed whenever the underlying Buffer's user call back is called. More...
|
| |
template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
class LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >
This class provides a view into an array of arrays like object.
- Template Parameters
-
| T | the type stored in the arrays. |
| INDEX_TYPE | the integer to use for indexing. |
| CONST_SIZES | true iff the size of each array is constant. |
When INDEX_TYPE is const m_offsets is not copied between memory spaces. When accessing this class directly (not through an ArrayOfArrays object) INDEX_TYPE should always be const since ArrayOfArraysView is not allowed to modify the offsets.
When CONST_SIZES is true m_sizes is not copied between memory spaces.
template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
template<class ... BUFFERS>
Compress the arrays so that the values of each array are contiguous with no extra capacity in between.
- Template Parameters
-
| BUFFERS | variadic template where each type is a BUFFER_TYPE. |
- Parameters
-
| buffers | variadic parameter pack where each argument is a BUFFER_TYPE that should be treated similarly to m_values. |
- Note
- This method doesn't free any memory.
template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
template<class ... BUFFERS>
| void LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::destroyValues |
( |
INDEX_TYPE const |
begin, |
|
|
INDEX_TYPE const |
end, |
|
|
BUFFERS &... |
buffers |
|
) |
| |
|
inlineprivate |
Destroy the values in arrays in the range [begin, end).
- Template Parameters
-
| BUFFERS | variadic template where each type is a BUFFER_TYPE. |
- Parameters
-
| begin | the array to start with. |
| end | where to stop destroying values. |
| buffers | variadic parameter pack where each argument is a BUFFER_TYPE that should be treated similarly to m_values. |
- Note
- This is to be use by the non-view derived classes.
-
This doesn't free any memory.
template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
template<typename POLICY , typename ... ARGS>
Append a value to an array in a thread safe manner.
- Template Parameters
-
| POLICY | The RAJA atomic policy to use to increment the size of the array. |
| ARGS | A variadic pack of types used to construct the new T, the types of args. |
- Parameters
-
| i | the array to append to. |
| args | The variadic pack of arguments forwared to construct the new value. |
- Precondition
- Since the ArrayOfArraysView can't do reallocation or shift the offsets it is up to the user to ensure that the given array has enough space for the new values.
template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
template<typename POLICY , typename ... BUFFERS>
| void LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::resizeFromCapacities |
( |
INDEX_TYPE const |
numSubArrays, |
|
|
INDEX_TYPE const *const |
capacities, |
|
|
BUFFERS &... |
buffers |
|
) |
| |
|
inlineprotected |
Clears the array and creates a new array with the given number of sub-arrays.
- Template Parameters
-
| POLICY | The RAJA policy used to convert capacities into the offsets array. Should NOT be a device policy. |
- Parameters
-
| numSubArrays | The new number of arrays. |
| capacities | A pointer to an array of length numSubArrays containing the capacity of each new sub array. |
| buffers | A variadic pack of buffers to treat similarly to m_values. |
template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
template<typename ... BUFFERS>
| void LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::resizeFromOffsets |
( |
INDEX_TYPE const |
numSubArrays, |
|
|
INDEX_TYPE const *const |
offsets, |
|
|
BUFFERS &... |
buffers |
|
) |
| |
|
inlineprotected |
Clears the array and creates a new array with the given number of sub-arrays.
- Parameters
-
| numSubArrays | The new number of arrays. |
| offsets | A pointer to an array of length numSubArrays+1 containing the offset of each new sub array. Offsets are precomputed by the caller. |
| buffers | A variadic pack of buffers to treat similarly to m_values. |
template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
template<typename FUNC , typename ... BUFFERS>
| void LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::resizeFromOffsetsImpl |
( |
INDEX_TYPE const |
numSubArrays, |
|
|
FUNC && |
fillOffsets, |
|
|
BUFFERS &... |
buffers |
|
) |
| |
|
inlineprivate |
Clears the array and creates a new array with the given number of sub-arrays.
- Parameters
-
| numSubArrays | The new number of arrays. |
| fillOffsets | A function that will be called to populate sub-array offsets. |
| buffers | A variadic pack of buffers to treat similarly to m_values. |
- Note
- This is to be called by other resizeFrom functions.