I have a __global__ function in CUDA. Can it call itself?
Here is my example:
__global__ void
force_create_empty_nodes (struct NODE *Nodes, int topnode, int bits, int no, int x, int y,
int z, struct topnode_data *TopNodes)
{
/// * Some code *///
force_create_empty_nodes <<<1, 8>>>(Nodes, topnode+1, bits+1, no+1,
x+1, y+1, z+1, TopNodes);
}
And error I receive is:
error: kernel launch from __device__ or __global__ functions requires separate compilation mode
Here is my make command:
nvcc -c -arch compute_35 cudaForceNodes.cu -o obj/cudaForceNodes.o