Does CUDA support recursion?

前端 未结 12 2502
广开言路
广开言路 2020-12-08 06:31

Does CUDA support recursion?

12条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-08 06:49

    Yeah, it is supported on the actual version. But despite the fact it is possible to execute recursive functions, you must have in mind that the memory allocation from the execution stack cannot be predicted (the recursive function must be executed in order to know the true depth of the recursion), so your stack could result being not enough for your purposes and it could need a manual increment of the default stack size

提交回复
热议问题