ArrayFire: createStridedArray (original) (raw)
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) |
Create an array with specified strides and offset.
◆ af_create_strided_array()
Parameters
| [out] | arr | an af_array with specified offset, dimensions and strides. |
|---|---|---|
| [in] | data | is the raw data pointer. |
| [in] | offset | specifies the number of elements to skip. |
| [in] | ndims | specifies the number of array dimensions. |
| [in] | dims | specifies the dimensions for the region of interest. |
| [in] | strides | specifies the distance between each element of a given dimension. |
| [in] | ty | specifies the data type of data. |
| [in] | location | specifies if the data is on host or the device. |
Note
If location is afHost, a memory copy is performed.
Parameters
| [in] | data | is the raw data pointer. |
|---|---|---|
| [in] | offset | specifies the number of elements to skip. |
| [in] | dims | specifies the dimensions for the region of interest. |
| [in] | strides | specifies the distance between each element of a given dimension. |
| [in] | ty | specifies the data type of data. |
| [in] | location | specifies 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.