Class CL22
- java.lang.Object
-
- org.lwjgl.opencl.CL22
-
public class CL22 extends java.lang.ObjectThe core OpenCL 2.2 functionality.
-
-
Field Summary
Fields Modifier and Type Field and Description static intCL_INVALID_SPEC_ID
CL_MAX_SIZE_RESTRICTION_EXCEEDEDError Codesstatic intCL_PROGRAM_SCOPE_GLOBAL_CTORS_PRESENT
CL_PROGRAM_SCOPE_GLOBAL_DTORS_PRESENTcl_program_infostatic intCL_VERSION_2_2OpenCL Version.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static intclSetProgramReleaseCallback(long program, CLProgramReleaseCallbackI pfn_notify, long user_data)static intclSetProgramSpecializationConstant(long program, int spec_id, java.nio.ByteBuffer spec_value)static intclSetProgramSpecializationConstant(long program, int spec_id, double[] spec_value)static intclSetProgramSpecializationConstant(long program, int spec_id, java.nio.DoubleBuffer spec_value)static intclSetProgramSpecializationConstant(long program, int spec_id, float[] spec_value)static intclSetProgramSpecializationConstant(long program, int spec_id, java.nio.FloatBuffer spec_value)static intclSetProgramSpecializationConstant(long program, int spec_id, int[] spec_value)static intclSetProgramSpecializationConstant(long program, int spec_id, java.nio.IntBuffer spec_value)static intclSetProgramSpecializationConstant(long program, int spec_id, long[] spec_value)static intclSetProgramSpecializationConstant(long program, int spec_id, java.nio.LongBuffer spec_value)static intclSetProgramSpecializationConstant(long program, int spec_id, short[] spec_value)static intclSetProgramSpecializationConstant(long program, int spec_id, java.nio.ShortBuffer spec_value)
-
-
-
Field Detail
-
CL_VERSION_2_2
OpenCL Version.
-
CL_INVALID_SPEC_ID, CL_MAX_SIZE_RESTRICTION_EXCEEDED
Error Codes
-
-
Method Detail
-
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
clSetProgramReleaseCallbackregisters 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 objectpfn_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_datawill be passed as theuser_dataargument whenpfn_notifyis called.user_datacan beNULL.
-
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
BuildProgramcall 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 modulespec_id- identifies the SPIR-V specialization constant whose value will be setspec_value- a pointer to the memory location that contains the value of the specialization constant. The data pointed to byspec_valueare copied and can be safely reused by the application afterclSetProgramSpecializationConstantreturns. This specialization value will be used by subsequent calls toBuildProgramuntil another call toclSetProgramSpecializationConstantchanges it. If a specialization constant is a boolean constant,spec_valueshould be a pointer to acl_ucharvalue. A value of zero will set the specialization constant to false; any other value will set it to true.- Returns:
SUCCESSif the function is executed successfully. Otherwise, it returns one of the following errors:INVALID_PROGRAMifprogramis not a valid program object created from a SPIR-V module.INVALID_SPEC_IDifspec_idis not a valid specialization constant IDINVALID_VALUEifspec_sizedoes not match the size of the specialization constant in the SPIR-V module, or ifspec_valueisNULL.OUT_OF_RESOURCESif there is a failure to allocate resources required by the OpenCL implementation on the device.OUT_OF_HOST_MEMORYif there is a failure to allocate resources required by the OpenCL implementation on the host.
-
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)Array version of:SetProgramSpecializationConstant
-
-