not a single-entry single-exit region

Hi,

My compiler is giving me an error “not a single-entry single-exit region”. When I check the region that its pointing to, the code is

	!$acc kernels loop
      DO 1525 K=1,KMM1
      DO 1525 J=1,JMM1
      DO 1525 I=1,IMM1
      DELTA         = STORE(I,J,K)
      ABSCHG        = ABS(DELTA)
      STORE(I,J,K)  = DELTA/(1+ ABSCHG/AVGCHG)
 1525 CONTINUE

I’m struggling to see why this isn’t a single-entry, single-exit region? If its obvious, please forgive me as I’m just starting out with Fortran!

Thanks,

Chris

Hi Chris,

Sorry, but I don’t see anything obvious. Can you either post or send to PGI Customer Service (trs@pgroup.com) a reproducing example?

I tried to reproduce the error with a simple test case, but was unable.

  • Mat
% cat test.f90 

      subroutine foo(STORE,KMM1,JMM1,IMM1,AVGCHG)

      integer KMM1,JMM1,IMM1
      real STORE(IMM1,JMM1,KMM1)
      integer I,J,K
      real DELTA,ABSCHG,AVGCHG
      
!$acc kernels loop
      DO 1525 K=1,KMM1
      DO 1525 J=1,JMM1
      DO 1525 I=1,IMM1
         DELTA         = STORE(I,J,K)
         ABSCHG        = ABS(DELTA)
         STORE(I,J,K)  = DELTA/(1+ ABSCHG/AVGCHG)
 1525 CONTINUE

      end subroutine foo 
% pgf90 -c test.f90 -acc -Minfo=accel
foo:
      9, Generating present_or_copy(store(:imm1,:jmm1,:kmm1))
         Generating NVIDIA code
         Generating compute capability 1.0 binary
         Generating compute capability 2.0 binary
         Generating compute capability 3.0 binary
     10, Loop is parallelizable
     11, Loop is parallelizable
     12, Loop is parallelizable
         Accelerator kernel generated
         11, !$acc loop gang ! blockidx%y
         12, !$acc loop gang, vector(128) ! blockidx%x threadidx%x

Hi Mat,

I’ve sent an email to customer service.

Thanks,

Chris

Hi Chris,

It’s the GOTO that’s used to jump around this section. Somehow when you use the “kernels loop” where looking ahead and see the where the goto jumps in. I’ll write-up a report since we should be able to handle this case.

The work around is define the start and end of the kernels region:

      IF(FACDAMP.LT.1.0.OR.FACDAMP.GT.99.9) GO TO 1530
      AVGCHG = FACDAMP*SUMCHG/NPOINTS

!$acc kernels 
      DO 1525 K=1,KMM1
      DO 1525 J=1,JMM1
      DO 1525 I=1,IMM1
      DELTA         = STORE(I,J,K)
      ABSCHG        = ABS(DELTA)
      STORE(I,J,K)  = DELTA/(1. + ABSCHG/AVGCHG)
 1525 CONTINUE
!$acc end kernels
 1530 CONTINUE

Hope this helps,
Mat