A high-performance general-purpose compute library

- Main Page
- Tutorials
- Release Notes
- Examples

Functions
createStridedArray
ArrayFire Functions by Category » Functions to work with internal array layout

## 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

## ◆ af_create_strided_array()

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] | 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.

## ◆ createStridedArray()

AFAPI array createStridedArray | ( | const void * | data,
|  | const dim_t | offset,
|  | const dim4 | dims,
|  | const dim4 | strides,
|  | const af::dtype | ty,
|  | const af::source | location )

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.