-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26338 from r-devulap/xss-static-api
MAINT: update x86-simd-sort to latest
- Loading branch information
Showing
6 changed files
with
64 additions
and
201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule x86-simd-sort
updated
65 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,89 +1,25 @@ | ||
#include "x86_simd_qsort.hpp" | ||
#ifndef __CYGWIN__ | ||
|
||
#if defined(NPY_HAVE_AVX512_SKX) | ||
#include "x86-simd-sort/src/avx512-32bit-qsort.hpp" | ||
#include "x86-simd-sort/src/avx512-64bit-qsort.hpp" | ||
#include "x86-simd-sort/src/avx512-64bit-argsort.hpp" | ||
#elif defined(NPY_HAVE_AVX2) | ||
#include "x86-simd-sort/src/avx2-32bit-qsort.hpp" | ||
#include "x86-simd-sort/src/avx2-64bit-qsort.hpp" | ||
#endif | ||
#include "x86-simd-sort/src/x86simdsort-static-incl.h" | ||
|
||
namespace { | ||
template<typename T> | ||
void x86_qsort(T* arr, npy_intp num) | ||
{ | ||
#if defined(NPY_HAVE_AVX512_SKX) | ||
avx512_qsort(arr, num, true); | ||
#elif defined(NPY_HAVE_AVX2) | ||
avx2_qsort(arr, num, true); | ||
#endif | ||
} | ||
|
||
template<typename T> | ||
void x86_qselect(T* arr, npy_intp num, npy_intp kth) | ||
{ | ||
#if defined(NPY_HAVE_AVX512_SKX) | ||
avx512_qselect(arr, kth, num, true); | ||
#elif defined(NPY_HAVE_AVX2) | ||
avx2_qselect(arr, kth, num, true); | ||
#endif | ||
} | ||
} // anonymous | ||
#define DISPATCH_SORT_METHODS(TYPE) \ | ||
template<> void NPY_CPU_DISPATCH_CURFX(QSelect)(TYPE *arr, npy_intp num, npy_intp kth) \ | ||
{ \ | ||
x86simdsortStatic::qselect(arr, kth, num, true); \ | ||
} \ | ||
template<> void NPY_CPU_DISPATCH_CURFX(QSort)(TYPE *arr, npy_intp num) \ | ||
{ \ | ||
x86simdsortStatic::qsort(arr, num, true); \ | ||
} \ | ||
|
||
namespace np { namespace qsort_simd { | ||
#if defined(NPY_HAVE_AVX512_SKX) || defined(NPY_HAVE_AVX2) | ||
template<> void NPY_CPU_DISPATCH_CURFX(QSelect)(int32_t *arr, npy_intp num, npy_intp kth) | ||
{ | ||
x86_qselect(arr, num, kth); | ||
} | ||
template<> void NPY_CPU_DISPATCH_CURFX(QSelect)(uint32_t *arr, npy_intp num, npy_intp kth) | ||
{ | ||
x86_qselect(arr, num, kth); | ||
} | ||
template<> void NPY_CPU_DISPATCH_CURFX(QSelect)(int64_t*arr, npy_intp num, npy_intp kth) | ||
{ | ||
x86_qselect(arr, num, kth); | ||
} | ||
template<> void NPY_CPU_DISPATCH_CURFX(QSelect)(uint64_t*arr, npy_intp num, npy_intp kth) | ||
{ | ||
x86_qselect(arr, num, kth); | ||
} | ||
template<> void NPY_CPU_DISPATCH_CURFX(QSelect)(float *arr, npy_intp num, npy_intp kth) | ||
{ | ||
x86_qselect(arr, num, kth); | ||
} | ||
template<> void NPY_CPU_DISPATCH_CURFX(QSelect)(double *arr, npy_intp num, npy_intp kth) | ||
{ | ||
x86_qselect(arr, num, kth); | ||
} | ||
template<> void NPY_CPU_DISPATCH_CURFX(QSort)(int32_t *arr, npy_intp num) | ||
{ | ||
x86_qsort(arr, num); | ||
} | ||
template<> void NPY_CPU_DISPATCH_CURFX(QSort)(uint32_t *arr, npy_intp num) | ||
{ | ||
x86_qsort(arr, num); | ||
} | ||
template<> void NPY_CPU_DISPATCH_CURFX(QSort)(int64_t *arr, npy_intp num) | ||
{ | ||
x86_qsort(arr, num); | ||
} | ||
template<> void NPY_CPU_DISPATCH_CURFX(QSort)(uint64_t *arr, npy_intp num) | ||
{ | ||
x86_qsort(arr, num); | ||
} | ||
template<> void NPY_CPU_DISPATCH_CURFX(QSort)(float *arr, npy_intp num) | ||
{ | ||
x86_qsort(arr, num); | ||
} | ||
template<> void NPY_CPU_DISPATCH_CURFX(QSort)(double *arr, npy_intp num) | ||
{ | ||
x86_qsort(arr, num); | ||
} | ||
#endif // NPY_HAVE_AVX512_SKX || NPY_HAVE_AVX2 | ||
|
||
DISPATCH_SORT_METHODS(uint32_t) | ||
DISPATCH_SORT_METHODS(int32_t) | ||
DISPATCH_SORT_METHODS(float) | ||
DISPATCH_SORT_METHODS(uint64_t) | ||
DISPATCH_SORT_METHODS(int64_t) | ||
DISPATCH_SORT_METHODS(double) | ||
}} // namespace np::qsort_simd | ||
|
||
#endif // __CYGWIN__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters