Is local RenderScript synchronization possible?

In a recent SO question, I explained how repeatedly accessing the RenderScript core will effectively cause all threads to synchronize globally between calls.

I am currently working with several convolutions applied in sequence to image data. Since the convolution algorithm requires reading the surrounding pixel data of the input image, I implemented a workflow when my own custom kernel is called several times - so that at each step all the data from the previous convolution was ready and accessible at the correct coordinates. This method has worked fine for me so far.

However, in my constant quest for optimization, I noticed that there is more performance that can be achieved by storing intermediate values ​​in local registers for the thread, rather than writing them back to the global memory allocation between kernel calls. If I could connect these convolutions in this way, everything would be much faster. The problem is that access to the registers of surrounding streams is not possible. In addition, this will require thread synchronization to ensure that these intermediate values ​​between steps are calculated in the expected order.

In CUDA and OpenCL, these problems are very common and are solved with the help of well-known barrier synchronization technologies + shared memory, which, in turn, depend on the concept of CUDA thread blocks or OpenCL workgroups. I believe that these concepts do not exist in RenderScript, since this problem is very much connected with completely different architectures between the desktop GPU and mobile SoC.

So my obvious question is: are such things possible in RenderScript? That is, it is better to manage streams and, possibly, groups of streams for faster data exchange between them.


" Google I/O 2013 RenderScript" , Script , , ; , DAG , , , , . , , , , .

, , , DAG ( ). , Script - , , , . , , , , , - "" .

, , . , , , RenderScript .

, , , , , , RS.

!

+3
1

, RS . , , ScriptGroup. , script , script. , , . , "" script RS . ScriptGroup script , script . , ​​ ( ) . , , script script .. ( CPU GPU/DSP). Java , .

-, , ScriptGroup Script.KernelID Script.FieldID, script . , RS. getKernelID_<name> ( "" - script), .

+3

All Articles