Skip to content

missing "constexpr" in "quicksort_dispatch" in quicksort.cpp #30452

@treeislikethis

Description

@treeislikethis

Describe the issue:

In numpy/_core/src/npysort/quicksort.cpp
if (sizeof(T) == sizeof(uint16_t)) should be modified with "constexpr", and the same applies to the following if (sizeof(T) == sizeof(uint32_t) || sizeof(T) == sizeof(uint64_t)).
Other similar parts of the code have already been updated, so this seems to be a missed case.

Reproduce the code example:

It causes link error if optimization is diabled, like:
unresolved external symbol "void __cdecl np::qsort_simd::QSort_AVX512_SKX<short>(short *,int)" (??$QSort_AVX512_SKX@F@qsort_simd@np@@YAXPAFH@Z),referenced by "bool __cdecl quicksort_dispatch<short>(short *,int)" (??
$quicksort_dispatch@F@@YA_NPAFH@Z)

Error message:

Python and NumPy Versions:

2.3.5, 3.11.6 (tags/v3.11.6:8b6ee5b, Oct 2 2023, 14:57:12) [MSC v.1935 64 bit (AMD64)]

Runtime Environment:

No response

Context for the issue:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions