The C interface for shift. More...

Device pointer interface: Shift is host pointer

Shift the contents of an array along specified dimensions and wrap.

Parameters
[out]d_outShifted array
[in]ndimsNumber of dimensions in array dims
[in]dimsArray of dimensions
[in]nshiftsNumber of shifts in array shifts
[in]h_shiftsArray(on host) indicating extent of shift along each dimension, e.g. [1 0 -2] shifts forward once in first dimension, none in second dimension, and back twice in third dimension.
[in]d_inOriginal array.
[in]batchNumber of tiles of input
afError af_shift_B (bool *d_out, unsigned ndims, const unsigned *dims, int nshifts, const int *h_shifts, const bool *d_in, unsigned batch)
 Boolean (8-bit) array shift. More...
 
afError af_shift_I (int *d_out, unsigned ndims, const unsigned *dims, int nshifts, const int *h_shifts, const int *d_in, unsigned batch)
 32-bit signed integer array shift. More...
 
afError af_shift_U (unsigned *d_out, unsigned ndims, const unsigned *dims, int nshifts, const int *h_shifts, const unsigned *d_in, unsigned batch)
 32-bit unsigned integer array shift. More...
 
afError af_shift_S (float *d_out, unsigned ndims, const unsigned *dims, int nshifts, const int *h_shifts, const float *d_in, unsigned batch)
 Single-precision array shift. More...
 
afError af_shift_D (double *d_out, unsigned ndims, const unsigned *dims, int nshifts, const int *h_shifts, const double *d_in, unsigned batch)
 Double-precision array shift. More...
 
afError af_shift_C (cfloat *d_out, unsigned ndims, const unsigned *dims, int nshifts, const int *h_shifts, const cfloat *d_in, unsigned batch)
 Complex single-precision array shift. More...
 
afError af_shift_Z (cdouble *d_out, unsigned ndims, const unsigned *dims, int nshifts, const int *h_shifts, const cdouble *d_in, unsigned batch)
 Complex double-precision array shift. More...
 

Detailed Description

The C interface for shift.

array a(seq(5)); //a=[0 1 2 3 4]
a = shift(a,2); //a=[3 4 0 1 2]
array a(seq(5)); //a=[0 1 2 3 4]
array b = constant(1,1,af::s32);
a = shift(a,b); //a=[4 0 1 2 3]

Function Documentation

afError af_shift_B ( bool *  d_out,
unsigned  ndims,
const unsigned *  dims,
int  nshifts,
const int *  h_shifts,
const bool *  d_in,
unsigned  batch 
)

Boolean (8-bit) array shift.

afError af_shift_I ( int *  d_out,
unsigned  ndims,
const unsigned *  dims,
int  nshifts,
const int *  h_shifts,
const int *  d_in,
unsigned  batch 
)

32-bit signed integer array shift.

afError af_shift_U ( unsigned *  d_out,
unsigned  ndims,
const unsigned *  dims,
int  nshifts,
const int *  h_shifts,
const unsigned *  d_in,
unsigned  batch 
)

32-bit unsigned integer array shift.

afError af_shift_S ( float *  d_out,
unsigned  ndims,
const unsigned *  dims,
int  nshifts,
const int *  h_shifts,
const float *  d_in,
unsigned  batch 
)

Single-precision array shift.

afError af_shift_D ( double *  d_out,
unsigned  ndims,
const unsigned *  dims,
int  nshifts,
const int *  h_shifts,
const double *  d_in,
unsigned  batch 
)

Double-precision array shift.

afError af_shift_C ( cfloat d_out,
unsigned  ndims,
const unsigned *  dims,
int  nshifts,
const int *  h_shifts,
const cfloat d_in,
unsigned  batch 
)

Complex single-precision array shift.

afError af_shift_Z ( cdouble d_out,
unsigned  ndims,
const unsigned *  dims,
int  nshifts,
const int *  h_shifts,
const cdouble d_in,
unsigned  batch 
)

Complex double-precision array shift.