summaryrefslogtreecommitdiffstats
path: root/src/com/mbien/opencl/CLException.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/mbien/opencl/CLException.java')
-rw-r--r--src/com/mbien/opencl/CLException.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/mbien/opencl/CLException.java b/src/com/mbien/opencl/CLException.java
index f439e89b..5806d41d 100644
--- a/src/com/mbien/opencl/CLException.java
+++ b/src/com/mbien/opencl/CLException.java
@@ -22,6 +22,12 @@ public class CLException extends RuntimeException {
super(identifyError(error) + ": " + message);
}
+ public static final void checkForError(int status, String message) {
+ if(status != CL.CL_SUCCESS)
+ throw new CLException(status, message);
+ }
+
+
private static final String identifyError(int error) {
switch (error) {