Create, release, copy, fetch-properties of af_array. More...
Functions | |
AFAPI af_err | af_device_array (af_array *arr, void *data, const unsigned ndims, const dim_t *const dims, const af_dtype type) |
Create array from device memory. More... | |
AFAPI af_err | af_create_array (af_array *arr, const void *const data, const unsigned ndims, const dim_t *const dims, const af_dtype type) |
Create an af_array handle initialized with user defined data. More... | |
AFAPI af_err | af_create_handle (af_array *arr, const unsigned ndims, const dim_t *const dims, const af_dtype type) |
Create af_array handle. More... | |
AFAPI af_err | af_copy_array (af_array *arr, const af_array in) |
Deep copy an array to another. More... | |
AFAPI af_err | af_write_array (af_array arr, const void *data, const size_t bytes, af_source src) |
Copy data from a C pointer (host/device) to an existing array. More... | |
AFAPI af_err | af_get_data_ptr (void *data, const af_array arr) |
Copy data from an af_array to a C pointer. More... | |
AFAPI af_err | af_release_array (af_array arr) |
Reduce the reference count of the af_array. More... | |
AFAPI af_err | af_retain_array (af_array *out, const af_array in) |
Increments an af_array reference count. More... | |
AFAPI af_err | af_get_data_ref_count (int *use_count, const af_array in) |
Get the reference count of af_array. More... | |
AFAPI af_err | af_eval (af_array in) |
Evaluate any expressions in the Array. More... | |
AFAPI af_err | af_eval_multiple (const int num, af_array *arrays) |
Evaluate multiple arrays together. More... | |
AFAPI af_err | af_set_manual_eval_flag (bool flag) |
Turn the manual eval flag on or off. More... | |
AFAPI af_err | af_get_manual_eval_flag (bool *flag) |
Get the manual eval flag. More... | |
AFAPI af_err | af_get_elements (dim_t *elems, const af_array arr) |
Get the total number of elements across all dimensions of the array. More... | |
AFAPI af_err | af_get_type (af_dtype *type, const af_array arr) |
Gets the type of an array. More... | |
AFAPI af_err | af_get_dims (dim_t *d0, dim_t *d1, dim_t *d2, dim_t *d3, const af_array arr) |
Gets the dimensions of an array. More... | |
AFAPI af_err | af_get_numdims (unsigned *result, const af_array arr) |
Gets the number of dimensions of an array. More... | |
AFAPI af_err | af_is_empty (bool *result, const af_array arr) |
Check if an array is empty. More... | |
AFAPI af_err | af_is_scalar (bool *result, const af_array arr) |
Check if an array is scalar, ie. More... | |
AFAPI af_err | af_is_row (bool *result, const af_array arr) |
Check if an array is row vector. More... | |
AFAPI af_err | af_is_column (bool *result, const af_array arr) |
Check if an array is a column vector. More... | |
AFAPI af_err | af_is_vector (bool *result, const af_array arr) |
Check if an array is a vector. More... | |
AFAPI af_err | af_is_complex (bool *result, const af_array arr) |
Check if an array is complex type. More... | |
AFAPI af_err | af_is_real (bool *result, const af_array arr) |
Check if an array is real type. More... | |
AFAPI af_err | af_is_double (bool *result, const af_array arr) |
Check if an array is double precision type. More... | |
AFAPI af_err | af_is_single (bool *result, const af_array arr) |
Check if an array is single precision type. More... | |
AFAPI af_err | af_is_half (bool *result, const af_array arr) |
Check if an array is 16 bit floating point type. More... | |
AFAPI af_err | af_is_realfloating (bool *result, const af_array arr) |
Check if an array is real floating point type. More... | |
AFAPI af_err | af_is_floating (bool *result, const af_array arr) |
Check if an array is floating precision type. More... | |
AFAPI af_err | af_is_integer (bool *result, const af_array arr) |
Check if an array is integer type. More... | |
AFAPI af_err | af_is_bool (bool *result, const af_array arr) |
Check if an array is bool type. More... | |
AFAPI af_err | af_is_sparse (bool *result, const af_array arr) |
Check if an array is sparse. More... | |
AFAPI af_err | af_get_scalar (void *output_value, const af_array arr) |
Get first element from an array. More... | |
Create, release, copy, fetch-properties of af_array.
AFAPI af_err af_create_array | ( | af_array * | arr, |
const void *const | data, | ||
const unsigned | ndims, | ||
const dim_t *const | dims, | ||
const af_dtype | type | ||
) |
Create an af_array handle initialized with user defined data.
This function will create an af_array handle from the memory provided in data
.
[out] | arr | The pointer to the returned object. |
[in] | data | The data which will be loaded into the array |
[in] | ndims | The number of dimensions read from the dims parameter |
[in] | dims | A C pointer with ndims elements. Each value represents the size of that dimension |
[in] | type | The type of the af_array object |
AFAPI af_err af_create_handle | ( | af_array * | arr, |
const unsigned | ndims, | ||
const dim_t *const | dims, | ||
const af_dtype | type | ||
) |
Create af_array handle.
To release the memory allocated by this call you would have to call af_release_array once your use of this af_array is complete.
[out] | arr | The pointer to the retured object. |
[in] | ndims | The number of dimensions read from the dims parameter |
[in] | dims | A C pointer with ndims elements. Each value represents the size of that dimension |
[in] | type | The type of the af_array object |
AFAPI af_err af_device_array | ( | af_array * | arr, |
void * | data, | ||
const unsigned | ndims, | ||
const dim_t *const | dims, | ||
const af_dtype | type | ||
) |
Create array from device memory.
Evaluate multiple arrays together.
Copy data from an af_array to a C pointer.
Needs to used in conjunction with the two functions above
Get the reference count of af_array.
Gets the dimensions of an array.
[out] | d0 | is the output that contains the size of first dimension of arr |
[out] | d1 | is the output that contains the size of second dimension of arr |
[out] | d2 | is the output that contains the size of third dimension of arr |
[out] | d3 | is the output that contains the size of fourth dimension of arr |
[in] | arr | is the input array |
Get the total number of elements across all dimensions of the array.
[out] | elems | is the output that contains number of elements of arr |
[in] | arr | is the input array |
Gets the number of dimensions of an array.
[out] | result | is the output that contains the number of dims of arr |
[in] | arr | is the input array |
Get first element from an array.
[out] | output_value | is the element requested |
[in] | arr | is the input array |
Gets the type of an array.
[out] | type | is the output that contains the type of arr |
[in] | arr | is the input array |
Check if an array is bool type.
[out] | result | is true if arr is of b8 type, otherwise false |
[in] | arr | is the input array |
Check if an array is a column vector.
[out] | result | is true if arr has dims [x 1 1 1], false otherwise |
[in] | arr | is the input array |
Check if an array is empty.
[out] | result | is true if elements of arr is 0, otherwise false |
[in] | arr | is the input array |
Check if an array is floating precision type.
This is a combination of af_is_realfloating and af_is_complex
[out] | result | is true if arr is of type f16 f32, f64, c32 or c64, otherwise false |
[in] | arr | is the input array |
Check if an array is 16 bit floating point type.
[out] | result | is true if arr is of type f16 otherwise false |
[in] | arr | is the input array |
Check if an array is integer type.
[out] | result | is true if arr is of integer types, otherwise false |
[in] | arr | is the input array |
Check if an array is row vector.
[out] | result | is true if arr has dims [1 x 1 1], false otherwise |
[in] | arr | is the input array |
Check if an array is scalar, ie.
single element.
[out] | result | is true if elements of arr is 1, otherwise false |
[in] | arr | is the input array |
Check if an array is sparse.
[out] | result | is true if arr is sparse, otherwise false |
[in] | arr | is the input array |
Check if an array is a vector.
A vector is any array that has exactly 1 dimension not equal to 1.
[out] | result | is true if arr is a vector, false otherwise |
[in] | arr | is the input array |
Reduce the reference count of the af_array.
Increments an af_array reference count.