I would like to know if RenderScript engine can be used to optimize an algorithm.
The algorithm does iterative processing over an image until some conditions are met. There is no way to know before processing the number of iterations needed. But I only saw RenderScript examples that work over a well defined Allocation that has N Elements (the typical example is that a Kernel executes for every pixels in bitmap).
One solution would be create a Java "while" cycle, and on each iteration call the RenderScript code (it will have just one Element, one single kernel cycle), and check from java when the algorithm finishes. Would this be performant? I mean, I will have to pass a bitmap to RenderScript, would this cause an entire copy to be made? Wouldnt be NDK a better solution in this case?
Which would be the best performant approach to solve this?
Thanks! Juan Ignacio