Package org.jocl

Class CLException

All Implemented Interfaces:
Serializable

public class CLException extends RuntimeException
An exception that may be thrown due to a OpenCL error.

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 Details

    • serialVersionUID

      private static final long serialVersionUID
      The serial version UID
      See Also:
    • status

      private final int status
      The status code from OpenCL
  • Constructor Details

    • CLException

      public CLException(String message)
      Creates a new CLException with the given error message.
      Parameters:
      message - The error message for this CLException
    • CLException

      public CLException(String message, int status)
      Creates a new CLException with the given error message.
      Parameters:
      message - The error message for this CLException
      status - The status code from OpenCL
    • CLException

      public CLException(String message, Throwable cause)
      Creates a new CLException with the given error message.
      Parameters:
      message - The error message for this CLException
      cause - The throwable that caused this exception
    • CLException

      public CLException(String message, Throwable cause, int status)
      Creates a new CLException with the given error message.
      Parameters:
      message - The error message for this CLException
      cause - The throwable that caused this exception
      status - 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 of CL.CL_INVALID_DEVICE
      Returns:
      The OpenCL status code