ICE when access an un-defined variable in kernel

Hi,
Is it possible that PGI Fortran can detect an undefined variable that is being used in a kernel.

I get this ICE error when I accidentally use an undeclared variable, and the error message is quite hard to know what the error is.

1 error detected in the compilation of “/tmp/pgnvdgr_bsRajrAKl.nv0”.
PGF90-F-0000-Internal compiler error. pgnvd job exited with nonzero status code 0 (leak_gpu_utility.f95: 464)
PGF90/x86-64 Linux 10.9-0: compilation aborted

For example: Even though b can be defined somewhere else on in the host code (to reside on global device memory), there is a possibility that b is an undefined variable, and PGI Fortran v10.9 cannot detect this.

attributes(global) subroutine mykernel()
  use cudafor
  implicit none
  integer::  r_a
   r_a = b  // b is not declared
end subroutine

Thanks,
Tuan

Hi Tuan,

Is it possible that PGI Fortran can detect an undefined variable that is being used in a kernel.

It should and does in your simple case. I’m not sure why it’s not in your larger application. Can you please send a report to PGI Customer Support (trs@pgroup.com)?

Thanks,
Mat

% cat test.cuf
module foo

contains

attributes(global) subroutine mykernel()
  use cudafor
  implicit none
  integer::  r_a
   r_a = b  ! b is not declared
end subroutine 

end module foo
% pgf90 -c test.cuf -V10.9
PGF90-S-0038-Symbol, b, has not been explicitly declared (test.cuf)
  0 inform,   0 warnings,   1 severes, 0 fatal for mykernel

Thanks, Mat. I’ll ask if I can send the code.

Tuan