1

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?

Stephen Kennedy
  • 20,585
  • 22
  • 95
  • 108
Szilárd Gerlei
  • 247
  • 2
  • 7
  • I honestly can't tell what is mean by "Single-Source". Can you improve your question by [editing](https://stackoverflow.com/posts/49090927/edit) it with additional information about what algorithm you are trying to accomplish and what you've tried to improve performance. – Morrison Chang Mar 04 '18 at 01:22

2 Answers2

3

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.

Larry Schiefer
  • 15,687
  • 2
  • 27
  • 33
0

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

Charles Tempo
  • 496
  • 4
  • 7