9
9
10
10
#if defined(NPY_HAVE_AVX512_SPR) && !defined(_MSC_VER)
11
11
#include " x86-simd-sort/src/avx512fp16-16bit-qsort.hpp"
12
+ /*
13
+ * Wrapper function declarations to avoid multiple definitions of
14
+ * avx512_qsort<uint16_t> and avx512_qsort<int16_t>
15
+ */
16
+ void avx512_qsort_uint16 (uint16_t *, intptr_t );
17
+ void avx512_qsort_int16 (int16_t *, intptr_t );
12
18
#elif defined(NPY_HAVE_AVX512_ICL) && !defined(_MSC_VER)
13
19
#include " x86-simd-sort/src/avx512-16bit-qsort.hpp"
20
+ /* Wrapper function defintions here: */
21
+ void avx512_qsort_uint16 (uint16_t * arr, intptr_t size)
22
+ {
23
+ avx512_qsort (arr, size);
24
+ }
25
+ void avx512_qsort_int16 (int16_t * arr, intptr_t size)
26
+ {
27
+ avx512_qsort (arr, size);
28
+ }
14
29
#endif
15
30
16
31
namespace np { namespace qsort_simd {
@@ -27,11 +42,19 @@ template<> void NPY_CPU_DISPATCH_CURFX(QSort)(Half *arr, intptr_t size)
27
42
}
28
43
template <> void NPY_CPU_DISPATCH_CURFX (QSort)(uint16_t *arr, intptr_t size)
29
44
{
45
+ #if defined(NPY_HAVE_AVX512_SPR)
46
+ avx512_qsort_uint16 (arr, size);
47
+ #else
30
48
avx512_qsort (arr, size);
49
+ #endif
31
50
}
32
51
template <> void NPY_CPU_DISPATCH_CURFX (QSort)(int16_t *arr, intptr_t size)
33
52
{
53
+ #if defined(NPY_HAVE_AVX512_SPR)
54
+ avx512_qsort_int16 (arr, size);
55
+ #else
34
56
avx512_qsort (arr, size);
57
+ #endif
35
58
}
36
59
#endif // NPY_HAVE_AVX512_ICL || SPR
37
60
#endif // _MSC_VER
0 commit comments