5 ms·
You should use Intel intrinsics - generally, they are supported by all compilers. E.g. https://www.intel.com/content/www/us/en/develop/documentation/cpp-compil
by Iwan-Zotow 4y ago
You should use Intel intrinsics - generally, they are supported by all compilers.
E.g. https://www.intel.com/content/www/us/en/develop/documentation/cpp-compiler-developer-guide-and-reference/top/compiler-reference/intrinsics/intrinsics-for-avx-512-instructions.html https://www.intel.com/content/www/us/en/develop/documentatio...
- readonlybarbie 4y agoif you are targeting more than one specific platform, do you like, include the immintrin.h header and use #ifdef to conditionally use avx512 if it's available on someone's platform?
- janwas 4y agoIt would be simpler to use the portable intrinsics from github.com/google/highway (disclosure: I am the main author). You include a header, and use the same functions on all platforms; the library provides wrapper functions which boil down to the platform's intrinsics.
- readonlybarbie 4y ago[dead]
- Iwan-Zotow 4y agoWell, there is SIMD proposal for C++23 with kind-of-reference implementation. But I don't know how well it works for AVX0512
- janwas 4y agoFrom what I have seen, this is unfortunately not very useful: it mainly only includes operations that the compiler is often able to autovectorize anyway (simple arithmetic). Support for anything more interesting such as swizzles seems nonexistent. Also, last I checked, this was only available on GCC 11+; has that changed?
- Iwan-Zotow 4y agoI think proposed Vc lib is tested under clang as well.
- janwas 4y agoHere is my source: https://github.com/VcDevel/std-simd https://github.com/VcDevel/std-simd Ah, but this repo mentions that the GCC 11 implementation apparently also works with clang: https://github.com/VcDevel/Vc https://github.com/VcDevel/Vc. Thanks!