Create an array with specified strides and offset. More...

Functions

AFAPI array createStridedArray (const void *data, const dim_t offset, const dim4 dims, const dim4 strides, const af::dtype ty, const af::source location)
 
AFAPI af_err af_create_strided_array (af_array *arr, const void *data, const dim_t offset, const unsigned ndims, const dim_t *const dims, const dim_t *const strides, const af_dtype ty, const af_source location)
 

Detailed Description

Create an array with specified strides and offset.

Function Documentation

AFAPI af_err af_create_strided_array ( af_array arr,
const void *  data,
const dim_t  offset,
const unsigned  ndims,
const dim_t *const  dims,
const dim_t *const  strides,
const af_dtype  ty,
const af_source  location 
)
Parameters
[out]arran af_array with specified offset, dimensions and strides.
[in]datais the raw data pointer.
[in]offsetspecifies the number of elements to skip.
[in]ndimsspecifies the number of array dimensions.
[in]dimsspecifies the dimensions for the region of interest.
[in]stridesspecifies the distance between each element of a given dimension.
[in]tyspecifies the data type of data.
[in]locationspecifies if the data is on host or the device.
Note
If location is afHost, a memory copy is performed.
AFAPI array af::createStridedArray ( const void *  data,
const dim_t  offset,
const dim4  dims,
const dim4  strides,
const af::dtype  ty,
const af::source  location 
)
Parameters
[in]datais the raw data pointer.
[in]offsetspecifies the number of elements to skip.
[in]dimsspecifies the dimensions for the region of interest.
[in]stridesspecifies the distance between each element of a given dimension.
[in]tyspecifies the data type of data.
[in]locationspecifies if the data is on host or the device.
Note
: If location is afHost, a memory copy is performed.
Returns
an af::array() with specified offset, dimensions and strides.