Class CL
- java.lang.Object
-
- org.lwjgl.opencl.CL
-
public final class CL extends java.lang.Object
This class loads the OpenCL library (usually via the ICD loader) into the JVM process.The
CLCapabilities
instance returned bygetICD()
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, soCLCapabilities
instances should be cached in user code.Device capabilities can be created with
createDeviceCapabilities(long, org.lwjgl.opencl.CLCapabilities)
. Calling this method is expensive, soCLCapabilities
instances should be cached in user code.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
create()
Loads the OpenCL native library, using the default library name.static void
create(java.lang.String libName)
Loads the OpenCL native library, using the specified library name.static void
create(org.lwjgl.system.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 org.lwjgl.system.FunctionProviderLocal
getFunctionProvider()
Returns theFunctionProviderLocal
for the OpenCL native library.static CLCapabilities
getICD()
Returns theCLCapabilities
of 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 theFunctionProviderLocal
for the OpenCL native library.
-
getICD
@Nullable public static CLCapabilities getICD()
Returns theCLCapabilities
of the ICD.
-
createPlatformCapabilities
public static CLCapabilities createPlatformCapabilities(long cl_platform_id)
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
-
-