|
|
| ArrayOfArraysView ()=default |
| A constructor to create an uninitialized ArrayOfArraysView. More...
|
|
| ArrayOfArraysView (ArrayOfArraysView const &)=default |
| Default copy constructor. More...
|
|
constexpr | ArrayOfArraysView (ArrayOfArraysView &&src) |
| Default move constructor. More...
|
|
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...
|
|
ArrayOfArraysView & | operator= (ArrayOfArraysView &&src) |
| Move assignment operator.. More...
|
|
|
constexpr ArrayOfArraysView< T, INDEX_TYPE const, CONST_SIZES, BUFFER_TYPE > | toView () const |
|
constexpr ArrayOfArraysView< T, INDEX_TYPE const, true, BUFFER_TYPE > | toViewConstSizes () const |
|
constexpr ArrayOfArraysView< T const, INDEX_TYPE const, true, BUFFER_TYPE > | toViewConst () const |
|
|
constexpr INDEX_TYPE_NC | size () const |
|
constexpr INDEX_TYPE_NC | sizeOfArray (INDEX_TYPE const i) const |
|
CONSTEXPR_WITH_NDEBUG INDEX_TYPE_NC | capacity () const |
|
constexpr INDEX_TYPE_NC | capacityOfArray (INDEX_TYPE const i) const |
|
constexpr INDEX_TYPE_NC | valueCapacity () const |
|
|
constexpr ArraySlice< T, 1, 0, INDEX_TYPE_NC > | operator[] (INDEX_TYPE const i) const |
|
constexpr T & | operator() (INDEX_TYPE const i, INDEX_TYPE const j) const |
|
|
template<typename ... ARGS> |
void | emplaceBack (INDEX_TYPE const i, ARGS &&... args) const |
| Append a value to an array. More...
|
|
template<typename POLICY , typename ... ARGS> |
void | emplaceBackAtomic (INDEX_TYPE const i, ARGS &&... args) const |
| Append a value to an array in a thread safe manner. More...
|
|
template<typename ITER > |
void | appendToArray (INDEX_TYPE const i, ITER const first, ITER const last) const |
| Append values to an array. More...
|
|
template<typename ... ARGS> |
void | emplace (INDEX_TYPE const i, INDEX_TYPE const j, ARGS &&... args) const |
| Insert a value into an array. More...
|
|
template<typename ITER > |
void | insertIntoArray (INDEX_TYPE const i, INDEX_TYPE const j, ITER const first, ITER const last) const |
| Insert values into an array. More...
|
|
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 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.
Definition at line 168 of file ArrayOfArraysView.hpp.
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.
Definition at line 631 of file ArrayOfArraysView.hpp.
template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
template<typename ... ARGS>
void LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::emplace |
( |
INDEX_TYPE const |
i, |
|
|
INDEX_TYPE const |
j, |
|
|
ARGS &&... |
args |
|
) |
| const |
|
inline |
Insert a value into an array.
- Template Parameters
-
ARGS | A variadic pack of types used to construct the new T, the types of args . |
- Parameters
-
i | the array to insert into. |
j | the position at which to insert. |
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.
Definition at line 474 of file ArrayOfArraysView.hpp.
template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
template<typename ... ARGS>
void LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::emplaceBack |
( |
INDEX_TYPE const |
i, |
|
|
ARGS &&... |
args |
|
) |
| const |
|
inline |
Append a value to an array.
- Template Parameters
-
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.
Definition at line 410 of file ArrayOfArraysView.hpp.
template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
template<typename POLICY , typename ... ARGS>
void LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::emplaceBackAtomic |
( |
INDEX_TYPE const |
i, |
|
|
ARGS &&... |
args |
|
) |
| const |
|
inline |
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.
Definition at line 431 of file ArrayOfArraysView.hpp.
template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
template<class ... BUFFERS>
Destroy all the objects held by this array and free all associated memory.
- 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. |
Definition at line 773 of file ArrayOfArraysView.hpp.
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 >::reserveValues |
( |
INDEX_TYPE const |
newValueCapacity, |
|
|
BUFFERS &... |
buffers |
|
) |
| |
|
inlineprotected |
Reserve space for the given number of values.
- Template Parameters
-
BUFFERS | variadic template where each type is a BUFFER_TYPE. |
- Parameters
-
newValueCapacity | the new minimum capacity for the number of values across all arrays. |
buffers | variadic parameter pack where each argument is a BUFFER_TYPE that should be treated similarly to m_values. |
Definition at line 614 of file ArrayOfArraysView.hpp.
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. |
Definition at line 666 of file ArrayOfArraysView.hpp.
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 >::resizeImpl |
( |
INDEX_TYPE const |
newSize, |
|
|
INDEX_TYPE const |
defaultArrayCapacity, |
|
|
BUFFERS &... |
buffers |
|
) |
| |
|
inlineprotected |
Set the number of arrays.
- Parameters
-
newSize | the new number of arrays. |
defaultArrayCapacity | the default capacity for each new array. |
- Template Parameters
-
BUFFERS | variadic template where each type is BUFFER_TYPE. |
- Parameters
-
buffers | variadic parameter pack where each argument is a BUFFER_TYPE that should be treated similarly to m_values. |
Definition at line 726 of file ArrayOfArraysView.hpp.
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 >::setCapacityOfArray |
( |
INDEX_TYPE const |
i, |
|
|
INDEX_TYPE const |
newCapacity, |
|
|
BUFFERS &... |
buffers |
|
) |
| |
|
inlineprotected |
Set the capacity of the given array.
- Template Parameters
-
BUFFERS | variadic template where each type is a BUFFER_TYPE. |
- Parameters
-
i | the array to set the capacity of. |
newCapacity | the value to set the capacity of the given array to. |
buffers | variadic parameter pack where each argument is a BUFFER_TYPE that should be treated similarly to m_values. |
Definition at line 844 of file ArrayOfArraysView.hpp.
template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
template<class ... PAIRS_OF_BUFFERS>
void LvArray::ArrayOfArraysView< T, INDEX_TYPE, CONST_SIZES, BUFFER_TYPE >::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 |
|
) |
| |
|
inlineprotected |
Set this ArrayOfArraysView equal to the provided arrays.
- Template Parameters
-
PAIRS_OF_BUFFERS | variadic template where each type is an PairOfBuffers. |
- Parameters
-
srcNumArrays | The number of arrays in source. |
srcMaxOffset | The maximum offset in the source. |
srcOffsets | the source offsets array. |
srcSizes | the source sizes array. |
srcValues | the source values array. |
pairs | variadic parameter pack where each argument is an PairOfBuffers where each pair should be treated similarly to {m_values, srcValues}. |
Definition at line 797 of file ArrayOfArraysView.hpp.
template<typename T, typename INDEX_TYPE, bool CONST_SIZES, template< typename > class BUFFER_TYPE>
Holds the values of each array. Values in the range [m_offsets[ i ], m_offsets[ i ] + m_sizes[ i ]) are valid. All other entries contain uninitialized values.
Definition at line 939 of file ArrayOfArraysView.hpp.