Home > database >  Does icc -xCORE-AVX2 force the non-utilisation of AVX512 instructions on Xeon Gold if -O3 is on?
Does icc -xCORE-AVX2 force the non-utilisation of AVX512 instructions on Xeon Gold if -O3 is on?

Time:07-06

As per the title,

Will programs compiled with the intel compiler under

icc -O3 -xCORE-AVX2 program.cpp

Generate AVX512 instructions on a Xeon Gold 61XX?

Our assembler analysis doesn't seem to find one, but that is no guarantee.

Thanks!

CodePudding user response:

In ICC, no, you can use intrinsics for any instruction without telling the compiler to enable it. (Unlike GCC or clang where you have to enable instruction sets to use their intrinsics.)

But the compiler won't emit AVX-512 instructions other than from intrinsics (or inline asm), without enabling a -march=skylake-avx512 or -march=native (aka -xHOST) or similar option that implies -mavx512f. Or a pragma or __attribute__((target("string"))) to enable AVX-512 for a single function.

This is true for all the major x86 compilers, AVX-512 is not on by default.

Use -O3 -march=native if you want to make code optimized for the machine you're running on, just like with GCC or clang.

  • Related