#include <KokkosArray.h>
Public Member Functions | |
Array ()=default | |
Default constructor. More... | |
Array (const Array< T, 4 > &array) | |
Copy constructor. More... | |
auto & | operator= (const Array< T, 4 > &array) |
Shallow copy another Kokkos array. More... | |
Array (dof_id_type n0, dof_id_type n1, dof_id_type n2, dof_id_type n3) | |
Constructor Initialize and allocate array with given dimensions This allocates both host and device data. More... | |
void | init (dof_id_type n0, dof_id_type n1, dof_id_type n2, dof_id_type n3) |
Initialize array with given dimensions but do not allocate. More... | |
void | create (dof_id_type n0, dof_id_type n1, dof_id_type n2, dof_id_type n3) |
Initialize and allocate array with given dimensions on host and device. More... | |
void | createHost (dof_id_type n0, dof_id_type n1, dof_id_type n2, dof_id_type n3) |
Initialize and allocate array with given dimensions on host only. More... | |
void | createDevice (dof_id_type n0, dof_id_type n1, dof_id_type n2, dof_id_type n3) |
Initialize and allocate array with given dimensions on device only. More... | |
void | offset (dof_id_signed_type d0, dof_id_signed_type d1, dof_id_signed_type d2, dof_id_signed_type d3) |
Set starting index offsets. More... | |
KOKKOS_FUNCTION T & | operator() (dof_id_signed_type i0, dof_id_signed_type i1, dof_id_signed_type i2, dof_id_signed_type i3) const |
Get an array entry. More... | |
void | destroy () |
Free all data and reset. More... | |
void | shallowCopy (const ArrayBase< T, dimension > &array) |
Shallow copy another Kokkos array. More... | |
unsigned int | useCount () const |
Get the reference count. More... | |
KOKKOS_FUNCTION bool | isAlloc () const |
Get whether the array was allocated either on host or device. More... | |
KOKKOS_FUNCTION bool | isHostAlloc () const |
Get whether the array was allocated on host. More... | |
KOKKOS_FUNCTION bool | isDeviceAlloc () const |
Get whether the array was allocated on device. More... | |
KOKKOS_FUNCTION bool | isHostAlias () const |
Get whether the host array was aliased. More... | |
KOKKOS_FUNCTION bool | isDeviceAlias () const |
Get whether the device array was aliased. More... | |
KOKKOS_FUNCTION dof_id_type | size () const |
Get the total array size. More... | |
KOKKOS_FUNCTION dof_id_type | n (unsigned int dim) const |
Get the size of a dimension. More... | |
KOKKOS_FUNCTION T * | data () const |
Get the data pointer. More... | |
KOKKOS_FUNCTION T & | first () const |
Get the first element. More... | |
KOKKOS_FUNCTION T & | last () const |
Get the last element. More... | |
KOKKOS_FUNCTION T & | operator[] (dof_id_type i) const |
Get an array entry. More... | |
T * | hostData () const |
Get the host data pointer. More... | |
T * | deviceData () const |
Get the device data pointer. More... | |
void | create (const std::vector< dof_id_type > &n) |
Allocate array on host and device. More... | |
void | createHost (const std::vector< dof_id_type > &n) |
Allocate array on host only. More... | |
void | createDevice (const std::vector< dof_id_type > &n) |
Allocate array on device only. More... | |
void | aliasHost (T *ptr) |
Point the host data to an external data instead of allocating it. More... | |
void | aliasDevice (T *ptr) |
Point the device data to an external data instead of allocating it. More... | |
void | offset (const std::vector< dof_id_signed_type > &d) |
Apply starting index offsets to each dimension. More... | |
void | copyToDevice () |
Copy data from host to device. More... | |
void | copyToHost () |
Copy data from device to host. More... | |
void | copyIn (const T *ptr, MemcpyKind dir, dof_id_type n, dof_id_type offset=0) |
Copy data from an external data to this array. More... | |
void | copyOut (T *ptr, MemcpyKind dir, dof_id_type n, dof_id_type offset=0) |
Copy data to an external data from this array. More... | |
void | copyToDeviceNested () |
Copy all the nested Kokkos arrays including self from host to device. More... | |
void | deepCopy (const ArrayBase< T, dimension > &array) |
Deep copy another Kokkos array If ArrayDeepCopy<T>::value is true, it will copy-construct each entry If ArrayDeepCopy<T>::value is false, it will do a memory copy. More... | |
void | swap (ArrayBase< T, dimension > &array) |
Swap with another Kokkos array. More... | |
KOKKOS_FUNCTION iterator | begin () const |
Get the beginning iterator. More... | |
KOKKOS_FUNCTION iterator | end () const |
Get the end iterator. More... | |
Protected Member Functions | |
void | createInternal (const std::vector< dof_id_type > &n) |
The internal method to initialize and allocate this array. More... | |
void | createInternal (const std::vector< dof_id_type > &n, bool host, bool device) |
The internal method to initialize and allocate this array. More... | |
void | copyInternal (T *target, const T *source, dof_id_type n) |
The internal method to perform a memory copy. More... | |
Protected Attributes | |
dof_id_type | _n [dimension] |
Size of each dimension. More... | |
dof_id_type | _s [dimension] |
Stride of each dimension. More... | |
dof_id_signed_type | _d [dimension] |
Offset of each dimension. More... | |
Private Member Functions | |
usingKokkosArrayBaseMembers (T, 4) | |
Definition at line 1357 of file KokkosArray.h.
|
default |
Default constructor.
|
inline |
|
inline |
Constructor Initialize and allocate array with given dimensions This allocates both host and device data.
n0 | The first dimension size |
n1 | The second dimension size |
n2 | The third dimension size |
n3 | The fourth dimension size |
Definition at line 1393 of file KokkosArray.h.
|
inherited |
Point the device data to an external data instead of allocating it.
ptr | The pointer to the external device data |
Definition at line 538 of file KokkosArray.h.
|
inherited |
Point the host data to an external data instead of allocating it.
ptr | The pointer to the external host data |
Definition at line 523 of file KokkosArray.h.
|
inlineinherited |
Get the beginning iterator.
Definition at line 332 of file KokkosArray.h.
|
inherited |
Copy data from an external data to this array.
ptr | The pointer to the external data |
dir | The copy direction |
n | The number of entries to copy |
offset | The starting offset of this array |
Definition at line 705 of file KokkosArray.h.
|
protectedinherited |
The internal method to perform a memory copy.
TargetSpace | The Kokkos memory space of target data |
Sourcespace | The Kokkos memory space of source data |
target | The pointer to the target data |
source | The pointer to the source data |
n | The number of entries to copy |
Definition at line 634 of file KokkosArray.h.
|
inherited |
Copy data to an external data from this array.
ptr | The pointer to the external data |
dir | The copy direction |
n | The number of entries to copy |
offset | The starting offset of this array |
Definition at line 753 of file KokkosArray.h.
|
inherited |
Copy data from host to device.
Definition at line 657 of file KokkosArray.h.
|
inherited |
Copy all the nested Kokkos arrays including self from host to device.
Definition at line 814 of file KokkosArray.h.
|
inherited |
Copy data from device to host.
Definition at line 681 of file KokkosArray.h.
|
inlineinherited |
Allocate array on host and device.
n | The vector containing the size of each dimension |
Definition at line 228 of file KokkosArray.h.
|
inline |
Initialize and allocate array with given dimensions on host and device.
n0 | The first dimension size |
n1 | The second dimension size |
n2 | The third dimension size |
n3 | The fourth dimension size |
Definition at line 1413 of file KokkosArray.h.
|
inlineinherited |
Allocate array on device only.
n | The vector containing the size of each dimension |
Definition at line 238 of file KokkosArray.h.
|
inline |
Initialize and allocate array with given dimensions on device only.
n0 | The first dimension size |
n1 | The second dimension size |
n2 | The third dimension size |
n3 | The fourth dimension size |
Definition at line 1435 of file KokkosArray.h.
|
inlineinherited |
Allocate array on host only.
n | The vector containing the size of each dimension |
Definition at line 233 of file KokkosArray.h.
|
inline |
Initialize and allocate array with given dimensions on host only.
n0 | The first dimension size |
n1 | The second dimension size |
n2 | The third dimension size |
n3 | The fourth dimension size |
Definition at line 1424 of file KokkosArray.h.
|
protectedinherited |
The internal method to initialize and allocate this array.
host | Whether host data will be allocated |
device | Whether device data will be allocated |
n | The vector containing the size of each dimension |
Definition at line 582 of file KokkosArray.h.
|
protectedinherited |
The internal method to initialize and allocate this array.
n | The vector containing the size of each dimension |
host | The flag whether host data will be allocated |
device | The flag whether device data will be allocated |
Definition at line 619 of file KokkosArray.h.
|
inlineinherited |
Get the data pointer.
Definition at line 171 of file KokkosArray.h.
|
inherited |
Deep copy another Kokkos array If ArrayDeepCopy<T>::value is true, it will copy-construct each entry If ArrayDeepCopy<T>::value is false, it will do a memory copy.
array | The Kokkos array to be deep copied |
Definition at line 824 of file KokkosArray.h.
|
inherited |
Free all data and reset.
Definition at line 444 of file KokkosArray.h.
|
inlineinherited |
Get the device data pointer.
Definition at line 223 of file KokkosArray.h.
|
inlineinherited |
Get the end iterator.
Definition at line 342 of file KokkosArray.h.
|
inlineinherited |
Get the first element.
Definition at line 182 of file KokkosArray.h.
|
inlineinherited |
Get the host data pointer.
Definition at line 218 of file KokkosArray.h.
|
inline |
Initialize array with given dimensions but do not allocate.
n0 | The first dimension size |
n1 | The second dimension size |
n2 | The third dimension size |
n3 | The fourth dimension size |
Definition at line 1402 of file KokkosArray.h.
|
inlineinherited |
Get whether the array was allocated either on host or device.
Definition at line 134 of file KokkosArray.h.
|
inlineinherited |
Get whether the device array was aliased.
Definition at line 154 of file KokkosArray.h.
|
inlineinherited |
Get whether the array was allocated on device.
Definition at line 144 of file KokkosArray.h.
|
inlineinherited |
Get whether the host array was aliased.
Definition at line 149 of file KokkosArray.h.
|
inlineinherited |
Get whether the array was allocated on host.
Definition at line 139 of file KokkosArray.h.
|
inlineinherited |
Get the last element.
Definition at line 193 of file KokkosArray.h.
|
inlineinherited |
Get the size of a dimension.
dim | The dimension index |
Definition at line 165 of file KokkosArray.h.
|
inherited |
Apply starting index offsets to each dimension.
d | The vector containing the offset of each dimension |
Definition at line 642 of file KokkosArray.h.
|
inline |
Set starting index offsets.
d0 | The first dimension offset |
d1 | The second dimension offset |
d2 | The third dimension offset |
d3 | The fourth dimension offset |
Definition at line 1447 of file KokkosArray.h.
|
inline |
Get an array entry.
i0 | The first dimension index |
i1 | The second dimension index |
i2 | The third dimension index |
i3 | The fourth dimension index |
Definition at line 1461 of file KokkosArray.h.
|
inline |
Shallow copy another Kokkos array.
array | The Kokkos array to be shallow copied |
Definition at line 1376 of file KokkosArray.h.
|
inlineinherited |
Get an array entry.
i | The dimensionless index |
Definition at line 205 of file KokkosArray.h.
|
inherited |
Shallow copy another Kokkos array.
array | The Kokkos array to be shallow copied |
Definition at line 495 of file KokkosArray.h.
|
inlineinherited |
|
inherited |
Swap with another Kokkos array.
array | The Kokkos array to be swapped |
Definition at line 859 of file KokkosArray.h.
|
inlineinherited |
Get the reference count.
Definition at line 127 of file KokkosArray.h.
|
private |
|
protectedinherited |
Offset of each dimension.
Definition at line 362 of file KokkosArray.h.
|
protectedinherited |
Size of each dimension.
Definition at line 354 of file KokkosArray.h.
|
protectedinherited |
Stride of each dimension.
Definition at line 358 of file KokkosArray.h.