diff options
author | Stephen Hines <srhines@google.com> | 2015-07-23 22:39:29 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-07-23 22:39:29 +0000 |
commit | ed3ffe0fc86de016ff2b4231e2fcc74a6119f6c7 (patch) | |
tree | ee2b15b3106fa14e5649eee6305e1375a245fa19 /rs/java/android/renderscript/Script.java | |
parent | bbcc914b18a5b2ea57e25e6e79336c5c75d49421 (diff) | |
parent | 6430812a9381af01b0c7b48cedd6a11c1add6942 (diff) |
am 6430812a: Merge "RenderScript: implement a Script entry point for calling a reduce-style kernel."
* commit '6430812a9381af01b0c7b48cedd6a11c1add6942':
RenderScript: implement a Script entry point for calling a reduce-style kernel.
Diffstat (limited to 'rs/java/android/renderscript/Script.java')
-rw-r--r-- | rs/java/android/renderscript/Script.java | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/rs/java/android/renderscript/Script.java b/rs/java/android/renderscript/Script.java index 10831147b74d..dfd0ea35ee0e 100644 --- a/rs/java/android/renderscript/Script.java +++ b/rs/java/android/renderscript/Script.java @@ -284,6 +284,35 @@ public class Script extends BaseObj { mRS.nScriptForEach(getID(mRS), slot, in_ids, out_id, params, limits); } + /** + * Only intended for use by generated reflected code. + * + * @hide + */ + protected void reduce(int slot, Allocation ain, Allocation aout, LaunchOptions sc) { + mRS.validate(); + mRS.validateObject(ain); + mRS.validateObject(aout); + + if (ain == null || aout == null) { + throw new RSIllegalArgumentException( + "Both ain and aout are required to be non-null."); + } + + long in_id = ain.getID(mRS); + long out_id = aout.getID(mRS); + + int[] limits = null; + if (sc != null) { + limits = new int[2]; + + limits[0] = sc.xstart; + limits[1] = sc.xend; + } + + mRS.nScriptReduce(getID(mRS), slot, in_id, out_id, limits); + } + long[] mInIdsBuffer; Script(long id, RenderScript rs) { @@ -292,7 +321,6 @@ public class Script extends BaseObj { mInIdsBuffer = new long[1]; } - /** * Only intended for use by generated reflected code. * |