ENH, SIMD: Add C++ wrapper for universal intrinsics#21057
ENH, SIMD: Add C++ wrapper for universal intrinsics#21057seiko2plus wants to merge 5 commits intonumpy:mainfrom
Conversation
4b0441f to
547edc5
Compare
547edc5 to
6613713
Compare
6dbf0c8 to
57624d5
Compare
6feaf05 to
d60f08f
Compare
e792445 to
a92b0fb
Compare
a92b0fb to
889c800
Compare
f4a4fa7 to
961e2f0
Compare
|
to rebuild artifact |
|
@seiko2plus Needs a rebase. |
0f9fced to
9616ea6
Compare
9d14e1b to
385f78d
Compare
|
close/re-open to rerun CI jobs |
|
@seiko2plus How do I access the rendered documentation associated with this PR? |
|
They are the artifacts of the ci/circleci build, you should be able to see it in the CI summary. The c++ documentation is here |
|
thanks @mattip |
Introduces a C++ wrapper for universal intrinsics, providing a convenient and platform-independent interface to access SIMD instructions across different architectures, supports sizeless SIMD extentions e.g. ARM SVE and simplifies the development of SIMD a way from C template sources. Comes with documentation provides clear explanations and examples for using the wrapper and its functionalities.
To eliminate C template sources and enable support for sizeless SIMD extensions.
385f78d to
b70cda0
Compare
|
made a rebase against the main to pass CI jobs |
|
I am looking into ways of adding vectorisation into astropy and it would be useful to be able to use the universal intrinsics through these C++ wrappers. Are there any plans to get this work merged into numpy? |
|
@manodeep We are dropping this PR in favor of google highway which is a well-established open-source solution addressing the same problem. See #25781 and https://numpy.org/neps/nep-0054-simd-cpp-highway.html. Is there a reason why you cannot use highway or other open source solutions for universal intrinsics (xsimd, as another example)? |
|
@r-devulap Thanks for the quick response! I saw the discussion about incorporating some highway functionality in a separate PR but didn't realise the entire numpy simd infrastructure was getting replaced by highway! I was hoping to use the numpy insights regarding the simd infrastructure. Is there any work already underway to port over the simd infra to highway?
|
highway has everything you need to write platform agnostic code: (1) static universal intrinsics or hwy ops to write your SIMD code and (2) generate the dynamic dispatch code to run appropriate cpuid check to run the best version. See https://google.github.io/highway/en/master/README.html#examples for examples. Numpy currently has its own infrastructure for dynamic dispatch and uses highway only for universal intrinsics part (although this might change in the future). |
|
Ahh great - thank you @r-devulap |
|
This will be closed in favor of adopting Highway. |
Introduces a C++ wrapper for universal intrinsics, providing
a convenient and platform-independent interface to access SIMD
instructions across different architectures support sizeless
SIMD extensions e.g. ARM SVE and simplifies the
development of SIMD a way from C template sources.
Comes with documentation that provides clear explanations and
examples for using the wrapper and its functionalities.
This pr also comes with an example that demonstrates the use of C++
by replacing template c sources of comparison operations.
This pull-requests: