Commit 15d4ce09 authored by Berenger Bramas's avatar Berenger Bramas

Update readme and make it compile without openmp

parent d48d0f52
Pipeline #67782 failed with stage
......@@ -15,6 +15,8 @@ wherease the current master branch provides an header only library:
- sort512kv.hpp : the library that can be directly included in any code to sort key/value pairs of integers
- sort512test.cpp : some unit tests (can be used for examples)
Note that the official repository is https://gitlab.inria.fr/bramas/avx-512-sort
## Functions
- Sort512::Sort(); to sort an array
- Sort512::SortOmp(); to sort in parallel (need openmp)
......@@ -30,6 +32,10 @@ wherease the current master branch provides an header only library:
- Gcc : -mavx512f -mavx512cd -mavx512vl -mavx512bw -mavx512dq
- Intel : -xCOMMON-AVX512 -xCORE-AVX512
## ARCH compilation flags
Use "-march=native -mtune=native" if you are already on the right platform ("native can be replaced by "knl" or "skylake")
## OpenMP compilation flags
In case you want to use the parallel sort, you need to add the flag:
- Gcc : -fopenmp
......@@ -37,4 +43,8 @@ In case you want to use the parallel sort, you need to add the flag:
## Using Intel SDE
Anyone can test the code without having a KNL by using the Intel SDE
\ No newline at end of file
Anyone can test the code without having a KNL by using the Intel SDE
## Knowing more about the number of instructions
Please checkout the branch "feature/counters" to have access to counters.
......@@ -20,6 +20,8 @@
/// - SKL
/// Gcc : -mavx512f -mavx512cd -mavx512vl -mavx512bw -mavx512dq -fopenmp
/// Intel : -xCOMMON-AVX512 -xCORE-AVX512 -qopenmp
///
/// Or use "-march=native -mtune=native" if you are already on the right platform ("native can be replaced by "knl" or "skylake")
//////////////////////////////////////////////////////////
#ifndef SORT512_HPP
#define SORT512_HPP
......@@ -5953,6 +5955,12 @@ static void CoreSort(SortType array[], const IndexType left, const IndexType rig
}
}
template <class SortType, class IndexType = size_t>
static inline void Sort(SortType array[], const IndexType size){
CoreSort<SortType,IndexType>(array, 0, size-1);
}
#if defined(_OPENMP)
template <class SortType, class IndexType = size_t>
......@@ -5979,11 +5987,6 @@ static inline void CoreSortTask(SortType array[], const IndexType left, const In
}
}
template <class SortType, class IndexType = size_t>
static inline void Sort(SortType array[], const IndexType size){
CoreSort<SortType,IndexType>(array, 0, size-1);
}
template <class SortType, class IndexType = size_t>
static inline void SortOmp(SortType array[], const IndexType size){
// const int nbTasksRequiere = (omp_get_max_threads() * 5);
......
......@@ -20,6 +20,8 @@
/// - SKL
/// Gcc : -mavx512f -mavx512cd -mavx512vl -mavx512bw -mavx512dq -fopenmp
/// Intel : -xCOMMON-AVX512 -xCORE-AVX512 -qopenmp
///
/// Or use "-march=native -mtune=native" if you are already on the right platform ("native can be replaced by "knl" or "skylake")
//////////////////////////////////////////////////////////
#ifndef SORT512KV_HPP
#define SORT512LV_HPP
......@@ -6127,6 +6129,12 @@ static void CoreSort(SortType array[], SortType values[], const IndexType left,
}
}
template <class SortType, class IndexType = size_t>
static inline void Sort(SortType array[], SortType values[], const IndexType size){
CoreSort<SortType,IndexType>(array, values, 0, size-1);
}
#if defined(_OPENMP)
template <class SortType, class IndexType = size_t>
......@@ -6153,11 +6161,6 @@ static inline void CoreSortTask(SortType array[], SortType values[], const Index
}
}
template <class SortType, class IndexType = size_t>
static inline void Sort(SortType array[], SortType values[], const IndexType size){
CoreSort<SortType,IndexType>(array, values, 0, size-1);
}
template <class SortType, class IndexType = size_t>
static inline void SortOmp(SortType array[], SortType values[], const IndexType size){
// const int nbTasksRequiere = (omp_get_max_threads() * 5);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment