tags:

views:

34

answers:

1

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.

+2  A: 

yes, just mark function with __device__ and it will be callable only from GPU. Check CUDA guide, section B.1 http://developer.download.nvidia.com/compute/cuda/3_0/toolkit/docs/NVIDIA_CUDA_ProgrammingGuide.pdf

Andrey