Why doesn't OpenCL support recursion?

I am currently working on an OpenCL project and I am wondering why it does not support recursion. Is this related to parallelism?

+3


source to share


2 answers


I think it has something to do with the target hardware. To support recursion, several hardware features are required that certain OpenCL device classes (i.e. GPUs) lack. Without them, maintaining the call stack and unwrapping indirect code is impractical. NVIDIA does not support recursion on all of its CUDA hardware for the same reason.



+5


source


Its not OpenCL, its hardware GPU. AMD has developed a new instruction set architecture that will support recursion. GPUs have a large number of registers (up to 32K). So be careful what you ask for and what you receive. Push / Pop from 32K registers, for recursive calling, will not be fast.



+3


source







All Articles