Compiling flags

I have a fortran code to simulate magnetic systems and I am trying to calculate the GPU speedup. I am compiling my code for the gpu using

pgfortran -fast -O3 -g -ta=nvidia:{cuda3.1,fastmath} -Minfo mycode.f90

and for the CPU, I am compiling with:

pgfortran -fast -O3 -g -Minfo mycode.f90

I am wondering if the speedup calculation will be correct in this case? Is there a flag that I need to use when compiling for the CPU that will be equivalent to “fastmath”.

Thanks,

Amin

Hi Amin,

I am wondering if the speedup calculation will be correct in this case? Is there a flag that I need to use when compiling for the CPU that will be equivalent to “fastmath”.

If you are using sin, cos, divides, sqrt, or inverse sqrt, you can add the “-Mfprelaxed” flag. This will use faster but less accurate versions of these operations.

The is also the “-Mfpapprox” flag that uses hardware approximation. However, the accuracy is extremely poor so it’s use not generally advisable.

  • Mat