The following will not compile with -Mcuda=llvm and -O2, but does compile with -O1.
subroutine evolve_potl(u,d,potl)
implicit none
integer, parameter :: mx=1024
complex*16, parameter :: im = (0d0,1d0)
complex*16, device, dimension(mx) :: u, d
real*8, device, dimension(mx) :: potl
complex*16 spin
integer i
!$cuf kernel do(1) <<< (*), (*) >>>
do i=1,mx
spin=exp(im*potl(i))
u(i)=u(i)*spin
d(i)=d(i)*spin
enddo
return
end
The error messages are
nvvmCompileProgram error: 9.
Error: PGI-14.1-potl-bug-1D.n001.gpu (145, 4): parse error: multiple definition of local value named ‘li77’
PGF90-F-0155-Compiler failed to translate accelerator region (see -Minfo messages): Device compiler exited with error status code (PGI-14.1-potl-bug-1D.f90: 1)
PGF90/x86-64 Linux 14.1-0: compilation aborted