-xavx vs -march=corei7-avx

-xavx vs -march=corei7-avx

vibrantcascade's picture

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

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Steve Lionel (Intel)'s picture

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.

Steve
TimP (Intel)'s picture

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.

Login to leave a comment.