On Wed, 2023-01-04 at 04:06 +0000, Peter Schneider-Kamp wrote:
> Hi guys,
> 
> I am trying to understand how the x86 dispatch for ndarray sort
> works. The following call in Line 137 of
> numpy/core/src/npysort/quicksort.cpp returns 0 for my test cases:
> 
> if (x86_dispatch<Tag>::quicksort(start, num))
>         return 0;
> 
> I have tried to compile with --cpu-dispatch="AVX512_KNL AVX512_CLX
> AVX512_CNL AVX512_ICL AVX512_SKX" but for dtype=uint64 (or int64 or
> uint8 or float32 or float64) it always the same result, i.e., the
> standard quicksort is used instead of the AVX512 one with bitonic
> sorting base cases.
> 
> What do I have to do to be able to use the AVX512 implementation?


You can check what is found with:

    np.show_runtime()

Also just google your CPU or check `cat /proc/cpuinfo`.  AVX512 exists
currently only on high end Intel CPUs (IIRC), presumably, you simply do
not have the hardware.

E.g. on M1, `show_runtime()` won't even list AVX512 when compiled, on
x86 they would probably show up as "not found" because they exist, but
your hardware doesn't support AVX512.

- Sebastian


> 
> I am currently compiling on a MacBook Pro with Monterey. I have all
> kinds of Linux machines available, if that should be a requirements.
> 
> Thanks in advance for any insights!
> 
> Cheers,
> Peter
> --
> Peter Schneider-Kamp
> Professor in Artificial Intelligence
> Department of Mathematics & Computer Science
> University of Southern Denmark
> 
> _______________________________________________
> NumPy-Discussion mailing list -- numpy-discussion@python.org
> To unsubscribe send an email to numpy-discussion-le...@python.org
> https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
> Member address: sebast...@sipsolutions.net


_______________________________________________
NumPy-Discussion mailing list -- numpy-discussion@python.org
To unsubscribe send an email to numpy-discussion-le...@python.org
https://mail.python.org/mailman3/lists/numpy-discussion.python.org/
Member address: arch...@mail-archive.com

Reply via email to