@@ -8,46 +8,46 @@ includes a test suite which can be built and run to test the sorting algorithms
8
8
for correctness. It also has benchmarking code to compare its performance
9
9
relative to std::sort. The following API's are currently supported:
10
10
11
- ### Quicksort
11
+ #### Quicksort
12
12
13
13
```
14
- avx512_qsort<T>(T* arr, int64_t arrsize)
14
+ void avx512_qsort<T>(T* arr, int64_t arrsize)
15
15
```
16
16
Supported datatypes: `uint16_t, int16_t, _ Float16, uint32_t, int32_t, float,
17
17
uint64_t, int64_t and double`
18
18
19
- ### Argsort
19
+ #### Argsort
20
20
21
21
```
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)
24
24
```
25
25
Supported 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.
27
27
28
- ### Quickselect
28
+ #### Quickselect
29
29
30
30
```
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)
33
33
```
34
34
Supported datatypes: `uint16_t, int16_t, _ Float16 ,uint32_t, int32_t, float,
35
35
uint64_t, int64_t and double` . Use an additional optional argument ` bool
36
36
hasnan` if you expect your arrays to contain nan.
37
37
38
- ### Partialsort
38
+ #### Partialsort
39
39
40
40
```
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)
43
43
```
44
44
Supported datatypes: `uint16_t, int16_t, _ Float16 ,uint32_t, int32_t, float,
45
45
uint64_t, int64_t and double` . Use an additional optional argument ` bool
46
46
hasnan` if you expect your arrays to contain nan.
47
47
48
- ### Key-value sort
48
+ #### Key-value sort
49
49
```
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)
51
51
```
52
52
Supported datatypes: ` uint64_t, int64_t and double `
53
53
@@ -70,7 +70,7 @@ If you expect your array to contain NANs, please be aware that the these
70
70
routines ** do not preserve your NANs as you pass them** . The quicksort,
71
71
quickselect, partialsort and key-value sorting routines will sort NAN's to the
72
72
end 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
74
74
that contains NAN.
75
75
76
76
## Example to include and build this in a C++ code
@@ -81,7 +81,7 @@ that contains NAN.
81
81
#include " src/avx512-32bit-qsort.hpp"
82
82
83
83
int main () {
84
- const int ARRSIZE = 10 ;
84
+ const int ARRSIZE = 1000 ;
85
85
std::vector<float> arr;
86
86
87
87
/* Initialize elements is reverse order */
0 commit comments