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

OpenACC and CUDA Fortran
Shine X.M. Zhai
Posts: 35
Joined: Apr 22 2019

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

Post by Shine X.M. Zhai » Wed Oct 30, 2019 11:42 am

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/1 ... /index.htm) and the API 2.7documentation (https://www.openacc.org/sites/default/f ... CC.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

mkcolg
Posts: 8107
Joined: Jun 30 2004

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

Post by mkcolg » Wed Oct 30, 2019 2:29 pm

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:

Code: Select all

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

Shine X.M. Zhai
Posts: 35
Joined: Apr 22 2019

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

Post by Shine X.M. Zhai » Wed Oct 30, 2019 2:54 pm

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

ErinH
Posts: 29
Joined: Aug 22 2018

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

Post by ErinH » Wed Oct 30, 2019 10:09 pm

Hi Mat:

I was looking at this post and tried the following:

Code: Select all

program foo
  use openacc
  print *, _OPENACC
end program foo
Then I compile with

Code: Select all

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

ErinH
Posts: 29
Joined: Aug 22 2018

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

Post by ErinH » Wed Oct 30, 2019 10:32 pm

Hi again!

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

Thanks though!

Sincerely,
Erin

Post Reply