Hi. I have a piece of device code that is calling a device function:
Z(1) =-1.0 Z(2) = Zi ! Z = (/ -1.0, Zi /) lnL = r8_coulog( Ep, n, T, A, Z, Bmag )
It works fine. If however, I comment out the two lines that set Z, and uncomment the line that sets Z as a single line of code:
! Z(1) =-1.0 ! Z(2) = Zi Z = (/ -1.0, Zi /) lnL = r8_coulog( Ep, n, T, A, Z, Bmag )
I get the following compiler error:
pgfortran -fast wrapper.cuf prec_mod.cuf rand_mod.cuf curk4_mod.cuf MersenneTwister_kernel.o -mp wrapper.cuf: prec_mod.cuf: rand_mod.cuf: curk4_mod.cuf: /tmp/pgcudaforLRogVcmMvbuE.gpu(141): error: identifier "z_c_0" is undefined 1 error detected in the compilation of "/tmp/pgnvd0SogCGIz-c5r.nv0". PGF90-F-0000-Internal compiler error. pgnvd job exited with nonzero status code 0 (curk4_mod.cuf: 1243) PGF90/x86-64 Linux 10.2-1: compilation aborted
Rather disturbingly, I do have some code that uses Z_C_0 as a parameter, but it’s on a different machine on a different cluster, so I don’t think this is a problem with my code. Also, the code works OK with the cuda emulator.