Class CL
The CLCapabilities instance returned by 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 createPlatformCapabilities(long). Calling this method is expensive, so CLCapabilities instances
should be cached in user code.
Device capabilities can be created with createDeviceCapabilities(long, org.lwjgl.opencl.CLCapabilities). Calling this method is expensive, so CLCapabilities instances should
be cached in user code.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcreate()Loads the OpenCL native library, using the default library name.static voidLoads the OpenCL native library, using the specified library name.static voidcreate(FunctionProviderLocal functionProvider) Initializes OpenCL with the specifiedFunctionProviderLocal.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 FunctionProviderLocalReturns theFunctionProviderLocalfor the OpenCL native library.static CLCapabilitiesgetICD()Returns theCLCapabilitiesof the ICD.
-
Method Details
-
create
public static void create()Loads the OpenCL native library, using the default library name. -
create
Loads the OpenCL native library, using the specified library name.- Parameters:
libName- the native library name
-
create
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
Returns theFunctionProviderLocalfor the OpenCL native library. -
getICD
Returns theCLCapabilitiesof the ICD. -
createPlatformCapabilities
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
-