bizarre compiling behaviour

Hi,

I have noticed some bizarre compiling behaviour with the 13.3 version of pgfortran when using cuda (12.6 seems to work without a problem).

When I compile my code with
pgfortran -Mcuda=emu
it compiles and gives correct results.

Using
pgfortran -Mcuda=maxregcount:32 -tp=sandybridge-64
also compiles and gives correct results

Using
pgfortran -Mcuda=maxregcount:32 -tp=sandybridge-64 -ta=nvidia
compiles BUT gives wrong results. Some debugging showed that two complex variables (say, CP and CS) have identical values when compiling with the -ta switch even though they should not.

Am I doing something obviously wrong in the compiler switches? I thought the -ta switch is the new way of specifying the target.

In addition, the code also returns wrong results when I use -fast. I tried a different computer where I still run version 12.6 and it has no such issues.

Any help greatly appreciated.

Thanks, Jan

Hi Jan,

I thought the -ta switch is the new way of specifying the target.

No, this flag enables the PGI Accelerator Model and OpenACC directive’s target device. For CUDA Fortran, you can only target NVIDIA or emulation mode so the -ta flag isn’t needed.

However, unless you using OpenACC or the PGI Accelerator Model in your code, it shouldn’t change the behaviour nor give you wrong answers. If you aren’t using directives. can you please send a reproducing example to PGI Customer Service (trs@pgroup.com) and ask them to send it to me? I’ll need to investigate what the issue is.

Thanks,
Mat