Do more. Code less. Free software for GPU computing.
<scroll to top>

Sort along dimension

Sorting

Sort an array of values along specified dimension. More...

Device pointer interface: Sort the input values

Parameters:
[out]d_sortedSorted values
[out]d_IndicesIndices indicating original positions. One indexed
[in]ndimsNumber of dimensions in dims
[in]dimsDimensions of input
[in]d_inputOriginal array values
[in]DIRSort direction: true in descending order, false in ascending order.
[in]dimDimension to sort along (first dimension is zero)
[in]batchNumber of tiles in batch.
[in]base_oneTo shift indices to one-based.

afError af_sort_S (float *d_sorted, float *d_Indices, unsigned ndims, const unsigned *dims, float *d_input, bool DIR, unsigned dim, unsigned batch, bool base_one=false)
 Single-precision sort.
afError af_sort_D (double *d_sorted, double *d_Indices, unsigned ndims, const unsigned *dims, double *d_input, bool DIR, unsigned dim, unsigned batch, bool base_one=false)
 Double-precision sort.
afError af_sort_I (int *d_sorted, int *d_Indices, unsigned ndims, const unsigned *dims, int *d_input, bool DIR, unsigned dim, unsigned batch, bool base_one=false)
 32-bit Integer sort.
afError af_sort_U (unsigned *d_sorted, unsigned *d_Indices, unsigned ndims, const unsigned *dims, unsigned *d_input, bool DIR, unsigned dim, unsigned batch, bool base_one=false)
 32-bit Unsigned Integer sort.

Detailed Description

Sort an array of values along specified dimension.

Output both values and indices.


Function Documentation

afError af_sort_S ( float *  d_sorted,
float *  d_Indices,
unsigned  ndims,
const unsigned *  dims,
float *  d_input,
bool  DIR,
unsigned  dim,
unsigned  batch,
bool  base_one = false 
)

Single-precision sort.

afError af_sort_D ( double *  d_sorted,
double *  d_Indices,
unsigned  ndims,
const unsigned *  dims,
double *  d_input,
bool  DIR,
unsigned  dim,
unsigned  batch,
bool  base_one = false 
)

Double-precision sort.

afError af_sort_I ( int *  d_sorted,
int *  d_Indices,
unsigned  ndims,
const unsigned *  dims,
int *  d_input,
bool  DIR,
unsigned  dim,
unsigned  batch,
bool  base_one = false 
)

32-bit Integer sort.

afError af_sort_U ( unsigned *  d_sorted,
unsigned *  d_Indices,
unsigned  ndims,
const unsigned *  dims,
unsigned *  d_input,
bool  DIR,
unsigned  dim,
unsigned  batch,
bool  base_one = false 
)

32-bit Unsigned Integer sort.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines