Using COLLAPSE clause in PGI Accelerator Model?

I know a COLLAPSE clause is present in 12.6. I have a loop nest and I want to collapse two loops, my present code structure:

!$ACC DO PARALLEL(64) PRIVATE(...)
DO k=k0,k1
   !I want to Collapse i and j
   !$ACC DO PARALLEL(4)
   DO i=i0,i1
      !$ACC DO VECTOR(128)
      DO j=j0,j1
....

I tried using collapse, but noticed that the compiler did not show any messages pertaining to it. Can anyone please show me a short code snippet with it’s usage?

Thank you
Sayan

Hi Sayan,

Collapse is only part of OpenACC so you’ll need to change to the OpenACC syntax. Something like:

!$ACC PARALLEL VECTOR_LENGTH(128)
!$ACC LOOP COLLAPSE(2) GANG PRIVATE(...)
DO k=k0,k1
   DO i=i0,i1
      !$ACC LOOP VECTOR
      DO j=j0,j1

Hope this helps,
Mat