SIMD AVX-512 compiler flags set for Intel compiler are not working on Zen 4
Thanks to #4715 (closed), GROMACS selects AVX512 for Zen 4, which sets
SIMD_AVX_512_CXX_FLAGS:INTERNAL= -xCORE-AVX512 -qopt-zmm-usage=high
SIMD_AVX_512_C_FLAGS:INTERNAL= -xCORE-AVX512 -qopt-zmm-usage=high
This flag is not generating the code that runs on Zen 4. That is, after compiling and running tests, they fail with:
Please verify that both the operating system and the processor support Intel(R) X87, CMOV, MMX, SSE, SSE2, SSE3, SSSE3, SSE4_1, SSE4_2, MOVBE, POPCNT, AVX, F16C, FMA, BMI, LZCNT, AVX2, AVX512F, AVX512DQ, ADX, AVX512CD, AVX512BW and AVX512VL instructions.
We should get something like:
-march=skylake-avx512
instead (-march=znver4
is supported only from version 2024).
I see two ways to fix this:
- introduce another branch under AVX-512F that selects different flags if AMD CPU was detected, or
- switch to newer style compile flags for Intel and AMD CPUs since we don't support legacy Intel compiler anymore.
Edited by Vedran Miletić