You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9858c70
Browse filesBrowse the repository at this point in the historyBrowse files
ENH: use x86-simd-sort for descending sorts and partitions
The x86 SIMD paths were gated behind `!reverse` since numpygh-31345, because
x86-simd-sort placed NaNs at the start of a descending result while NumPy
keeps them at the end (see `npy::cmp<Tag, reverse>`). The vendored library
gained a separate `nans_last` switch in numpy/x86-simd-sort#235, which came
in with the submodule bump in numpygh-31947, so `descending` can now be forwarded
directly: `nans_last` defaults to true and gives exactly NumPy's ordering.
Removes the dispatch guards in quicksort.hpp/selection.hpp and the
`assert(!reverse)` in the three dispatch translation units, and threads
`reverse` through QSelect/ArgQSelect so partition and argpartition are
covered as well.
Measured on AVX2 over 1M elements, descending now runs at the speed of
ascending: ~4-9x faster than before for `sort`/`partition` and ~2-3x for
`argsort`/`argpartition`.
Closes part of numpygh-31423.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
0 commit comments