diff options
Diffstat (limited to 'rs/java')
| -rw-r--r-- | rs/java/android/renderscript/Allocation.java | 2 | ||||
| -rw-r--r-- | rs/java/android/renderscript/RenderScript.java | 18 | ||||
| -rw-r--r-- | rs/java/android/renderscript/Script.java | 4 | ||||
| -rw-r--r-- | rs/java/android/renderscript/ScriptIntrinsicBLAS.java | 10 |
4 files changed, 21 insertions, 13 deletions
diff --git a/rs/java/android/renderscript/Allocation.java b/rs/java/android/renderscript/Allocation.java index 3b61f9d..70a5821 100644 --- a/rs/java/android/renderscript/Allocation.java +++ b/rs/java/android/renderscript/Allocation.java @@ -1422,6 +1422,8 @@ public class Allocation extends BaseObj { } /** + * @hide + * * This is only intended to be used by auto-generated code reflected from * the RenderScript script files and should not be used by developers. * diff --git a/rs/java/android/renderscript/RenderScript.java b/rs/java/android/renderscript/RenderScript.java index e7f210b..4f10699 100644 --- a/rs/java/android/renderscript/RenderScript.java +++ b/rs/java/android/renderscript/RenderScript.java @@ -302,8 +302,12 @@ public class RenderScript { long[] fieldIDs, long[] values, int[] sizes, long[] depClosures, long[] depFieldIDs) { validate(); - return rsnClosureCreate(mContext, kernelID, returnValue, fieldIDs, values, + long c = rsnClosureCreate(mContext, kernelID, returnValue, fieldIDs, values, sizes, depClosures, depFieldIDs); + if (c == 0) { + throw new RSRuntimeException("Failed creating closure."); + } + return c; } native long rsnInvokeClosureCreate(long con, long invokeID, byte[] params, @@ -311,8 +315,12 @@ public class RenderScript { synchronized long nInvokeClosureCreate(long invokeID, byte[] params, long[] fieldIDs, long[] values, int[] sizes) { validate(); - return rsnInvokeClosureCreate(mContext, invokeID, params, fieldIDs, + long c = rsnInvokeClosureCreate(mContext, invokeID, params, fieldIDs, values, sizes); + if (c == 0) { + throw new RSRuntimeException("Failed creating closure."); + } + return c; } native void rsnClosureSetArg(long con, long closureID, int index, @@ -337,7 +345,11 @@ public class RenderScript { synchronized long nScriptGroup2Create(String name, String cachePath, long[] closures) { validate(); - return rsnScriptGroup2Create(mContext, name, cachePath, closures); + long g = rsnScriptGroup2Create(mContext, name, cachePath, closures); + if (g == 0) { + throw new RSRuntimeException("Failed creating script group."); + } + return g; } native void rsnScriptGroup2Execute(long con, long groupID); diff --git a/rs/java/android/renderscript/Script.java b/rs/java/android/renderscript/Script.java index 6a1efee..7cd6d09 100644 --- a/rs/java/android/renderscript/Script.java +++ b/rs/java/android/renderscript/Script.java @@ -182,9 +182,9 @@ public class Script extends BaseObj { mRS.validateObject(ain); mRS.validateObject(aout); - if (ain == null && aout == null) { + if (ain == null && aout == null && sc == null) { throw new RSIllegalArgumentException( - "At least one of ain or aout is required to be non-null."); + "At least one of input allocation, output allocation, or LaunchOptions is required to be non-null."); } long[] in_ids = null; diff --git a/rs/java/android/renderscript/ScriptIntrinsicBLAS.java b/rs/java/android/renderscript/ScriptIntrinsicBLAS.java index 5e28d3f..f7e81b0 100644 --- a/rs/java/android/renderscript/ScriptIntrinsicBLAS.java +++ b/rs/java/android/renderscript/ScriptIntrinsicBLAS.java @@ -1039,14 +1039,8 @@ public final class ScriptIntrinsicBLAS extends ScriptIntrinsic { if (cM != cN) { throw new RSRuntimeException("Matrix C is not symmetric"); } - if (TransA != NO_TRANSPOSE) { - if (aN != cM) { - throw new RSRuntimeException("Called BLAS with invalid dimensions"); - } - } else { - if (aM != cM) { - throw new RSRuntimeException("Called BLAS with invalid dimensions"); - } + if (aM != cM) { + throw new RSRuntimeException("Called BLAS with invalid dimensions"); } } else if (A != null && B != null) { // A and B only |
