You cannot call a __device__
function from host code. If you're indicating that the PyCUDA tutorial code shows how to do this, I'd like to see that tutorial.
It's not clear to me what you're trying to accomplish with calling the __device__
function from host code that could not be done with an ordinary kernel (__global__
) launch.