10000 Include highway/x86-simd-sort at compile time · numpy/numpy@4570077 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4570077

Browse files
author
Raghuveer Devulapalli
committed
Include highway/x86-simd-sort at compile time
1 parent e2a076b commit 4570077

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

numpy/_core/src/npysort/highway_qsort.dispatch.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* $maxopt $keep_baseline
33
* asimd
44
*/
5-
// policy $keep_baseline is used to avoid skip building avx512_skx
5+
// policy $keep_baseline is used to avoid skip building asimd
66
// when its part of baseline features (--cpu-baseline), since
77
// 'baseline' option isn't specified within targets.
88

@@ -43,6 +43,6 @@ template<> void NPY_CPU_DISPATCH_CURFX(QSort)(double *arr, intptr_t size)
4343
}
4444
#endif // NPY_HAVE_ASIMD
4545

46-
}} // namespace np::simd
46+
}} // namespace np::qsort_simd
4747

4848
#endif // __CYGWIN__

numpy/_core/src/npysort/quicksort.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,13 @@ inline bool quicksort_dispatch(T *start, npy_intp num)
8787
}
8888
else if (sizeof(T) == sizeof(uint32_t) || sizeof(T) == sizeof(uint64_t)) {
8989
#ifndef NPY_DISABLE_OPTIMIZATION
90-
#include "x86_simd_qsort.dispatch.h"
91-
#endif
92-
NPY_CPU_DISPATCH_CALL_XB(dispfunc = np::qsort_simd::template QSort, <TF>);
93-
// If not dispatched for avx-512 or avx2:
94-
if (dispfunc == nullptr) {
95-
#ifndef NPY_DISABLE_OPTIMIZATION
90+
#if defined(NPY_CPU_AMD64) || defined(NPY_CPU_X86) // x86 32-bit and 64-bit
91+
#include "x86_simd_qsort.dispatch.h"
92+
#else
9693
#include "highway_qsort.dispatch.h"
9794
#endif
98-
NPY_CPU_DISPATCH_CALL_XB(dispfunc = np::qsort_simd::template QSort, <TF>);
99-
}
95+
#endif
96+
NPY_CPU_DISPATCH_CALL_XB(dispfunc = np::qsort_simd::template QSort, <TF>);
10097
}
10198
if (dispfunc) {
10299
(*dispfunc)(reinterpret_cast<TF*>(start), static_cast<intptr_t>(num));

numpy/_core/src/npysort/x86_simd_qsort.dispatch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,6 @@ template<> void NPY_CPU_DISPATCH_CURFX(QSort)(double *arr, npy_intp num)
119119
}
120120
#endif // NPY_HAVE_AVX512_SKX || NPY_HAVE_AVX2
121121

122-
}} // namespace np::simd
122+
}} // namespace np::qsort_simd
123123

124124
#endif // __CYGWIN__

0 commit comments

Comments
 (0)
0