When using Cern's ROOT Data Analysis Framework, there are notes about possible compile time enhancements. It is best to take a look on which cpu variant the compiler will generate code, and for which target cpu the code will run. They need to be compatible.
AVX-512 is an interesting Wikipedia page describing the various cpu variant incarnations and their specialized instruction subsets.
Here are a few command line examples for examining what the gcc compiler sees as being available.
$ gcc -march=native -Q --help=target | grep march -march= skylake Known valid arguments for -march= option:
$ echo | gcc -dM -E - -march=native ... large quantity of flags ...
gcc x86 cpu options cmake command:
add_definitions(-march=native)
Even though this optimizes instruction use, it has to be used carefully. It will probably cause side effects with compiling code on one version of cpu and when copying the executables to a different machine, with possibly a different cpu variant.
Reference: How to see which flags -march=native will activate?