Reduction kernel call from Single-Source in RenderScript

260 Views Asked by At

I implemented an algorithm in Single-Source. Now, I want to decrease my algorithm's processing time with reduction.

Can reduction kernels be called from Single-Source in RenderScript?

2

There are 2 best solutions below

0
On BEST ANSWER

In short, no. From the Renderscript documentation (bold is mine):

Android 7.0 (API level 24) introduces a new programming feature called Single-Source RenderScript, in which kernels are launched from the script where they are defined, rather than from Java. This approach is currently limited to mapping kernels, which are simply referred to as "kernels" in this section for conciseness.

However, I think you may also be confused about what a reduction kernel is. A reduction kernel is one which takes an input Allocation and outputs a single value (such as a minimum or maximum, the sum, etc.) It is not the same as optimizing your kernel, which is what it sounds like you are trying to do.

0
On

No, unfortunately you can't, I'm sorry.