The C interface for reorder. More...

Device pointer interface: Reorder the input matrix

Reorder (rearrange) the dimensions of an array.

Transpose is a special case of reorder: swap the first two dimension

Parameters
[out]d_outShifted array
[in]ndimsNumber of dimensions in array dims
[in]dimsDimensions of d_in
[in]npermsNumber of dimensions indicated in the permutation array perms
[in]permsZero-based array indicating new order of dimensions, e.g. [1 0 2] swaps the first two dimensions, [2 1 0] swaps the first and third dimensions.
[in]d_inOriginal array.
[in]batchNumber of tiles in batch.
afError af_reorder_B (bool *d_out, unsigned ndims, const unsigned *dims, int nperms, const int *perms, const bool *d_in, unsigned batch)
 Boolean (8-bit) array reorder. More...
 
afError af_reorder_I (int *d_out, unsigned ndims, const unsigned *dims, int nperms, const int *perms, const int *d_in, unsigned batch)
 Integer array reorder. More...
 
afError af_reorder_U (unsigned *d_out, unsigned ndims, const unsigned *dims, int nperms, const int *perms, const unsigned *d_in, unsigned batch)
 Unsigned integer array reorder. More...
 
afError af_reorder_S (float *d_out, unsigned ndims, const unsigned *dims, int nperms, const int *perms, const float *d_in, unsigned batch)
 Single-precision array reorder. More...
 
afError af_reorder_D (double *d_out, unsigned ndims, const unsigned *dims, int nperms, const int *perms, const double *d_in, unsigned batch)
 Double-precision array reorder. More...
 
afError af_reorder_C (cfloat *d_out, unsigned ndims, const unsigned *dims, int nperms, const int *perms, const cfloat *d_in, unsigned batch)
 Complex single-precision array reorder. More...
 
afError af_reorder_Z (cdouble *d_out, unsigned ndims, const unsigned *dims, int nperms, const int *perms, const cdouble *d_in, unsigned batch)
 Complex double-precision array reorder. More...
 

Detailed Description

The C interface for reorder.

array a(seq(3));
a = tile(a,1,3); //a = [0 0 0]
// [1 1 1]
// [2 2 2]
a = reorder(a, 1, 0); //Switch first and second dimension
//a = [0 1 2]
// [0 1 2]
// [0 1 2]

Function Documentation

afError af_reorder_B ( bool *  d_out,
unsigned  ndims,
const unsigned *  dims,
int  nperms,
const int *  perms,
const bool *  d_in,
unsigned  batch 
)

Boolean (8-bit) array reorder.

afError af_reorder_I ( int *  d_out,
unsigned  ndims,
const unsigned *  dims,
int  nperms,
const int *  perms,
const int *  d_in,
unsigned  batch 
)

Integer array reorder.

afError af_reorder_U ( unsigned *  d_out,
unsigned  ndims,
const unsigned *  dims,
int  nperms,
const int *  perms,
const unsigned *  d_in,
unsigned  batch 
)

Unsigned integer array reorder.

afError af_reorder_S ( float *  d_out,
unsigned  ndims,
const unsigned *  dims,
int  nperms,
const int *  perms,
const float *  d_in,
unsigned  batch 
)

Single-precision array reorder.

afError af_reorder_D ( double *  d_out,
unsigned  ndims,
const unsigned *  dims,
int  nperms,
const int *  perms,
const double *  d_in,
unsigned  batch 
)

Double-precision array reorder.

afError af_reorder_C ( cfloat d_out,
unsigned  ndims,
const unsigned *  dims,
int  nperms,
const int *  perms,
const cfloat d_in,
unsigned  batch 
)

Complex single-precision array reorder.

afError af_reorder_Z ( cdouble d_out,
unsigned  ndims,
const unsigned *  dims,
int  nperms,
const int *  perms,
const cdouble d_in,
unsigned  batch 
)

Complex double-precision array reorder.