diff options
Diffstat (limited to 'src/com/mbien/opencl/CLException.java')
-rw-r--r-- | src/com/mbien/opencl/CLException.java | 6 |
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) { |