Fortran CUDA device function error

I have the following error message when calling a device function
Calls from device code to a host function are allowed only in emulation mode - match
Does anyone know what is wrong?

module module1
use cudafor
contains

attributes(device) logical function match(mem, cnt, a, b)
integer:: mem(32), cnt, a, b

end

attributes(global) subroutine kernel1(…)
logical match

if( match(mem,0,i,k)) then

end

subroutine hostfunction (…)

call kernel1<<<…>>>
end

end module module1

Hi jack_laconic,

Take out the “logical match” declaration from kernel1. This tells the compiler that ‘match’ is an external function so it thinks you’re trying to call a host routine called match, not the module’s match.

Hope this helps,
Mat

That works.
Thanks a lot, Mat!