Function recursion

Does CUDA support call recursion for function? Something like:

struct Node


   int i;

   Node *child;


void IterateTree ( Node* node )


  //do something



or is stackless/inlines automatically all the function calls?


Function calls are inlined.


No, recursive calls don’t work - it is stackless.

You can use function template recursion if the recursion can be unrolled completely by the preprocessing step (see nvcc -v what happens), ie. if the terminating expression can be computed at compile time.