Is there any ways i can have a function inside cuda kernel. I mean my cuda kernel gets pretty long and hard to debug at one point. Thanks.
1 Answer
yes, just mark function with __device__
and it will be callable only from GPU. Check CUDA Programming guide, section B.1
Here is the direct link
-
2Thanks for the information. The direct link is in: docs.nvidia.com/cuda/cuda-c-programming-guide/… Commented Jan 24, 2014 at 17:45
-
And how about nested calls of several levels? Do we need to mark all those functions with device ?– Hack06Commented Aug 1, 2018 at 20:50