how to check which version of OpenACC API is being used by the PGI compiler

Hello,

It seems that array reduction starts to be supported in OpenACC API 2.7 (https://www.openacc.org/blog/whats-new-openacc-27), but I cannot find information/confirmation on whether API 2.7 has been fully adopted by the PGI compiler 19.4. I tried the PGI compiler release notes (https://www.pgroup.com/resources/docs/19.9/x86/pgi-release-notes/index.htm) and the API 2.7documentation (https://www.openacc.org/sites/default/files/inline-files/OpenACC.2.7.pdf).

As a general question, how can I check which version of OpenACC API is being used by the PGI compiler I am currently using?

Thanks,
Shine

Hi Shine,

We’re still in the process of adding the new OpenACC 2.7 features with PGI 19.10 currently support up to the 2.6 standard.

The “_OPENACC” macro is defined to the standard’s release date. With 2.6 being “201711” and 2.7 using “201811”.

For example:

% cat test.F90
program foo
  use openacc
  print *, _OPENACC
end program foo
% pgfortran -acc test.F90
% a.out
       201711

Hope this helps,
Mat

Thanks, Mat, for your helpful information. Yes, with your code, I can tell that my PGI 19.4 is using the OpenACC API 2.6.

Thanks,
Shine

Hi Mat:

I was looking at this post and tried the following:

program foo
  use openacc
  print *, _OPENACC
end program foo

Then I compile with

C:\brandnewR>pgfortran -acc test.f90
./test.exf: warning: unknown section "_RDATA" found, executable not
  stripped.  Use the linker's /merge option to merge this section
  with another.  Example: "/merge:_RDATA=.data"

C:\brandnewR>test.exe
    0.000000

I’m using Windows with Community edition. What am I doing wrong, please?
Thanks,
Erin

Hi again!

I used the -cpp option during compilation and it worked fine.

Thanks though!

Sincerely,
Erin

Hi Erin,

FYI, “.F90” suffix will have the compiler implicitly preprocess the source file. However “.f90” are not preprocessed by default. For these files, you’ll need to add “-Mpreprocess” or, as you note, “-cpp”.

-Mat

Great!

Thanks