Problem with complex constant in pgf90 v14.1

Hi,

I’m trying to compile the following code with pgf90 (v14.1):

module constant

complex, constant,public :: cmplx_0_d=(0.0,0.0)

end module constant


program test

use constant

implicit none

complex, device :: a
complex :: b

b = cmplx(1.0,1.0)
a = cmplx_0_d
b = a
write(,) b


end program test

I get the following error when compiling:

[adrianj@hydra]$ pgf90 -acc -Minfo=all -o test constant.CUF test.CUF
constant.CUF:
/home/h018/adrianj/temp/pgcudaforJjHbPlEc6IQb.gpu(6): error: expected a “}”

1 error detected in the compilation of “/home/h018/adrianj/temp/pgnvd-kHb9-D1qqHE.nv0”.
PGF90-F-0155-Compiler failed to translate accelerator region (see -Minfo messages): Device compiler exited with error status code (constant.CUF: 1)
PGF90/x86-64 Linux 14.1-0: compilation aborted
test.CUF:


Is a fortran complex type not allowed to be setup in the constant memory or is this just a compiler bug?

thanks

adrianj

Thanks adrianj. I’ve recreated the issue here and sent a report (TPR#20072) to our engineers for further investigation.

The work around would be to initialize the variable from executable host code.

module constant

 complex, constant,public :: cmplx_0_d

 end module constant


 program test

 use constant

 implicit none

 complex, device :: a
 complex :: b
 cmplx_0_d=(0.0,0.0)

 b = cmplx(1.0,1.0)
 a = cmplx_0_d
 b = a
 write(*,*) b


 end program test

Best regards,
Mat

thanks Mat

TPR 20072 - UF: Initializing a constant complex module varible give GPU syntax
has been fixed in the current 14.7 release.

thanks,
dave