简体   繁体   中英

Reduction kernel call from Single-Source in RenderScript

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?

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.

不,很遗憾,您不能,对不起。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM