CUDA - Call device subroutine


sorry for my many question, but i hope you will help me anyway.

I tried to call a “device” subroutine in a “global” subroutine. In the emulation mode erverthing works fine, but if i want to built my code (without the emulation mode) i get a windows message “cudafe.exe does not longer works”.

My compute capability is 1.0 and i program with the CUDA Fortran Compiler 10.3.

Here is a sample:

module m_test

use cudafor


attributes(global) subroutine k_test(i,adev)

integer,value :: i
integer :: adev(1)


adev(1) = i+100

Call k_test2(i,adev)

end subroutine k_test

attributes(device) subroutine k_test2(i,adev)

integer :: adev(1)
integer,value :: i

adev(1) = adev(1)+111+i

end subroutine k_test2

subroutine h_test(i,a)

integer :: i
integer :: a(1)
integer,device,allocatable,dimension(:) :: adev
type(dim3) :: dimGrid,dimBlock

dimGrid = dim3(1,1,1)
dimBlock = dim3(1,1,1)



call k_test<<<dimGrid,dimBlock>>>(i,adev)


end subroutine h_test

end module m_test

program prog

use m_test

implicit none

integer :: i
integer :: a(1)

Call h_test(i,a)



end program prog

I tried the same at an other PC. There has the graphic board a compute capabilty of 1.1. On both PCs is windows 2007 installed.
In my last post i predicate i am working with CUDA Fortran 10.3. Sorry but this is wrong. I am working with CUDA Fortran 10.2.
I need to work with different subroutines. So i hope you can help me.

Does Cuda Fortran work on Linux more stable?


i have found the problem. The module has to start with the device subroutine. That is stupid!

But I get an ICE if i call a device subroutine with more than 4 arguments.

error F0000 : Internal compiler error. pgnvd job exited with nonzero status code 0

Hi JensWiese95812,

I think you’re hitting a compiler error that was resolved with the 10.3 release. I’m able to successfully compile the code as is with 10.3 but get the same pgnvd error with 10.2.

Hope this helps,