Package org.jocl
Class CLException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- org.jocl.CLException
-
- All Implemented Interfaces:
java.io.Serializable
public class CLException extends java.lang.RuntimeException
An exception that may be thrown due to a OpenCL error.
Exceptions may be enabled or disabled usingCL#setExceptionsEnabled(boolean)
. If exceptions are enabled, the JOCL methods will throw a CLException if the OpenCL function did not return CL_SUCCESS.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
The serial version UIDprivate int
status
The status code from OpenCL
-
Constructor Summary
Constructors Constructor Description CLException(java.lang.String message)
Creates a new CLException with the given error message.CLException(java.lang.String message, int status)
Creates a new CLException with the given error message.CLException(java.lang.String message, java.lang.Throwable cause)
Creates a new CLException with the given error message.CLException(java.lang.String message, java.lang.Throwable cause, int status)
Creates a new CLException with the given error message.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getStatus()
Returns the status code from OpenCL that caused this exception.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
The serial version UID- See Also:
- Constant Field Values
-
status
private final int status
The status code from OpenCL
-
-
Constructor Detail
-
CLException
public CLException(java.lang.String message)
Creates a new CLException with the given error message.- Parameters:
message
- The error message for this CLException
-
CLException
public CLException(java.lang.String message, int status)
Creates a new CLException with the given error message.- Parameters:
message
- The error message for this CLExceptionstatus
- The status code from OpenCL
-
CLException
public CLException(java.lang.String message, java.lang.Throwable cause)
Creates a new CLException with the given error message.- Parameters:
message
- The error message for this CLExceptioncause
- The throwable that caused this exception
-
CLException
public CLException(java.lang.String message, java.lang.Throwable cause, int status)
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 Detail
-
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
-
-