Suspected compiler bug/problem - 10.9


Got a piece of code here:

do kx = 1, mx

    cx(kx) = chebev( ay, by, cxy(kx,:), my, y, iflag )


It fails to compile:

pgfortran -c curk4_mod.cuf -Mcuda=cuda3.1 -Mpreprocess
PGF90-S-0000-Internal compiler error. unsupported procedure     420 (curk4_mod.cuf: 943)
PGF90-S-0000-Internal compiler error. unsupported procedure     424 (curk4_mod.cuf: 943)
  0 inform,   0 warnings,   2 severes, 0 fatal for chebev2d
/tmp/pgcudaforZEXdztxDSNvo.gpu(282): error: argument of type "float *" is incompatible with parameter of type "signed char *"

/tmp/pgcudaforZEXdztxDSNvo.gpu(283): error: expected an expression

2 errors detected in the compilation of "/tmp/pgnvdTFXdhE7Cvz44.nv0".
PGF90-F-0000-Internal compiler error. pgnvd job exited with nonzero status code       0 (curk4_mod.cuf: 3787)
PGF90/x86-64 Linux 10.9-0: compilation aborted

However, if I do this:

do kx = 1, mx

   DUM = cxy(kx,:)
   cx(kx) = chebev( ay, by, DUM, my, y, iflag )


It compiles fine…is this what’s expected? I think this is related to a problem I posted about some months ago for compiler ver. 10.2-1.



Hi Rob,

This is a known issue where the compiler should be issuing a semantic error. The problem is in order to pass an array section, the compiler needs to create a temporary array. However, CUDA does not yet allow for allocation on the device so the compiler can’t create the temp array (the ‘unsupported procedure’ is a call to malloc).

As you discovered, the work around is to create a fixed size temp array to hold the array section and then pass in the temp array.

Hope this helps,

Interesting. Thanks for letting me know Mat.