I seem to have found an oddity with constant memory declaration that is…puzzling me. Can someone tell me what I’m doing wrong?
To wit, if I try and compile this:
program test use cudafor implicit none real, constant :: const(40) write (*,*) 'Test' end program test
(1224) > pgfortran -Mcuda test.F90 PGF90-S-0134-Illegal attribute constant not allowed in host subprograms (test.F90: 7) 0 inform, 0 warnings, 1 severes, 0 fatal for test (1225) >
But if I do this:
program test use cudafor implicit none real :: const(40) attributes(constant) :: const write (*,*) 'Test' end program test
it compiles just fine:
(1233) > pgfortran -Mcuda test.att.F90 (1234) >
So, I’m wondering is the first correct in saying that it’s illegal (though the CUDA Fortran Guide seems to say it’s okay), or is the second one wrong in allowing compilation to occur? I don’t know which behavior to trust…if either.
FYI: I’m using PGI 12.5, but it seems to occur just the same with V 11.10.