From c9e1605e183d7e83af16dc8fac057e58cfc2d29b Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Wed, 20 Jan 2010 20:39:33 +0100 Subject: seperated CLProgram specific tests into CLProgramTest. implemented create-program-from-binaries functionality. javadoc fixes. --- src/com/mbien/opencl/CLException.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/com/mbien/opencl/CLException.java') 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 status != CL_SUCCESS. + */ 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) { -- cgit v1.2.3