SIMD (single Instruction source, Multiple data sources) technologies usually do not have asynchronous task capability, as in the case of recursive functions.
Typical processors have a reasonable amount of working memory (registers and CACHE) for a small amount of Cpus (1, 2, 4 or 8), and these Cpus act independently, running separate instructions simultaneously (MIMD - Multiple Instruction sources, Multiple data sources). Typical processors can mount high Stacks of executed instruction data, allowing multiple recursive iterations of the same function. For this, they need complex and intelligent instruction pointers to store multiple return points.
SIMD co-processors, such as Gpgpus, give up such complexities and sophistications in favor of the amount of logic and arithmetic units. Imagine a device that allowed a single person to press the same operation button on several calculators, even if you could enter different values on each one. The same operation is performed simultaneously in several values. The cost of such acceleration is the sophistication of the instruction reading and interpreting system, which lacks the ability to manage several return pointers required for the use of recursion.
However, it is possible to work in parallel in Gpgpus in recursive functions, in case the terminal identification (IF clause) and other operations of the recursive function are executed in CPU, being internal calculations of each function iteration performed in GPGPU, completely alienated from the origin of the main programme instructions. As an example, the pseudo-code below.
function calcularDados( var dados, var localidade[]) //GPGPU
return calcular(localidade, dados) //GPGPU
function souRecursiva(var dados) //CPU
if dados != condição_final then //CPU
GPGPU <<dados, calcularDados>> dadosResposta //GPGPU
return souRecursiva(dadosResposta) //CPU
else //CPU
return dados //CPU
Why do you downvote?
– Ricardo
Unfortunately this is not my strong suit and I don’t know exactly what you mean by "parelelism" and "recursiveness". However seems to me something lower level, it would be C/C++?
– Guilherme Nascimento
@Guilhermenascimento Yes, parallelism would be multithreaded.
– Ricardo
Sometimes the terms in Portuguese may sound confusing to people, the question seems good, but I could revise these details, try not to change much beyond this. : ) +1 for explaining to me the terms.
– Guilherme Nascimento