Package org.jocl
Class CLException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.jocl.CLException
- All Implemented Interfaces:
Serializable
An exception that may be thrown due to a OpenCL error.
Exceptions may be enabled or disabled using
Exceptions may be enabled or disabled using
CL#setExceptionsEnabled(boolean)
.
If exceptions are enabled, the JOCL methods will throw a
CLException if the OpenCL function did not return CL_SUCCESS.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
The serial version UIDprivate final int
The status code from OpenCL -
Constructor Summary
ConstructorsConstructorDescriptionCLException
(String message) Creates a new CLException with the given error message.CLException
(String message, int status) Creates a new CLException with the given error message.CLException
(String message, Throwable cause) Creates a new CLException with the given error message.CLException
(String message, Throwable cause, int status) Creates a new CLException with the given error message. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the status code from OpenCL that caused this exception.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDThe serial version UID- See Also:
-
status
private final int statusThe status code from OpenCL
-
-
Constructor Details
-
CLException
Creates a new CLException with the given error message.- Parameters:
message
- The error message for this CLException
-
CLException
Creates a new CLException with the given error message.- Parameters:
message
- The error message for this CLExceptionstatus
- The status code from OpenCL
-
CLException
Creates a new CLException with the given error message.- Parameters:
message
- The error message for this CLExceptioncause
- The throwable that caused this exception
-
CLException
Creates a new CLException with the given error message.- Parameters:
message
- The error message for this CLExceptioncause
- The throwable that caused this exceptionstatus
- The status code from OpenCL
-
-
Method Details
-
getStatus
public int getStatus()Returns the status code from OpenCL that caused this exception. For example, the value ofCL.CL_INVALID_DEVICE
- Returns:
- The OpenCL status code
-