|
JOCL v2.6.0-rc-20250722
JOCL, OpenCL® API Binding for Java (public API).
|
CLPlatfrorm representing a OpenCL implementation (e.g. More...
Public Member Functions | |
| CLDevice[] | listCLDevices () |
| Lists all physical devices available on this platform. More... | |
| CLDevice[] | listCLDevices (final CLDevice.Type... types) |
Lists all physical devices available on this platform matching the given CLDevice.Type. More... | |
| CLDevice[] | listCLDevices (final Filter< CLDevice >... filters) |
Lists all physical devices available on this platform matching the given Filter. More... | |
| CLDevice | getMaxFlopsDevice () |
| Returns the device with maximal FLOPS from this platform. More... | |
| CLDevice | getMaxFlopsDevice (final CLDevice.Type... types) |
| Returns the device with maximal FLOPS and the specified type from this platform. More... | |
| CLDevice | getMaxFlopsDevice (final Filter< CLDevice >... filter) |
| Returns the device with maximal FLOPS and the specified type from this platform. More... | |
| String | getName () |
| Returns the platform name. More... | |
| CLVersion | getVersion () |
| Returns the OpenCL version supported by this platform. More... | |
| String | getSpecVersion () |
| Returns the OpenCL Specification version supported by this platform. More... | |
| boolean | isAtLeast (final CLVersion other) |
| boolean | isAtLeast (final int major, final int minor) |
| String | getProfile () |
| Returns the platform profile. More... | |
| String | getVendor () |
| Returns the platform vendor. More... | |
| boolean | isVendorAMD () |
| boolean | isVendorIntel () |
| String | getICDSuffix () |
| Returns the ICD suffix. More... | |
| boolean | isExtensionAvailable (final String extension) |
| Returns true if the extension is supported on this platform. More... | |
| synchronized Set< String > | getExtensions () |
| Returns all platform extension names as unmodifiable Set. More... | |
| Map< String, String > | getProperties () |
| Returns a Map of platform properties with the enum names as keys. More... | |
| final String | getInfoString (final int key) |
| Returns a info string in exchange for a key (CL_PLATFORM_*). More... | |
| final CLPlatformInfoAccessor | getCLAccessor () |
| String | toString () |
| boolean | equals (final Object obj) |
| int | hashCode () |
Static Public Member Functions | |
| static boolean | isAvailable () |
| static void | initialize () throws JogampRuntimeException |
| Eagerly initializes JOCL. More... | |
| static CLPlatform | getDefault () |
| Returns the default OpenCL platform or null when no platform found. More... | |
| static CLPlatform | getDefault (final Filter< CLPlatform >... filter) |
| Returns the default OpenCL platform or null when no platform found. More... | |
| static CLPlatform[] | listCLPlatforms () |
| Lists all available OpenCL implementations. More... | |
| static CLPlatform[] | listCLPlatforms (final Filter< CLPlatform >... filter) |
| Lists all available OpenCL implementations. More... | |
| static CL | getLowLevelCLInterface () |
| Returns the low level binding interface to the OpenCL APIs. More... | |
| static CL | getLowLevelCLInterfaceForDevice (final long device) |
| Returns the low level binding interface to the OpenCL APIs for the specified device. More... | |
| static void | unloadCompiler () |
| Hint to allow the implementation to release the resources allocated by the OpenCL compiler. More... | |
Public Attributes | |
| final long | ID |
| OpenCL platform id for this platform. More... | |
| final CLVersion | version |
| Version of this OpenCL platform. More... | |
Protected Member Functions | |
| CLPlatform (final long id, final CLAccessorFactory factory) | |
| CLDevice | createDevice (final long id) |
| CL | getCLBinding () |
Protected Attributes | |
| final CLPlatformInfoAccessor | info |
Static Protected Attributes | |
| static CL | cl |
CLPlatfrorm representing a OpenCL implementation (e.g.
graphics driver).
optional eager initialization:
if( !CLPlatform.isAvailable() ) {
return; // abort
}
try{
CLPlatform.initialize();
}catch(JogampRuntimeException ex) {
throw new RuntimeException("could not load Java OpenCL Binding");
}
</p
Example initialization:
if( !CLPlatform.isAvailable() ) {
return; // abort
}
CLPlatform platform = CLPlatform.getDefault(type(GPU));
if(platform == null) {
throw new RuntimeException("please update your graphics drivers");
}
CLContext context = CLContext.create(platform.getMaxFlopsDevice());
try {
// use it
}finally{
context.release();
}
</p
concurrency:
CLPlatform is threadsafe.
Definition at line 99 of file CLPlatform.java.
|
protected |
|
protected |
| boolean com.jogamp.opencl.CLPlatform.equals | ( | final Object | obj | ) |
Definition at line 556 of file CLPlatform.java.
| final CLPlatformInfoAccessor com.jogamp.opencl.CLPlatform.getCLAccessor | ( | ) |
Definition at line 539 of file CLPlatform.java.
|
protected |
|
static |
Returns the default OpenCL platform or null when no platform found.
Definition at line 179 of file CLPlatform.java.
|
static |
Returns the default OpenCL platform or null when no platform found.
Definition at line 187 of file CLPlatform.java.
| synchronized Set< String > com.jogamp.opencl.CLPlatform.getExtensions | ( | ) |
Returns all platform extension names as unmodifiable Set.
Definition at line 503 of file CLPlatform.java.
| String com.jogamp.opencl.CLPlatform.getICDSuffix | ( | ) |
Returns the ICD suffix.
Definition at line 488 of file CLPlatform.java.
| final String com.jogamp.opencl.CLPlatform.getInfoString | ( | final int | key | ) |
Returns a info string in exchange for a key (CL_PLATFORM_*).
Definition at line 531 of file CLPlatform.java.
|
static |
Returns the low level binding interface to the OpenCL APIs.
This interface is always for OpenCL 1.1.
Definition at line 245 of file CLPlatform.java.
|
static |
Returns the low level binding interface to the OpenCL APIs for the specified device.
This interface is the newest one the device supports.
Definition at line 254 of file CLPlatform.java.
| CLDevice com.jogamp.opencl.CLPlatform.getMaxFlopsDevice | ( | ) |
Returns the device with maximal FLOPS from this platform.
The device speed is estimated by calculating the product of MAX_COMPUTE_UNITS and MAX_CLOCK_FREQUENCY.
Definition at line 395 of file CLPlatform.java.
| CLDevice com.jogamp.opencl.CLPlatform.getMaxFlopsDevice | ( | final CLDevice.Type... | types | ) |
Returns the device with maximal FLOPS and the specified type from this platform.
The device speed is estimated by calculating the product of MAX_COMPUTE_UNITS and MAX_CLOCK_FREQUENCY.
Definition at line 404 of file CLPlatform.java.
Returns the device with maximal FLOPS and the specified type from this platform.
The device speed is estimated by calculating the product of MAX_COMPUTE_UNITS and MAX_CLOCK_FREQUENCY.
Definition at line 413 of file CLPlatform.java.
| String com.jogamp.opencl.CLPlatform.getName | ( | ) |
Returns the platform name.
Definition at line 421 of file CLPlatform.java.
| String com.jogamp.opencl.CLPlatform.getProfile | ( | ) |
Returns the platform profile.
Definition at line 458 of file CLPlatform.java.
| Map< String, String > com.jogamp.opencl.CLPlatform.getProperties | ( | ) |
Returns a Map of platform properties with the enum names as keys.
Definition at line 524 of file CLPlatform.java.
| String com.jogamp.opencl.CLPlatform.getSpecVersion | ( | ) |
Returns the OpenCL Specification version supported by this platform.
Definition at line 436 of file CLPlatform.java.
| String com.jogamp.opencl.CLPlatform.getVendor | ( | ) |
Returns the platform vendor.
Definition at line 466 of file CLPlatform.java.
| CLVersion com.jogamp.opencl.CLPlatform.getVersion | ( | ) |
Returns the OpenCL version supported by this platform.
Definition at line 429 of file CLPlatform.java.
| int com.jogamp.opencl.CLPlatform.hashCode | ( | ) |
Definition at line 571 of file CLPlatform.java.
|
static |
Eagerly initializes JOCL.
Subsequent calls do nothing.
| JogampRuntimeException | if something went wrong in the initialization (e.g. OpenCL lib not found). |
Definition at line 146 of file CLPlatform.java.
| boolean com.jogamp.opencl.CLPlatform.isAtLeast | ( | final CLVersion | other | ) |
Definition at line 443 of file CLPlatform.java.
| boolean com.jogamp.opencl.CLPlatform.isAtLeast | ( | final int | major, |
| final int | minor | ||
| ) |
Definition at line 450 of file CLPlatform.java.
|
static |
Definition at line 139 of file CLPlatform.java.
| boolean com.jogamp.opencl.CLPlatform.isExtensionAvailable | ( | final String | extension | ) |
Returns true if the extension is supported on this platform.
Definition at line 495 of file CLPlatform.java.
| boolean com.jogamp.opencl.CLPlatform.isVendorAMD | ( | ) |
Definition at line 473 of file CLPlatform.java.
| boolean com.jogamp.opencl.CLPlatform.isVendorIntel | ( | ) |
Definition at line 480 of file CLPlatform.java.
| CLDevice[] com.jogamp.opencl.CLPlatform.listCLDevices | ( | ) |
Lists all physical devices available on this platform.
Definition at line 283 of file CLPlatform.java.
| CLDevice[] com.jogamp.opencl.CLPlatform.listCLDevices | ( | final CLDevice.Type... | types | ) |
Lists all physical devices available on this platform matching the given CLDevice.Type.
Definition at line 295 of file CLPlatform.java.
Lists all physical devices available on this platform matching the given Filter.
Definition at line 318 of file CLPlatform.java.
|
static |
Lists all available OpenCL implementations.
| CLException | if something went wrong initializing OpenCL |
Definition at line 210 of file CLPlatform.java.
|
static |
Lists all available OpenCL implementations.
The platforms returned must pass all filters.
| filter | Acceptance filter for the returned platforms. |
| CLException | if something went wrong initializing OpenCL |
Definition at line 219 of file CLPlatform.java.
| String com.jogamp.opencl.CLPlatform.toString | ( | ) |
|
static |
Hint to allow the implementation to release the resources allocated by the OpenCL compiler.
Calls to CLProgram#build() after unloadCompiler will reload the compiler if necessary.
Definition at line 273 of file CLPlatform.java.
|
staticprotected |
Definition at line 111 of file CLPlatform.java.
| final long com.jogamp.opencl.CLPlatform.ID |
OpenCL platform id for this platform.
Definition at line 104 of file CLPlatform.java.
|
protected |
Definition at line 117 of file CLPlatform.java.
| final CLVersion com.jogamp.opencl.CLPlatform.version |
Version of this OpenCL platform.
Definition at line 109 of file CLPlatform.java.