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 void
create()
Loads the OpenCL native library, using the default library name.static void
Loads the OpenCL native library, using the specified library name.static void
create
(FunctionProviderLocal functionProvider) Initializes OpenCL with the specifiedFunctionProviderLocal
.static CLCapabilities
createDeviceCapabilities
(long cl_device_id, CLCapabilities platformCapabilities) Creates aCLCapabilities
instance for the specified OpenCL device.static CLCapabilities
createPlatformCapabilities
(long cl_platform_id) Creates aCLCapabilities
instance for the specified OpenCL platform.static void
destroy()
Unloads the OpenCL native library.static FunctionProviderLocal
Returns theFunctionProviderLocal
for the OpenCL native library.static CLCapabilities
getICD()
Returns theCLCapabilities
of 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 theFunctionProviderLocal
for the OpenCL native library. -
getICD
Returns theCLCapabilities
of the ICD. -
createPlatformCapabilities
Creates aCLCapabilities
instance 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 aCLCapabilities
instance 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
-