'Pass cuda array to host function

I'm not able to find any answer to this. Is it possible to pass a device array (pointer) to a host function? Inside this host function a kernel will be launched which will use the device array. I don't want to copy the data from host to device every time I call the (host) function, so that's why I copy the data (from host to device) before calling the (host) function. The kernel within this function will always use the same device array.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source