When I compile the code followed:
module INTRINSICTEST
use cudadevice
real*8,constant :: tab(0:51)
contains
attributes(device) FUNCTION my_fast_scale(a, i)
real*8 :: my_fast_scale
real*8 :: a
integer :: i
integer :: ihi,ilo
ihi = _double2loint(a)
ilo = _double2hiint(a)
my_fast_scale = _hiloint2double (ISHFT(i,20)+ihi,ilo)
END FUNCTION
attributes(global) SUBROUTINE test
print*, my_fast_scale(2.5d0,-1)
end SUBROUTINE
end module
PROGRAM test
use cudafor
USE INTRINSICTEST
call test<<<1,1>>>
end PROGRAM
I got these errors:
pgfortran BoysFunction.cuf -lcudadevice -lcudart -lcudafor -Mcuda=cc35,cuda6.5
PGF90-S-0155-Calls from device code to a host function are allowed only in emulation mode - _double2loint (BoysFunction.cuf: 11)
PGF90-S-0155-Calls from device code to a host function are allowed only in emulation mode - _double2hiint (BoysFunction.cuf: 12)
PGF90-S-0155-Calls from device code to a host function are allowed only in emulation mode - _hiloint2double (BoysFunction.cuf: 14)
0 inform, 0 warnings, 3 severes, 0 fatal for my_fast_scale
How can I use the device intrinsic correctly?