internal compiler error with CUDA Fortran

I define this kernel subroutine inside a module

attributes(global) SUBROUTINE txt(N, N_R, irow_R, isfu, ryrgate, ca_ds, ca_jsr, compKm, indexKm, compKp, indexKp, Pdtmin, compPdt, indexPdt)
  IMPLICIT NONE
  INTEGER, VALUE :: N, maxnklm, maxnklp, N_R, irow_R
  INTEGER, DIMENSION(N) ::  isfu
  REAL(KIND=REAL8), DIMENSION(N) :: ryrgate
  REAL(KIND=real8), DIMENSION(N) :: ca_ds, ca_jsr
  REAL(KIND=real8) ::compKm, compKp
  INTEGER :: indexKm, indexKp
  DIMENSION compKm(irow_R,N), indexKm(irow_R,N)
  DIMENSION compKp(irow_R,N), indexKp(irow_R,N)
  REAL(KIND=real8) :: Pdtmin
  REAL(KIND=real8), DIMENSION(N, N) :: compPdt
  INTEGER, DIMENSION(N, N) :: indexPdt
  
  REAL(KIND=real8), DIMENSION(N):: bigC, chiC, chiO
  REAL(KIND=real8) :: aK0, aK1
  INTEGER :: i, j

END SUBROUTINE txt

When I compile (include linking to the main subprogram also), I get the internal compiler error.

abcfunc:
     67, Memory set idiom, loop replaced by call to __c_mset8
    169, Invariant communication calls hoisted out of loop
    170, Invariant communication calls hoisted out of loop
PGF90-F-0000-Internal compiler error. unsupported operation     311 (abf_utility.f95: 222)
PGF90/x86-64 Linux 10.1-0: compilation aborted
make: *** [abc_utility.mod] Error 2

with 222 is the line number of

END SUBROUTINE txt

Hi Tuan,

Can you please send a full example that reproduces the error to PGI Customer Service (trs@pgroup.com)? Unfortunately, I’m not able to reproduce the error with this snip-it.

Thanks,
Mat

Done.

Tuan

Thanks Tuan.

The problem is that all scalar dummy arguments must either have the “VALUE” attribute or be a module device variable. Specifically, you need to add “value” to Pdtmin’s declaration.

REAL(KIND=real8), value :: Pdtmin

I’ve sent your example off to our engineers (TPR#16560) since we should be giving a syntax error for this, not an ICE.

  • Mat

I agree with you that using VALUE attribute can resolve the issue. However, we don’t need to define Pdtmin as VALUE if, before calling the device subroutine, the corresponding actual argument has already been put in the device memory (i.e. passing by reference is possible). So, I think the compiler should not issue an error, probably a warning is better. Is that correct?

Tuan.

Hi Tuan,

That makes sense. I’ve passed this on to the engineer that’s investigating the ICE.

In the meantime, you might be able to work around the ICE by making Pdtmin an array with dimension(1).

  • Mat

This has not been fixed in the new release.

Tuan

Hi Tuan,

A fix for TPR#16560 is expected in March’s 10.3 release. The report came in to late for inclusion in 10.2.

  • Mat