[CUDA Fortran] .gpu error

Hello,

I have a weird error when compiling CUDA Fortran.

I receive

/tmp/pgcudafor6tecUW6Srfqs.gpu(29): error: expected an identifier
/tmp/pgcudafor6tecUW6Srfqs.gpu(138): error: expected a "("
/tmp/pgcudafor6tecUW6Srfqs.gpu(138): error: expression must have integral or enum type
/tmp/pgcudafor6tecUW6Srfqs.gpu(142): error: expected an expression
/tmp/pgcudafor6tecUW6Srfqs.gpu(142): error: expected an expression
5 errors detected in the compilation of "/tmp/pgnvdpuecTHvkmQAw.nv0".
PGF90-F-0000-Internal compiler error. pgnvd job exited with nonzero status code

all vars are of type float

when compiling the following code :

delta=psiroe*(abs(u)+abs(v)+c)
vl=qn
switch=(.5+sign(.5,abs(vl)-delta))
ambda1=switch*(abs(vl))+(1.-switch)* &
((vl**2+delta**2)/(2.*delta+cut0x))

or

delta=psiroe*(abs(u)+abs(v)+c)
vl=qn
switch = 1.
if(abs(vl) .lt. delta) switch = 0.
ambda1=switch*(abs(vl))+(1.-switch)* &
((vl**2+delta**2)/(2.*delta+cut0x))

but when go round the problems and doing

delta=psiroe*(abs(u)+abs(v)+c)
vl=qn
ambda1=(.5+sign(.5,abs(vl)-delta))*(abs(vl))+(1.-(.5+sign(.5,abs(vl)-delta)))* &
                ((vl**2+delta**2)/(2.*delta+cut0x))

it compiles without even a warning.

I looked at the generated .gpu and all seems ok in all cases.

Do someone know the reason of this ?

Hi mbpl,

Do someone know the reason of this ?

These types of errors mean that the compiler is generating incorrect GPU code. If you can send an example code that exhibits the error to PGI customer service (trs@pgroup.com) we would appreciate it.

Note that we have just released version 10.2 which includes several fixes for CUDA Fortran and it’s possible that your error has already been corrected.

Thanks,
Mat

Hi Mat,

Thanks for your response.

I will ask to know if I can send you a piece of code.

Regards,

Matthieu