double copyin and copy in 12.6

Hi guys,

Here is a piece of code:

!$acc data create(AUX(1:NAUX),JS(1:NSM3))
!$accx     copyin(NTM) copy(FCLUST(1:SZ),FSEQ(1:SZ))
!      IS = 0
!$acc kernels
!$acc loop independent
      DO IS3 = 0,NSM-1
!$acc loop independent
        DO IS2 = 0,NSM-1
!$acc loop independent
          DO IS1 = 0,NSM-1
!            IS = IS + 1
            IS = IS1 + IS2*NSM + IS3*NSM*NSM
            JS(IS) = 1 + IS1 + NTM(1)*IS2 + NTM(1)*NTM(2)*IS3
          ENDDO
        ENDDO
      ENDDO
!$acc end kernels
...
!$acc end data

PGI 12.6 produces the following output

     59, Generating local(js(1:nsm3))
         Generating local(aux(1:naux))
         Generating copyin(ntm(:))
         Generating copy(fseq(:sz))
         Generating copy(fclust(:sz))
     62, Generating copyin(ntm(:))
         Generating local(js(1:nsm3))
         Generating compute capability 1.0 binary
         Generating compute capability 2.0 binary
     64, Loop is parallelizable
     66, Loop is parallelizable
     68, Loop is parallelizable
         Accelerator kernel generated
         66, !$acc loop gang ! blockidx%y
         68, !$acc loop gang, vector(128) ! blockidx%x threadidx%x
             CC 1.0 : 23 registers; 56 shared, 4 constant, 0 local memory bytes
             CC 2.0 : 22 registers; 0 shared, 72 constant, 0 local memory bytes

Why does compiler generate copyin(ntm(:)) and local(js(1:nsm3)) both for line 59 and 62? PGI 12.5 doesn’t.

Hi Alexey,

The second copy message isn’t really a copy. It’s actual a “present” which has been added at the start of a compute region in order to ensure the correct association between host and device variables is maintained. By doing this, we’re now able to support a more flexible association and allow things such as pointer swapping between compute regions.

The messages are confusing though, and I have asked our compiler engineers to make them more clear.

Our apologies for the confusion.

  • Mat

Thanks