Hi,
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
contains
attributes(global) subroutine k_test(i,adev)
integer,value :: i
integer :: adev(1)
i=i+threadidx%x
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)
allocate(adev(1))
i=10
call k_test<<<dimGrid,dimBlock>>>(i,adev)
a(1)=adev(1)
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)
write(,)a(1)
pause
end program prog