APM PGI 10.5 - !$acc do kernel copyin, copyout

Here is the issue that I have: if I use an array in both copyin and copyout clauses, then only copyout is generated

Example:

!$acc region do kernel copyin(ca_jsr(1:n)), copyout(ca_jsr(1:n))

The compiling output just say

Generating copyout(ca_jsr(:))

Thanks,
Tuan

Hi Tuan,

Yes, the compiler will ignore the copyin. You should use the “copy” clause here.

...
!$acc region copyin(Cs), copyout(Cs), copyout(Ds)
...
% pgf90 -ta=nvidia -Minfo=accel test.f90 -V10.5
test:
      9, copyin(cs) followed by copyout(cs); copyin attribute ignored
         Generating copyout(cs(:,:))
         Generating copyout(ds(:,:))
  • Mat

Thanks, Mat.
I know we can use copy, yet I want to test if there is any difference between using copy explicitly and using the two other clauses.

Tuan

Hi Tuan,

Unfortunately, the PGI Accelerator Model’s spec has a restriction that you can’t use the same variable in multiple copy clauses. If allowed, it would cause difficulties if the user used different extends for the copyin and copyout clauses.

Note that using copy is the same as using both copyin and copyout. There should be no difference. Are you seeing a difference?

Note that you could use the update clauses to get finer grain control of the copies. Something like:

!$acc data region local(Cs)
...
!$acc updatein(Cs)
...
!$acc region copyout(Ds)
...
!$acc end region
...
!$acc updateout(Cs)
...
!$acc end data region

Hope this helps,
Mat