Namespace Array¶
-
namespace khiva
array
¶ Functions
-
af::array khiva::array
createArray
(void *data, unsigned ndims, dim_t *dims, const int type)¶ Creates an af::array.
- Return
- af::array Containing the data.
- Parameters
data
: Data used to create the af::array.ndims
: Number of dimensions of data.dims
: Cardinality of dimensions of data.type
: Data type.
-
void khiva::array
getData
(af::array array, void *data)¶ Retrieves the data from the device to the host.
- Parameters
array
: The Array that contains the data to be retrieved.data
: Pointer to a preallocated block of memory in the host.
-
af::dim4 khiva::array
getDims
(af::array array)¶ Returns the dimensions from a given array.
- Return
- af::dim4 The dimensions.
- Parameters
array
: Array from which to get the dimensions.
-
void khiva::array
print
(af::array array)¶ Prints the content of an array.
- Parameters
array
: The array to be printed.
-
void khiva::array
deleteArray
(af_array array)¶ Decreases the references count for the given array.
- Parameters
array
: The Array to be deleted.
-
int khiva::array
getType
(af::array array)¶ Gets the type of the array.
- Return
- int Value of the Dtype enumeration.
- Parameters
array
: The array to obtain the type from.
-
template <class T>
class khiva::arrayArray
¶ - #include </home/docs/checkouts/readthedocs.org/user_builds/khiva/checkouts/v0.1.0/include/khiva/array.h>
Array class, This class provides functionality manage Arrays on the host side.
Public Functions
-
khiva::array::Array
Array
(af::array in)¶ Constructor of Array class which receives and af::array.
- Parameters
in
: The input af::array.
-
void khiva::array::Array
setNumX
(int val)¶ Sets the cardinality of the first dimension.
- Parameters
val
: The value to be set.
-
void khiva::array::Array
setNumY
(int val)¶ Sets the cardinality of the second dimension.
- Parameters
val
: The value to be set.
-
void khiva::array::Array
setNumW
(int val)¶ Sets the cardinality of the third dimension.
- Parameters
val
: The value to be set.
-
void khiva::array::Array
setNumZ
(int val)¶ Sets the cardinality of the fourth dimension.
- Parameters
val
: The value to be set.
-
void khiva::array::Array
setData
(T *pd)¶ Sets the data to be stored in the Array.
- Parameters
pd
: The data to be stored.
-
int khiva::array::Array
getNumX
()¶ Gets the cardinality of the first dimension.
- Return
- int the Cardinality of the first dimension.
-
int khiva::array::Array
getNumY
()¶ Gets the cardinality of the second dimension.
- Return
- int the Cardinality of the second dimension.
-
int khiva::array::Array
getNumW
()¶ Gets the cardinality of the third dimension.
- Return
- int the Cardinality of the third dimension.
-
int khiva::array::Array
getNumZ
()¶ Gets the cardinality of the fourth dimension.
- Return
- int the Cardinality of the fourth dimension.
-
int khiva::array::Array
getNumElements
()¶ Gets the number of elements in data.
- Return
- int the Cardinality of the number of elements.
-
std::vector<T> khiva::array::Array
getRow
(int idx)¶ Gets the row number given by idx.
- Return
- std::vector Containing the selected row.
- Parameters
idx
: The row number to be extracted.
-
std::vector<T> khiva::array::Array
getColumn
(int idx)¶ Gets the column number given by idx.
- Return
- std::vector Containing the selected column.
- Parameters
idx
: The column number to be extracted.
-
T khiva::array::Array
getElement
(int row, int column)¶ Gets the element given by row and column.
- Return
- T The element to be extracted.
- Parameters
row
: The row number.column
: The column number.
-
T *khiva::array::Array
getData
()¶ Gets a pointer to the data stored in the array.
- Return
- T Pointer to data.
-
khiva::array::Array
-
af::array khiva::array