|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jogamp.opencl.CLPlatform
public class CLPlatform
CLPlatfrorm representing a OpenCL implementation (e.g. graphics driver). optional eager initialization:
try{ CLPlatform.initialize(); }catch(JogampRuntimeException ex) { throw new RuntimeException("could not load Java OpenCL Binding"); }Example initialization:
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:
initialize()
,
getDefault()
,
listCLPlatforms()
Field Summary | |
---|---|
protected static CL |
cl
|
long |
ID
OpenCL platform id for this platform. |
protected CLPlatformInfoAccessor |
info
|
CLVersion |
version
Version of this OpenCL platform. |
Constructor Summary | |
---|---|
protected |
CLPlatform(long id,
CLAccessorFactory factory)
|
Method Summary | |
---|---|
protected CLDevice |
createDevice(long id)
|
boolean |
equals(Object obj)
|
protected CLBufferBinding |
getBufferBinding()
|
CLPlatformInfoAccessor |
getCLAccessor()
|
protected CL |
getCLBinding()
|
protected CLCommandQueueBinding |
getCommandQueueBinding()
|
protected CLContextBinding |
getContextBinding()
|
static CLPlatform |
getDefault()
Returns the default OpenCL platform or null when no platform found. |
static CLPlatform |
getDefault(Filter<CLPlatform>... filter)
Returns the default OpenCL platform or null when no platform found. |
protected CLDeviceBinding |
getDeviceBinding()
|
protected CLEventBinding |
getEventBinding()
|
Set<String> |
getExtensions()
Returns all platform extension names as unmodifiable Set. |
String |
getICDSuffix()
Returns the ICD suffix. |
protected CLImageBinding |
getImageBinding()
|
String |
getInfoString(int key)
Returns a info string in exchange for a key (CL_PLATFORM_*). |
protected CLKernelBinding |
getKernelBinding()
|
static CL |
getLowLevelCLInterface()
Returns the low level binding interface to the OpenCL APIs. |
CLDevice |
getMaxFlopsDevice()
Returns the device with maximal FLOPS from this platform. |
CLDevice |
getMaxFlopsDevice(CLDevice.Type... types)
Returns the device with maximal FLOPS and the specified type from this platform. |
CLDevice |
getMaxFlopsDevice(Filter<CLDevice>... filter)
Returns the device with maximal FLOPS and the specified type from this platform. |
protected CLMemObjBinding |
getMemObjectBinding()
|
String |
getName()
Returns the platform name. |
protected CLPlatformBinding |
getPlatformBinding()
|
String |
getProfile()
Returns the platform profile. |
protected CLProgramBinding |
getProgramBinding()
|
Map<String,String> |
getProperties()
Returns a Map of platform properties with the enum names as keys. |
protected CLSamplerBinding |
getSamplerBinding()
|
String |
getSpecVersion()
Returns the OpenCL Specification version supported by this platform. |
String |
getVendor()
Returns the platform vendor. |
CLVersion |
getVersion()
Returns the OpenCL version supported by this platform. |
int |
hashCode()
|
static void |
initialize()
Eagerly initializes JOCL. |
boolean |
isAtLeast(CLVersion other)
|
boolean |
isAtLeast(int major,
int minor)
|
boolean |
isExtensionAvailable(String extension)
Returns true if the extension is supported on this platform. |
CLDevice[] |
listCLDevices()
Lists all physical devices available on this platform. |
CLDevice[] |
listCLDevices(CLDevice.Type... types)
Lists all physical devices available on this platform matching the given CLDevice.Type . |
CLDevice[] |
listCLDevices(Filter<CLDevice>... filters)
Lists all physical devices available on this platform matching the given Filter . |
static CLPlatform[] |
listCLPlatforms()
Lists all available OpenCL implementations. |
static CLPlatform[] |
listCLPlatforms(Filter<CLPlatform>... filter)
Lists all available OpenCL implementations. |
String |
toString()
|
static void |
unloadCompiler()
Hint to allow the implementation to release the resources allocated by the OpenCL compiler. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final long ID
public final CLVersion version
protected static CL cl
protected final CLPlatformInfoAccessor info
Constructor Detail |
---|
protected CLPlatform(long id, CLAccessorFactory factory)
Method Detail |
---|
public static void initialize() throws JogampRuntimeException
JogampRuntimeException
- if something went wrong in the initialization (e.g. OpenCL lib not found).public static CLPlatform getDefault()
public static CLPlatform getDefault(Filter<CLPlatform>... filter)
public static CLPlatform[] listCLPlatforms()
CLException
- if something went wrong initializing OpenCLpublic static CLPlatform[] listCLPlatforms(Filter<CLPlatform>... filter)
filter
- Acceptance filter for the returned platforms.
CLException
- if something went wrong initializing OpenCLpublic static CL getLowLevelCLInterface()
public static void unloadCompiler()
CLProgram.build()
after unloadCompiler will reload the compiler if necessary.
public CLDevice[] listCLDevices()
listCLDevices(com.jogamp.opencl.CLDevice.Type...)
public CLDevice[] listCLDevices(CLDevice.Type... types)
CLDevice.Type
.
public CLDevice[] listCLDevices(Filter<CLDevice>... filters)
Filter
.
protected CLDevice createDevice(long id)
public CLDevice getMaxFlopsDevice()
getMaxFlopsDevice(com.jogamp.opencl.CLDevice.Type...)
public CLDevice getMaxFlopsDevice(CLDevice.Type... types)
public CLDevice getMaxFlopsDevice(Filter<CLDevice>... filter)
public String getName()
public CLVersion getVersion()
public String getSpecVersion()
public boolean isAtLeast(CLVersion other)
CLVersion.isAtLeast(com.jogamp.opencl.CLVersion)
public boolean isAtLeast(int major, int minor)
CLVersion.isAtLeast(int, int)
public String getProfile()
public String getVendor()
public String getICDSuffix()
public boolean isExtensionAvailable(String extension)
public Set<String> getExtensions()
public Map<String,String> getProperties()
CLUtil.obtainPlatformProperties(com.jogamp.opencl.CLPlatform)
public final String getInfoString(int key)
public final CLPlatformInfoAccessor getCLAccessor()
protected CLBufferBinding getBufferBinding()
protected CLCommandQueueBinding getCommandQueueBinding()
protected CLContextBinding getContextBinding()
protected CLDeviceBinding getDeviceBinding()
protected CLEventBinding getEventBinding()
protected CLImageBinding getImageBinding()
protected CLKernelBinding getKernelBinding()
protected CLMemObjBinding getMemObjectBinding()
protected CLPlatformBinding getPlatformBinding()
protected CLProgramBinding getProgramBinding()
protected CLSamplerBinding getSamplerBinding()
protected CL getCLBinding()
public String toString()
toString
in class Object
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |