diff options
author | Michael Bien <[email protected]> | 2010-01-20 20:39:33 +0100 |
---|---|---|
committer | Michael Bien <[email protected]> | 2010-01-20 20:39:33 +0100 |
commit | c9e1605e183d7e83af16dc8fac057e58cfc2d29b (patch) | |
tree | 61322e181ac79d4e9d733de23b2784fb686ca902 /src/com/mbien/opencl/CLException.java | |
parent | 21f0d9231227a4d2c96cb70b5061c18145591fba (diff) |
seperated CLProgram specific tests into CLProgramTest.
implemented create-program-from-binaries functionality.
javadoc fixes.
Diffstat (limited to 'src/com/mbien/opencl/CLException.java')
-rw-r--r-- | src/com/mbien/opencl/CLException.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/com/mbien/opencl/CLException.java b/src/com/mbien/opencl/CLException.java index 35c539c4..3703f235 100644 --- a/src/com/mbien/opencl/CLException.java +++ b/src/com/mbien/opencl/CLException.java @@ -3,7 +3,7 @@ package com.mbien.opencl; import static com.mbien.opencl.CL.*; /** - * Main Exception type for runtime OpenCL errors and unsuccessful function calls (e.g. returning other values than CL_SUCCESS). + * Main Exception type for runtime OpenCL errors and unsuccessful function calls (e.g. returning not CL_SUCCESS). * @author Michael Bien */ public class CLException extends RuntimeException { @@ -17,11 +17,20 @@ public class CLException extends RuntimeException { errorcode = error; } + /** + * Throws a CLException when <code>status != CL_SUCCESS</code>. + */ public static final void checkForError(int status, String message) { if(status != CL_SUCCESS) throw new CLException(status, message); } + /** + * Returns a human readable String for the OpenCL error code. + */ + public String getCLErrorString() { + return identifyError(errorcode); + } private static final String identifyError(int error) { |