Class CL22


  • public class CL22
    extends CL21
    The core OpenCL 2.2 functionality.
    • Method Detail

      • 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:
        Reference Page
      • 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,
                                                             java.nio.ByteBuffer spec_value)
        
        public static int clSetProgramSpecializationConstant​(long program,
                                                             int spec_id,
                                                             java.nio.ShortBuffer spec_value)
        
        public static int clSetProgramSpecializationConstant​(long program,
                                                             int spec_id,
                                                             java.nio.IntBuffer spec_value)
        
        public static int clSetProgramSpecializationConstant​(long program,
                                                             int spec_id,
                                                             java.nio.LongBuffer spec_value)
        
        public static int clSetProgramSpecializationConstant​(long program,
                                                             int spec_id,
                                                             java.nio.FloatBuffer spec_value)
        
        public static int clSetProgramSpecializationConstant​(long program,
                                                             int spec_id,
                                                             java.nio.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:
        Reference Page
      • clSetProgramSpecializationConstant

        public static int clSetProgramSpecializationConstant​(long program,
                                                             int spec_id,
                                                             short[] spec_value)
        
        public static int clSetProgramSpecializationConstant​(long program,
                                                             int spec_id,
                                                             int[] spec_value)
        
        public static int clSetProgramSpecializationConstant​(long program,
                                                             int spec_id,
                                                             long[] spec_value)
        
        public static int clSetProgramSpecializationConstant​(long program,
                                                             int spec_id,
                                                             float[] spec_value)
        
        public static int clSetProgramSpecializationConstant​(long program,
                                                             int spec_id,
                                                             double[] spec_value)
        
        See Also:
        Reference Page