clSetProgramReleaseCallback

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.

nclSetProgramSpecializationConstant

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.

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.