|
| ArrayIR () |
| Creates an empty object with nullptr as the data pointer. More...
|
|
| ArrayIR (ArrayIR const &&rhs) |
| Move constructor. More...
|
|
| ArrayIR (ArrayIR const &rhs) |
| Copy constructor. More...
|
|
| ArrayIR (T *data, std::array< size_t, N > dimensions, int memory_type, char const *label="") |
| Creates an ArrayIR object with the given data, dimensions, memory type, and optional label. More...
|
|
| ~ArrayIR () |
|
T * | data () const |
| Get the data pointer. More...
|
|
bool | data_valid_on_device () const |
| Determine if the data pointer is valid on the device. More...
|
|
bool | data_valid_on_host () const |
| Determine if the data pointer is valid on the host. More...
|
|
size_t | dimension (int i) const |
| Get the extent of the dimension of the provided index. More...
|
|
bool | empty () const |
| Is this ArrayIR object invalid (does it point to nullptr)? More...
|
|
size_t | extent (int i) const |
| Get the extent of the dimension of the provided index. More...
|
|
T * | get_data () const |
| Get the data pointer. More...
|
|
T * | get_data_pointer () const |
| Get the data pointer. More...
|
|
const char * | get_label () const |
| Get the label for this array. More...
|
|
int | get_memory_type () const |
| Get the memory type for this array object (MEMORY_HOST, MEMORY_DEVICE, or MEMORY_SHARED) More...
|
|
bool | is_empty () const |
| Is this ArrayIR object invalid (does it point to nullptr)? More...
|
|
bool | is_valid () const |
| Is this ArrayIR object valid (does it point to something other than nullptr)? More...
|
|
const char * | label () const |
| Get the label for this array. More...
|
|
int | memory_type () const |
| Get the memory type for this array object (MEMORY_HOST, MEMORY_DEVICE, or MEMORY_SHARED) More...
|
|
ArrayIR & | operator= (ArrayIR const &&rhs) |
| Move constructor. More...
|
|
ArrayIR & | operator= (ArrayIR const &rhs) |
| Copy constructor. More...
|
|
std::array< size_t, N > | shape () const |
| Get the shape of the array as a std::array<size_t,N> More...
|
|
bool | valid () const |
| Is this ArrayIR object valid (does it point to something other than nullptr)? More...
|
|
template<class T, int N>
class array_ir::ArrayIR< T, N >
The ArrayIR class holds library-agnostic Array metadata to make it easy to transfer array objects between different C++ libraries.
This holds intermediate representation of Array information for transformation between C++ portability libraries ArrayIR is only valid on the host and cannot be used directly in kernels. Please transform to your portability library's Array representation first, and then use that inside kernels. ArrayIR pointers are always assumed to point to contiguous data Dimensions passed to the constructor and accessed via extent() are always assumed to have the right-most dimension varying the fastest. You purposefully cannot use an operator() to get the data because you should only be using this class to transfer Array metadata from one C++ portability framework to another. The ArrayIR is completely un-owned, and it is up to the user to ensure data described by an ArrayIR object remains valid while being used by another portability framework.
- Parameters
-
T | The type of the array |
N | The rank (dimensionality) of the array |