@@ -8,46 +8,46 @@ includes a test suite which can be built and run to test the sorting algorithms
88for correctness. It also has benchmarking code to compare its performance
99relative to std::sort. The following API's are currently supported:
1010
11- ### Quicksort
11+ #### Quicksort
1212
1313```
14- avx512_qsort<T>(T* arr, int64_t arrsize)
14+ void avx512_qsort<T>(T* arr, int64_t arrsize)
1515```
1616Supported datatypes: `uint16_t, int16_t, _ Float16, uint32_t, int32_t, float,
1717uint64_t, int64_t and double`
1818
19- ### Argsort
19+ #### Argsort
2020
2121```
22- std::vector<int64_t> arg = avx512_argsort(T* arr, int64_t arrsize)
23- void avx512_argsort(T* arr, int64_t *arg, int64_t arrsize)
22+ std::vector<int64_t> arg = avx512_argsort<T> (T* arr, int64_t arrsize)
23+ void avx512_argsort<T> (T* arr, int64_t *arg, int64_t arrsize)
2424```
2525Supported datatypes: ` uint32_t, int32_t, float, uint64_t, int64_t and double ` .
26- The algorithm resorts to scalar std::sort if the array contains NAN.
26+ The algorithm resorts to scalar ` std::sort ` if the array contains NAN.
2727
28- ### Quickselect
28+ #### Quickselect
2929
3030```
31- avx512_qselect<T>(T* arr, int64_t arrsize)
32- avx512_qselect<T>(T* arr, int64_t arrsize, bool hasnan)
31+ void avx512_qselect<T>(T* arr, int64_t arrsize)
32+ void avx512_qselect<T>(T* arr, int64_t arrsize, bool hasnan)
3333```
3434Supported datatypes: `uint16_t, int16_t, _ Float16 ,uint32_t, int32_t, float,
3535uint64_t, int64_t and double` . Use an additional optional argument ` bool
3636hasnan` if you expect your arrays to contain nan.
3737
38- ### Partialsort
38+ #### Partialsort
3939
4040```
41- avx512_partialsort<T>(T* arr, int64_t arrsize)
42- avx512_partialsort<T>(T* arr, int64_t arrsize, bool hasnan)
41+ void avx512_partialsort<T>(T* arr, int64_t arrsize)
42+ void avx512_partialsort<T>(T* arr, int64_t arrsize, bool hasnan)
4343```
4444Supported datatypes: `uint16_t, int16_t, _ Float16 ,uint32_t, int32_t, float,
4545uint64_t, int64_t and double` . Use an additional optional argument ` bool
4646hasnan` if you expect your arrays to contain nan.
4747
48- ### Key-value sort
48+ #### Key-value sort
4949```
50- avx512_qsort_kv<T>(T* key, uint64_t* value , int64_t arrsize)
50+ void avx512_qsort_kv<T>(T* key, uint64_t* value , int64_t arrsize)
5151```
5252Supported datatypes: ` uint64_t, int64_t and double `
5353
@@ -70,7 +70,7 @@ If you expect your array to contain NANs, please be aware that the these
7070routines ** do not preserve your NANs as you pass them** . The quicksort,
7171quickselect, partialsort and key-value sorting routines will sort NAN's to the
7272end of the array and replace them with ` std::nan("1") ` . ` avx512_argsort `
73- routines will also resort to a scalar argsort that uses std::sort to sort array
73+ routines will also resort to a scalar argsort that uses ` std::sort ` to sort array
7474that contains NAN.
7575
7676## Example to include and build this in a C++ code
@@ -81,7 +81,7 @@ that contains NAN.
8181#include " src/avx512-32bit-qsort.hpp"
8282
8383int main () {
84- const int ARRSIZE = 10 ;
84+ const int ARRSIZE = 1000 ;
8585 std::vector<float> arr;
8686
8787 /* Initialize elements is reverse order */
0 commit comments