Class CL
- java.lang.Object
-
- org.lwjgl.opencl.CL
-
public final class CL extends java.lang.ObjectThis class loads the OpenCL library (usually via the ICD loader) into the JVM process.The
CLCapabilitiesinstance returned byCL.getICD()contains function pointers for all functionality present in the ICD. This may include multiple platforms with very different capabilities. It should only be used if direct access to the ICD function pointers is required, for customization purposes.Platform capabilities can be created with
CL.createPlatformCapabilities(long). Calling this method is expensive, soCLCapabilitiesinstances should be cached in user code.Device capabilities can be created with
CL.createDeviceCapabilities(long, org.lwjgl.opencl.CLCapabilities). Calling this method is expensive, soCLCapabilitiesinstances should be cached in user code.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voidcreate()Loads the OpenCL native library, using the default library name.static voidcreate(org.lwjgl.system.FunctionProviderLocal functionProvider)Initializes OpenCL with the specifiedFunctionProviderLocal.static voidcreate(java.lang.String libName)Loads the OpenCL native library, using the specified library name.static CLCapabilitiescreateDeviceCapabilities(long cl_device_id, CLCapabilities platformCapabilities)Creates aCLCapabilitiesinstance for the specified OpenCL device.static CLCapabilitiescreatePlatformCapabilities(long cl_platform_id)Creates aCLCapabilitiesinstance for the specified OpenCL platform.static voiddestroy()Unloads the OpenCL native library.static org.lwjgl.system.FunctionProviderLocalgetFunctionProvider()Returns theFunctionProviderLocalfor the OpenCL native library.static CLCapabilitiesgetICD()Returns theCLCapabilitiesof the ICD.
-
-
-
Method Detail
-
create
public static void create()
Loads the OpenCL native library, using the default library name.
-
create
public static void create(java.lang.String libName)
Loads the OpenCL native library, using the specified library name.- Parameters:
libName- the native library name
-
create
public static void create(org.lwjgl.system.FunctionProviderLocal functionProvider)
Initializes OpenCL with the specifiedFunctionProviderLocal. This method can be used to implement custom OpenCL library loading.- Parameters:
functionProvider- the provider of OpenCL function addresses
-
destroy
public static void destroy()
Unloads the OpenCL native library.
-
getFunctionProvider
@Nullable public static org.lwjgl.system.FunctionProviderLocal getFunctionProvider()
Returns theFunctionProviderLocalfor the OpenCL native library.
-
getICD
@Nullable public static CLCapabilities getICD()
Returns theCLCapabilitiesof the ICD.
-
createPlatformCapabilities
public static CLCapabilities createPlatformCapabilities(long cl_platform_id)
Creates aCLCapabilitiesinstance for the specified OpenCL platform.This method call is relatively expensive. The result should be cached and reused.
- Parameters:
cl_platform_id- the platform to query- Returns:
- the
instance
-
createDeviceCapabilities
public static CLCapabilities createDeviceCapabilities(long cl_device_id, CLCapabilities platformCapabilities)
Creates aCLCapabilitiesinstance for the specified OpenCL device.This method call is relatively expensive. The result should be cached and reused.
- Parameters:
cl_device_id- the device to query- Returns:
- the
instance
-
-