Class CL22

Direct Known Subclasses:
CL30

public class CL22 extends CL21
The core OpenCL 2.2 functionality.
  • Field Details

    • CL_VERSION_2_2

      public static final int CL_VERSION_2_2
      OpenCL Version.
      See Also:
    • CL_INVALID_SPEC_ID

      public static final int CL_INVALID_SPEC_ID
      Returned when the specified specialization constant ID is not valid for the specified program.
      See Also:
    • CL_MAX_SIZE_RESTRICTION_EXCEEDED

      public static final int CL_MAX_SIZE_RESTRICTION_EXCEEDED
      Returned when the size of the specified kernel argument value exceeds the maximum size defined for the kernel argument.
      See Also:
    • CL_PROGRAM_SCOPE_GLOBAL_CTORS_PRESENT

      public static final int CL_PROGRAM_SCOPE_GLOBAL_CTORS_PRESENT
      Accepted as the param_name parameter of GetProgramInfo, returns a cl_bool value.

      This indicates that the program object contains non-trivial constructor(s) that will be executed by runtime before any kernel from the program is executed. This information is only available after a successful program executable has been built for at least one device in the list of devices associated with program.

      Querying CL_PROGRAM_SCOPE_GLOBAL_CTORS_PRESENT may unconditionally return FALSE if no devices associated with program support constructors for program scope global variables. Support for constructors and destructors for program scope global variables is required only for OpenCL 2.2 devices.

      See Also:
    • CL_PROGRAM_SCOPE_GLOBAL_DTORS_PRESENT

      public static final int CL_PROGRAM_SCOPE_GLOBAL_DTORS_PRESENT
      Accepted as the param_name parameter of GetProgramInfo, returns a cl_bool value.

      This indicates that the program object contains non-trivial destructor(s) that will be executed by runtime when program is destroyed. This information is only available after a successful program executable has been built for at least one device in the list of devices associated with program.

      Querying CL_PROGRAM_SCOPE_ GLOBAL_CTORS_PRESENT may unconditionally return FALSE if no devices associated with program support destructors for program scope global variables. Support for constructors and destructors for program scope global variables is required only for OpenCL 2.2 devices.

      See Also:
  • Method Details

    • nclSetProgramReleaseCallback

      public static int nclSetProgramReleaseCallback(long program, long pfn_notify, long user_data)
      Unsafe version of: SetProgramReleaseCallback
    • clSetProgramReleaseCallback

      public static int clSetProgramReleaseCallback(long program, CLProgramReleaseCallbackI pfn_notify, long user_data)
      Registers a user callback function with a program object.

      Each call to clSetProgramReleaseCallback registers the specified user callback function on a callback stack associated with program. The registered user callback functions are called in the reverse order in which they were registered. The user callback functions are called after destructors (if any) for program scope global variables (if any) are called and before the program is released. This provides a mechanism for the application (and libraries) to be notified when destructors are complete.

      Parameters:
      program - a valid program object
      pfn_notify - the callback function that can be registered by the application. This callback function may be called asynchronously by the OpenCL implementation. It is the applications responsibility to ensure that the callback function is thread safe.
      user_data - a pointer to user supplied data. user_data will be passed as the user_data argument when pfn_notify is called. user_data can be NULL.
      See Also:
    • nclSetProgramSpecializationConstant

      public static int nclSetProgramSpecializationConstant(long program, int spec_id, long spec_size, long spec_value)
      Parameters:
      spec_size - specifies the size in bytes of the data pointed to by spec_value. This should be 1 for boolean constants. For all other constant types this should match the size of the specialization constant in the SPIR-V module.
    • clSetProgramSpecializationConstant

      public static int clSetProgramSpecializationConstant(long program, int spec_id, ByteBuffer spec_value)
      Sets the values of a SPIR-V specialization constants.

      Calling this function multiple times for the same specialization constant shall cause the last provided value to override any previously specified value. The values are used by a subsequent BuildProgram call for the program.

      Application is not required to provide values for every specialization constant contained in SPIR-V module. SPIR-V provides default values for all specialization constants.

      Parameters:
      program - must be a valid OpenCL program created from a SPIR-V module
      spec_id - identifies the SPIR-V specialization constant whose value will be set
      spec_value - a pointer to the memory location that contains the value of the specialization constant. The data pointed to by spec_value are copied and can be safely reused by the application after clSetProgramSpecializationConstant returns. This specialization value will be used by subsequent calls to BuildProgram until another call to clSetProgramSpecializationConstant changes it. If a specialization constant is a boolean constant, spec_value should be a pointer to a cl_uchar value. A value of zero will set the specialization constant to false; any other value will set it to true.
      Returns:
      SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
      • INVALID_PROGRAM if program is not a valid program object created from a SPIR-V module.
      • INVALID_SPEC_ID if spec_id is not a valid specialization constant ID
      • INVALID_VALUE if spec_size does not match the size of the specialization constant in the SPIR-V module, or if spec_value is NULL.
      • OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.
      • OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.
      See Also:
    • clSetProgramSpecializationConstant

      public static int clSetProgramSpecializationConstant(long program, int spec_id, ShortBuffer spec_value)
      Sets the values of a SPIR-V specialization constants.

      Calling this function multiple times for the same specialization constant shall cause the last provided value to override any previously specified value. The values are used by a subsequent BuildProgram call for the program.

      Application is not required to provide values for every specialization constant contained in SPIR-V module. SPIR-V provides default values for all specialization constants.

      Parameters:
      program - must be a valid OpenCL program created from a SPIR-V module
      spec_id - identifies the SPIR-V specialization constant whose value will be set
      spec_value - a pointer to the memory location that contains the value of the specialization constant. The data pointed to by spec_value are copied and can be safely reused by the application after clSetProgramSpecializationConstant returns. This specialization value will be used by subsequent calls to BuildProgram until another call to clSetProgramSpecializationConstant changes it. If a specialization constant is a boolean constant, spec_value should be a pointer to a cl_uchar value. A value of zero will set the specialization constant to false; any other value will set it to true.
      Returns:
      SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
      • INVALID_PROGRAM if program is not a valid program object created from a SPIR-V module.
      • INVALID_SPEC_ID if spec_id is not a valid specialization constant ID
      • INVALID_VALUE if spec_size does not match the size of the specialization constant in the SPIR-V module, or if spec_value is NULL.
      • OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.
      • OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.
      See Also:
    • clSetProgramSpecializationConstant

      public static int clSetProgramSpecializationConstant(long program, int spec_id, IntBuffer spec_value)
      Sets the values of a SPIR-V specialization constants.

      Calling this function multiple times for the same specialization constant shall cause the last provided value to override any previously specified value. The values are used by a subsequent BuildProgram call for the program.

      Application is not required to provide values for every specialization constant contained in SPIR-V module. SPIR-V provides default values for all specialization constants.

      Parameters:
      program - must be a valid OpenCL program created from a SPIR-V module
      spec_id - identifies the SPIR-V specialization constant whose value will be set
      spec_value - a pointer to the memory location that contains the value of the specialization constant. The data pointed to by spec_value are copied and can be safely reused by the application after clSetProgramSpecializationConstant returns. This specialization value will be used by subsequent calls to BuildProgram until another call to clSetProgramSpecializationConstant changes it. If a specialization constant is a boolean constant, spec_value should be a pointer to a cl_uchar value. A value of zero will set the specialization constant to false; any other value will set it to true.
      Returns:
      SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
      • INVALID_PROGRAM if program is not a valid program object created from a SPIR-V module.
      • INVALID_SPEC_ID if spec_id is not a valid specialization constant ID
      • INVALID_VALUE if spec_size does not match the size of the specialization constant in the SPIR-V module, or if spec_value is NULL.
      • OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.
      • OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.
      See Also:
    • clSetProgramSpecializationConstant

      public static int clSetProgramSpecializationConstant(long program, int spec_id, LongBuffer spec_value)
      Sets the values of a SPIR-V specialization constants.

      Calling this function multiple times for the same specialization constant shall cause the last provided value to override any previously specified value. The values are used by a subsequent BuildProgram call for the program.

      Application is not required to provide values for every specialization constant contained in SPIR-V module. SPIR-V provides default values for all specialization constants.

      Parameters:
      program - must be a valid OpenCL program created from a SPIR-V module
      spec_id - identifies the SPIR-V specialization constant whose value will be set
      spec_value - a pointer to the memory location that contains the value of the specialization constant. The data pointed to by spec_value are copied and can be safely reused by the application after clSetProgramSpecializationConstant returns. This specialization value will be used by subsequent calls to BuildProgram until another call to clSetProgramSpecializationConstant changes it. If a specialization constant is a boolean constant, spec_value should be a pointer to a cl_uchar value. A value of zero will set the specialization constant to false; any other value will set it to true.
      Returns:
      SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
      • INVALID_PROGRAM if program is not a valid program object created from a SPIR-V module.
      • INVALID_SPEC_ID if spec_id is not a valid specialization constant ID
      • INVALID_VALUE if spec_size does not match the size of the specialization constant in the SPIR-V module, or if spec_value is NULL.
      • OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.
      • OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.
      See Also:
    • clSetProgramSpecializationConstant

      public static int clSetProgramSpecializationConstant(long program, int spec_id, FloatBuffer spec_value)
      Sets the values of a SPIR-V specialization constants.

      Calling this function multiple times for the same specialization constant shall cause the last provided value to override any previously specified value. The values are used by a subsequent BuildProgram call for the program.

      Application is not required to provide values for every specialization constant contained in SPIR-V module. SPIR-V provides default values for all specialization constants.

      Parameters:
      program - must be a valid OpenCL program created from a SPIR-V module
      spec_id - identifies the SPIR-V specialization constant whose value will be set
      spec_value - a pointer to the memory location that contains the value of the specialization constant. The data pointed to by spec_value are copied and can be safely reused by the application after clSetProgramSpecializationConstant returns. This specialization value will be used by subsequent calls to BuildProgram until another call to clSetProgramSpecializationConstant changes it. If a specialization constant is a boolean constant, spec_value should be a pointer to a cl_uchar value. A value of zero will set the specialization constant to false; any other value will set it to true.
      Returns:
      SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
      • INVALID_PROGRAM if program is not a valid program object created from a SPIR-V module.
      • INVALID_SPEC_ID if spec_id is not a valid specialization constant ID
      • INVALID_VALUE if spec_size does not match the size of the specialization constant in the SPIR-V module, or if spec_value is NULL.
      • OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.
      • OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.
      See Also:
    • clSetProgramSpecializationConstant

      public static int clSetProgramSpecializationConstant(long program, int spec_id, DoubleBuffer spec_value)
      Sets the values of a SPIR-V specialization constants.

      Calling this function multiple times for the same specialization constant shall cause the last provided value to override any previously specified value. The values are used by a subsequent BuildProgram call for the program.

      Application is not required to provide values for every specialization constant contained in SPIR-V module. SPIR-V provides default values for all specialization constants.

      Parameters:
      program - must be a valid OpenCL program created from a SPIR-V module
      spec_id - identifies the SPIR-V specialization constant whose value will be set
      spec_value - a pointer to the memory location that contains the value of the specialization constant. The data pointed to by spec_value are copied and can be safely reused by the application after clSetProgramSpecializationConstant returns. This specialization value will be used by subsequent calls to BuildProgram until another call to clSetProgramSpecializationConstant changes it. If a specialization constant is a boolean constant, spec_value should be a pointer to a cl_uchar value. A value of zero will set the specialization constant to false; any other value will set it to true.
      Returns:
      SUCCESS if the function is executed successfully. Otherwise, it returns one of the following errors:
      • INVALID_PROGRAM if program is not a valid program object created from a SPIR-V module.
      • INVALID_SPEC_ID if spec_id is not a valid specialization constant ID
      • INVALID_VALUE if spec_size does not match the size of the specialization constant in the SPIR-V module, or if spec_value is NULL.
      • OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device.
      • OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host.
      See Also:
    • clSetProgramSpecializationConstant

      public static int clSetProgramSpecializationConstant(long program, int spec_id, short[] spec_value)
      See Also:
    • clSetProgramSpecializationConstant

      public static int clSetProgramSpecializationConstant(long program, int spec_id, int[] spec_value)
      See Also:
    • clSetProgramSpecializationConstant

      public static int clSetProgramSpecializationConstant(long program, int spec_id, long[] spec_value)
      See Also:
    • clSetProgramSpecializationConstant

      public static int clSetProgramSpecializationConstant(long program, int spec_id, float[] spec_value)
      See Also:
    • clSetProgramSpecializationConstant

      public static int clSetProgramSpecializationConstant(long program, int spec_id, double[] spec_value)
      See Also: