8000 MAINT: Update highway-qsort.dispatch.cpp from main. · numpy/numpy@1fd9477 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1fd9477

Browse files
committed
MAINT: Update highway-qsort.dispatch.cpp from main.
1 parent 1abd620 commit 1fd9477

File tree

1 file changed

+12
-24
lines changed

1 file changed

+12
-24
lines changed

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

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,19 @@
22
#define VQSORT_ONLY_STATIC 1
33
#include "hwy/contrib/sort/vqsort-inl.h"
44

5+
#define DISPATCH_VQSORT(TYPE) \
6+
template<> void NPY_CPU_DISPATCH_CURFX(QSort)(TYPE *arr, intptr_t size) \
7+
{ \
8+
hwy::HWY_NAMESPACE::VQSortStatic(arr, size, hwy::SortAscending()); \
9+
} \
10+
511
namespace np { namespace highway { namespace qsort_simd {
612

7-
template<> void NPY_CPU_DISPATCH_CURFX(QSort)(int32_t *arr, intptr_t size)
8-
{
9-
hwy::HWY_NAMESPACE::VQSortStatic(arr, size, hwy::SortAscending());
10-
}
11-
template<> void NPY_CPU_DISPATCH_CURFX(QSort)(uint32_t *arr, intptr_t size)
12-
{
13-
hwy::HWY_NAMESPACE::VQSortStatic(arr, size, hwy::SortAscending());
14-
}
15-
template<> void NPY_CPU_DISPATCH_CURFX(QSort)(int64_t *arr, intptr_t size)
16-
{
17-
hwy::HWY_NAMESPACE::VQSortStatic(arr, size, hwy::SortAscending());
18-
}
19-
template<> void NPY_CPU_DISPATCH_CURFX(QSort)(uint64_t *arr, intptr_t size)
20-
{
21-
hwy::HWY_NAMESPACE::VQSortStatic(arr, size, hwy::SortAscending());
22-
}
23-
template<> void NPY_CPU_DISPATCH_CURFX(QSort)(float *arr, intptr_t size)
24-
{
25-
hwy::HWY_NAMESPACE::VQSortStatic(arr, size, hwy::SortAscending());
26-
}
27-
template<> void NPY_CPU_DISPATCH_CURFX(QSort)(double *arr, intptr_t size)
28-
{
29-
hwy::HWY_NAMESPACE::VQSortStatic(arr, size, hwy::SortAscending());
30-
}
13+
DISPATCH_VQSORT(int32_t)
14+
DISPATCH_VQSORT(uint32_t)
15+
DISPATCH_VQSORT(int64_t)
16+
DISPATCH_VQSORT(uint64_t)
17+
DISPATCH_VQSORT(double)
18+
DISPATCH_VQSORT(float)
3119

3220
} } } // np::highway::qsort_simd

0 commit comments

Comments
 (0)
0