Documentation
|
|
The C interface for sort. More...
Device pointer interface: Sort the input values | ||||||||||||||||||||||||||||
Sort an array of values along specified dimension. Output both values and indices.
| ||||||||||||||||||||||||||||
| 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. More... | ||||||||||||||||||||||||||||
| 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. More... | ||||||||||||||||||||||||||||
| 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. More... | ||||||||||||||||||||||||||||
| 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. More... | ||||||||||||||||||||||||||||
The C interface for sort.
Sorting an array reorders the elements in the array along the dimension specified.
The defualt order is ascending order. That is, the smallest element along the dimension is places at the first index location and the largest element is placed at the last location. To sort in descending order, set the isdescending flag to true.
The indices array parameter can be used to retrieve the indices of the elements before the sort.
The next sort function can sort the values of an array (value) based on another array (key). The function first sorts the key array and uses the indices from this sort to reorder the value array.
The function sortdim uses one of the dimensions as key to sort the array.
| 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.