Compiler Option QaxCOMMON-AVX512

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

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容