compiler or me?

The following

module mod
  use cudafor
contains
  attributes(global)  subroutine sub(int,n)
    implicit none
    integer :: i,n
    real :: a
    integer(8) :: int(n)
    do i=1,n
       a=i
       int(i)=n*cos(a)
    end do
  end subroutine sub
end module mod

generates the error message

PGF90-S-0000-Internal compiler error. unsupported operation 105 (compiler.CUF: 13)
0 inform, 0 warnings, 1 severes, 0 fatal for sub
compiler.001.gpu(16): error: expected an expression

1 error detected in the compilation of “/tmp/pgnvdhk9cvOu9fZPe.nv0”.
PGF90-F-0000-Internal compiler error. pgnvd job exited with nonzero status code 0 (compiler.CUF: 12)
PGF90/x86-64 Linux 11.1-0: compilation aborted
Exit 2

When I replace " integer(8) :: int(n)" by integer :: int(n)" the compilation completes successfully. This is also the case if I replace “cos(a)” by “nint(cos(a))”

What am I doing wrong?

BTW, I compile with “pgfortran -c compiler.CUF -Mcuda=keepgpu” so that I can look at the file called compiler.001.gpu to see what the compiler might be talking about in its obscure message.

Hi Peter,

This is a compiler error. Looks like we have a problem when doing an implicit cast from real to integer*8. I’ve added a problem report (TPR#17706) and have sent it on to our compiler engineers. Hopefully we can have it fixed here shortly.

Thanks for the report,
Mat

This problem is now corrected in the currently available 11.7 release.
It may have been fixed in 11.5 or 11.6, but we are closing the problem now.

Thanks again for the original report.

dave