Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

-xavx vs -march=corei7-avx

vibrantcascade
Beginner
1,552 Views
Just wondering, is there any actual difference between these 2 arguments from the compilers perspective?
-xavx
-march=corei7-avx

They both appear to do basically the same exact thing from what I can tell in the manual?

I'm running code on an i5-2400 which supports avx, so I'm trying to figure out which one would be best or if it even matters.

Thanks!
Morgan
0 Kudos
2 Replies
Steven_L_Intel1
Employee
1,552 Views
Yes, there is a difference. The -xavx version may do additional optimizations and will add a test for CPU type at the beginning of the program. If you know you will be running on an Intel processor, use the -x variant.
0 Kudos
TimP
Honored Contributor III
1,552 Views
On the other hand, -mavx or -march=corei7-avx (gfortran option for Sandy Bridge) work well, in my experience, so the main consideration may be whether you want a clear text message in case it's not recognized as an Intel AVX CPU.
0 Kudos
Reply