-
-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for macos universal2
(arm64
+x86_64
build)
#431
Conversation
I had trouble building on macos through Python (universal2 build using clang) with the Commit 89f9335 fixes it for my case, but I'm really not sure it is the right thing to do. |
It looks like it is, yes: https://www.felixcloutier.com/x86/xgetbv
Uh, not sure about this. But if that works for you, let's go with that. |
This looks promising! I'll merge soon. Thanks! |
Good! I'm not really comfortable with this kind of compilation issue.
It looks like it: https://github.com/llvm/llvm-project/blob/a274d62fecfc3f49065f3fcdcb9577637778e0bc/clang/lib/Headers/immintrin.h#L10-L11 |
It is in. I'll try to cut a release soon. |
Great! Thanks a lot! |
I have been doing some profiling on a recent Intel CPU, and I discovered that latest version of C-Blosc2 do not use AVX2 anymore by default: After some digging, the commit that started to not use AVX2 is: c603171. Before this, the profile was something like: To reproduce the profilings:
when browsing the results, press 'e'xpand to see the details. Any hint @t20100 ? |
#if defined(SHUFFLE_AVX2_ENABLED) && defined(__AVX2__)
#define SHUFFLE_USE_AVX2
#endif |
IIRC it is not necessary to use |
This PR proposes a fix to allow building c-blosc2 as part of a Python package that is built as a universal2 binary package on macos with enabled AVX2/SSE2 optimisation for the x86_64 target only, NEON for the arm target and ALTIVEC for ppc64le.
To achieve this, c-blosc2 should support defining SHUFFLE_*_ENABLED and be able to build all files (including *-avx2.c, *-sse2.c, *-neon.c and *-altivec.c) even when the compilation target does not support the given instruction set.
This is done by toggling SIMD instructions usage with both SHUFFLE_*_ENABLED and AVX2, SSE2, __ARM_NEON and ALTIVEC.
closes #430
related to Blosc/c-blosc#347
related to silx-kit/hdf5plugin#201