if( !CLPlatform.isAvailable() ) {
return; // abort
}
try{
CLPlatform.initialize();
}catch(JogampRuntimeException ex) {
throw new RuntimeException("could not load Java OpenCL Binding");
}
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();
}
concurrency:isAvailable(), initialize(), getDefault(), listCLPlatforms()
| Modifier and Type | Field and Description |
|---|---|
| protected static CL | |
| private static CLAccessorFactory | |
| private Set | |
| private final CLAccessorFactory | |
| public final long | ID
OpenCL platform id for this platform. |
| protected final CLPlatformInfoAccessor | |
| public final CLVersion | version
Version of this OpenCL platform. |
| Access | Constructor and Description |
|---|---|
| private | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| private static <I> void | |
| protected CLDevice | |
| public boolean | equals(final Object
the reference object with which to compare. obj)Overrides java. |
| pack-priv static CLDevice | |
| pack-priv static CLDevice | |
| pack-priv final CLAccessorFactory | |
| protected CLBufferBinding | |
| public final CLPlatformInfoAccessor | |
| protected CL | |
| protected CLCommandQueueBinding | |
| protected CLContextBinding | |
| public static CLPlatform | |
| public static CLPlatform | getDefault(final Filter<CLPlatform>... filter)
Returns the default OpenCL platform or null when no platform found. |
| protected CLDeviceBinding | |
| protected CLEventBinding | |
| public synchronized Set | |
| public String | |
| protected CLImageBinding | |
| public final String | |
| protected CLKernelBinding | |
| public static CL | |
| public CLDevice | |
| public CLDevice | getMaxFlopsDevice(final CLDevice.
Returns the device with maximal FLOPS and the specified type from this platform. |
| public CLDevice | getMaxFlopsDevice(final Filter<CLDevice>... filter)
Returns the device with maximal FLOPS and the specified type from this platform. |
| protected CLMemObjBinding | |
| public String | |
| protected CLPlatformBinding | |
| public String | |
| protected CLProgramBinding | |
| public Map | |
| protected CLSamplerBinding | |
| public String | |
| public String | |
| public CLVersion | |
| public int | |
| public static void | |
| pack-priv static synchronized void | initialize(final CLAccessorFactory
CLAccessorFactory used for creating the bindings. factory)Eagerly initializes JOCL. |
| public boolean | |
| public boolean | |
| public static boolean | Returns: true if OpenCL is available on this machine, i.e. all native libraries could be loaded (CL and CL/JNI).
|
| public boolean | isExtensionAvailable(final String extension)
Returns true if the extension is supported on this platform. |
| public boolean | |
| private static CLPlatform | |
| public CLDevice[] | |
| public CLDevice[] | listCLDevices(final CLDevice.
Lists all physical devices available on this platform matching the given |
| public CLDevice[] | listCLDevices(final Filter<CLDevice>... filters)
Lists all physical devices available on this platform matching the given |
| public static CLPlatform[] | |
| public static CLPlatform[] | listCLPlatforms(final Filter<CLPlatform>...
Acceptance filter for the returned platforms. filter)Lists all available OpenCL implementations. |
| public String | |
| public static void | unloadCompiler()
Hint to allow the implementation to release the resources allocated by the OpenCL compiler. |
| cl | back to summary |
|---|---|
| protected static CL cl | |
| defaultFactory | back to summary |
|---|---|
| private static CLAccessorFactory defaultFactory | |
| extensions | back to summary |
|---|---|
| private Set<String> extensions | |
| factory | back to summary |
|---|---|
| private final CLAccessorFactory factory | |
| ID | back to summary |
|---|---|
| public final long ID OpenCL platform id for this platform. | |
| info | back to summary |
|---|---|
| protected final CLPlatformInfoAccessor info | |
| version | back to summary |
|---|---|
| public final CLVersion version Version of this OpenCL platform. | |
| CLPlatform | back to summary |
|---|---|
| private CLPlatform(final long id) | |
| CLPlatform | back to summary |
|---|---|
| protected CLPlatform(final long id, final CLAccessorFactory factory) | |
| addIfAccepted | back to summary |
|---|---|
| private static <I> void addIfAccepted(final I item, final List<I> list, final Filter<I>[] filters) | |
| createDevice | back to summary |
|---|---|
| protected CLDevice createDevice(final long id) | |
| equals | back to summary |
|---|---|
| public boolean equals(final Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| findMaxFlopsDevice | back to summary |
|---|---|
| pack-priv static CLDevice findMaxFlopsDevice(final CLDevice[] devices) | |
| findMaxFlopsDevice | back to summary |
|---|---|
| pack-priv static CLDevice findMaxFlopsDevice(final CLDevice[] devices, final CLDevice. | |
| getAccessorFactory | back to summary |
|---|---|
| pack-priv final CLAccessorFactory getAccessorFactory() | |
| getBufferBinding | back to summary |
|---|---|
| protected CLBufferBinding getBufferBinding() | |
| getCLAccessor | back to summary |
|---|---|
| public final CLPlatformInfoAccessor getCLAccessor() | |
| getCLBinding | back to summary |
|---|---|
| protected CL getCLBinding() | |
| getCommandQueueBinding | back to summary |
|---|---|
| protected CLCommandQueueBinding getCommandQueueBinding() | |
| getContextBinding | back to summary |
|---|---|
| protected CLContextBinding getContextBinding() | |
| getDefault | back to summary |
|---|---|
| public static CLPlatform getDefault() Returns the default OpenCL platform or null when no platform found. | |
| getDefault | back to summary |
|---|---|
| public static CLPlatform getDefault(final Filter<CLPlatform>... filter) Returns the default OpenCL platform or null when no platform found. | |
| getDeviceBinding | back to summary |
|---|---|
| protected CLDeviceBinding getDeviceBinding() | |
| getEventBinding | back to summary |
|---|---|
| protected CLEventBinding getEventBinding() | |
| getExtensions | back to summary |
|---|---|
| public synchronized Set Returns all platform extension names as unmodifiable Set.
| |
| getICDSuffix | back to summary |
|---|---|
| public String getICDSuffix() Returns the ICD suffix.
| |
| getImageBinding | back to summary |
|---|---|
| protected CLImageBinding getImageBinding() | |
| getInfoString | back to summary |
|---|---|
| public final String getInfoString(final int key) Returns a info string in exchange for a key (CL_PLATFORM_*). | |
| getKernelBinding | back to summary |
|---|---|
| protected CLKernelBinding getKernelBinding() | |
| getLowLevelCLInterface | back to summary |
|---|---|
| public static CL getLowLevelCLInterface() Returns the low level binding interface to the OpenCL APIs. | |
| getMaxFlopsDevice | back to summary |
|---|---|
| public CLDevice 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. | |
| getMaxFlopsDevice | back to summary |
|---|---|
| public CLDevice getMaxFlopsDevice(final CLDevice. 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. | |
| getMaxFlopsDevice | back to summary |
|---|---|
| public CLDevice getMaxFlopsDevice(final Filter<CLDevice>... filter) 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. | |
| getMemObjectBinding | back to summary |
|---|---|
| protected CLMemObjBinding getMemObjectBinding() | |
| getName | back to summary |
|---|---|
| public String getName() Returns the platform name.
| |
| getPlatformBinding | back to summary |
|---|---|
| protected CLPlatformBinding getPlatformBinding() | |
| getProfile | back to summary |
|---|---|
| public String getProfile() Returns the platform profile.
| |
| getProgramBinding | back to summary |
|---|---|
| protected CLProgramBinding getProgramBinding() | |
| getProperties | back to summary |
|---|---|
| public Map Returns a Map of platform properties with the enum names as keys. | |
| getSamplerBinding | back to summary |
|---|---|
| protected CLSamplerBinding getSamplerBinding() | |
| getSpecVersion | back to summary |
|---|---|
| public String getSpecVersion() Returns the OpenCL Specification version supported by this platform. | |
| getVendor | back to summary |
|---|---|
| public String getVendor() Returns the platform vendor.
| |
| getVersion | back to summary |
|---|---|
| public CLVersion getVersion() Returns the OpenCL version supported by this platform.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| initialize | back to summary |
|---|---|
| public static void initialize() throws JogampRuntimeException Eagerly initializes JOCL. Subsequent calls do nothing.
| |
| initialize | back to summary |
|---|---|
| pack-priv static synchronized void initialize(final CLAccessorFactory factory) throws JogampRuntimeException Eagerly initializes JOCL. Subsequent calls do nothing.
| |
| isAtLeast | back to summary |
|---|---|
| public boolean isAtLeast(final CLVersion other) | |
| isAtLeast | back to summary |
|---|---|
public boolean isAtLeast(final int major, final int minor)
| |
| isAvailable | back to summary |
|---|---|
public static boolean isAvailable()
| |
| isExtensionAvailable | back to summary |
|---|---|
| public boolean isExtensionAvailable(final String extension) Returns true if the extension is supported on this platform. | |
| isVendorAMD | back to summary |
|---|---|
public boolean isVendorAMD()
| |
| latest | back to summary |
|---|---|
| private static CLPlatform latest(final CLPlatform[] platforms) | |
| listCLDevices | back to summary |
|---|---|
| public CLDevice[] listCLDevices() Lists all physical devices available on this platform. | |
| listCLDevices | back to summary |
|---|---|
| public CLDevice[] listCLDevices(final CLDevice. Lists all physical devices available on this platform matching the given | |
| listCLDevices | back to summary |
|---|---|
| public CLDevice[] listCLDevices(final Filter<CLDevice>... filters) Lists all physical devices available on this platform matching the given | |
| listCLPlatforms | back to summary |
|---|---|
| public static CLPlatform[] listCLPlatforms() Lists all available OpenCL implementations.
| |
| listCLPlatforms | back to summary |
|---|---|
| public static CLPlatform[] listCLPlatforms(final Filter<CLPlatform>... filter) Lists all available OpenCL implementations. The platforms returned must pass all filters.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| unloadCompiler | back to summary |
|---|---|
| public static void unloadCompiler() Hint to allow the implementation to release the resources allocated by the OpenCL compiler.
Calls to | |