README.md 1.76 KB
Newer Older
Berenger Bramas's avatar
Berenger Bramas committed
1 2 3 4
Berenger Bramas - MPCDF (berenger.bramas@mpcdf.mpg.de)

## AVX-512 sort functions

Berenger Bramas's avatar
Berenger Bramas committed
5
This project is a small library that provides fast functions to sort array of int or double or int[2] using AVX-512.
Berenger Bramas's avatar
Berenger Bramas committed
6
A paper describes the different strategies, it is currently under review, but drafts are available at https://arxiv.org/abs/1704.08579 for the KNL.
7
An appendix that contains results for the Skylake architecture is available at http://berenger.eu/blog/wp-content/uploads/2017/06/avxsort.pdf or https://datashare.rzg.mpg.de/s/QCBTOdc5r0daqNt .
Berenger Bramas's avatar
Berenger Bramas committed
8
If you use this software, we would appreciate that you cite the AXIV document (and later the maybe published version).
Berenger Bramas's avatar
Berenger Bramas committed
9

Berenger Bramas's avatar
Berenger Bramas committed
10 11

The branch `paper` contains some not very clean files that were used for benchmarks,
Berenger Bramas's avatar
Berenger Bramas committed
12
wherease the current master branch provides an header only library:
Berenger Bramas's avatar
Berenger Bramas committed
13 14
- sort512.hpp : the library that can be directly include in any code to sort integer or double
- sort512kv.hpp : the library that can be directly include in any code to sort key/value pairs of integers
Berenger Bramas's avatar
Berenger Bramas committed
15 16 17 18 19 20 21 22 23
- sort512test.cpp : some unit tests (can be used for examples)

##  Functions
- Sort512::Sort(); to sort an array
- Sort512::SortOmp(); to sort in parallel (need openmp)
- Sort512::Partition512(); to partition
- Sort512::SmallSort16V(); to sort a small array (should be less than 16 AVX512 vectors)


Berenger Bramas's avatar
Berenger Bramas committed
24
## AVX 512 compilation flags (KNL)
Berenger Bramas's avatar
Berenger Bramas committed
25 26 27
- Gcc : -mavx512f -mavx512pf -mavx512er -mavx512cd
- Intel : -xCOMMON-AVX512 -xMIC-AVX512

Berenger Bramas's avatar
Berenger Bramas committed
28 29 30 31 32
## AVX 512 compilation flags (SKL)
- Gcc : -mavx512f -mavx512cd -mavx512vl -mavx512bw -mavx512dq
- Intel : -xCOMMON-AVX512 -xCORE-AVX512

## OpenMP compilation flags
Berenger Bramas's avatar
Berenger Bramas committed
33 34 35 36 37 38 39
In case you want to use the parallel sort, you need to add the flag:
- Gcc :  -fopenmp
- Intel :  -qopenmp

## Using Intel SDE

Anyone can test the code without having a KNL by using the Intel SDE