Hello!

I have a task that is trivial for ‘normal’ CPU and not so trivial for GPU as there is no stack and no recursion possible.

The task is to evaluate an expression that is kept as a tree in prefix notation.

For example, the x + 2 * x expression will look like this: +(x *(2 x)).

In the tree form this expression may be visualized in the following manner (dots are used as substitutes for spaces as all extra spaces are cutted away from the message):

…+

…/…

x…*

…/…

…2…x

I have a HUGE number of such trees, they all are independent and can be evaluated in parallel. On CPU it is a simple recursion task, not sure if it is possible with CUDA …

I’d really appreciate any suggestions and comments, thanks in advance.