Hi,
I have a complex iterative optimisation problem involving several steps. One of those steps involves taking the current iteration, and using values from it to render dozens of versions of a simple scene, then taking those renderings and performing some calculations on the pixels to create values which are then fed back into the optimisation algorithm. These steps are iterated many times.
This pseudo code illustrates roughly what I have in mind
array_A[100]
array_b[100]
fill array_A from CPU
Loop 100 times
{
perform step 1 on array_A
use values in array_A as angles to render 100 images of a cube with different rotations
sum pixels in each image, and write results to array_B
add array_B to array_A
}
Transfer array_A back to CPU
One way to do this would be to use the CPU to take information from OpenCL, use it to render all of these scenes, then Enqueue the kernels to process the renderings. However, a faster way must surely be to keep everything on the GPU, without involving the CPU.
Is this possible?
Hugo