QaxCOMMON-AVX512 is used to do vectorization for loops if there is a performance benefit.
However, we should be careful to add this option to nxn_exception file.
First, it disturbs the debug process.?The code jumps randomly within the debugger. We need to manually deactivate this option at debugging.
Second, it isn’t always beneficial to the performance
By adding this option, you are asking the compiler to add the following code to your subroutine (and it is a LOT of extra code):
Check for SSE3/SSE4 registers on the CPU
Check for AVX registers on the CPU
Check for AVX2 registers on the CPU
Check for AVX512 registers on the CPU
After doing all those checks, it will then see if there are any vector registers to invoke.
If there are not any vector invoked, and then nothing will happen to the code.
That means now the code has to take time to check on capability it actually can’t use.
So, if you want to leverage this function, you need to check if it is useful first simply by:
Windows: ifort filename.F /Qopt-report-phase=vec
Linux: ifort filename.F -qopt-report-phase=vec
If there is any high-performance value to this routines, you will see a “filename.optrpt” file generated in your work directory which contains something like:
LOOP BEGIN at D:\workdir\example.F(20,8)
?? remark #15300: LOOP WAS VECTORIZED
LOOP END
If you see nothing, that means you should not add QaxCOMMON-AVX512 to it.
Reference
https://software.intel.com/en-us/fortran-compiler-developer-guide-and-reference-compiler-options