java.lang.Object
api.Native
au.notzed.zcl.CLObject
au.notzed.zcl.CLPlatform
public class CLPlatform extends CLObject
Interface for cl_platform_id
-
Field Summary
Fields Modifier and Type Field Description static int
cl_khr_gl_event
GL event extension idstatic int
cl_khr_gl_sharing
GL sharing extension id.static int
VERSION_1_0
static int
VERSION_1_1
static int
VERSION_1_2
static int
VERSION_2_0
static int
VERSION_2_1
-
Constructor Summary
Constructors Constructor Description CLPlatform(jdk.incubator.foreign.MemoryAddress p)
-
Method Summary
Modifier and Type Method Description int
getAPIVersion()
Get the platform api versiom.static CLDevice
getBestDevice(long type)
Find the 'best' device based on number of compute units.static CLDevice
getBestDevice(long type, java.util.function.ToDoubleFunction<CLDevice> scoreFunc)
Find the 'best' device using supplied statistic.CLDevice[]
getDevices(long type)
Calls clGetDeviceIDs.java.lang.String
getExtensions()
get CL_PLATFORM_EXTENSIONSjava.lang.String
getName()
get CL_PLATFORM_NAME.static CLPlatform[]
getPlatforms()
Calls clGetPlatformIDs.java.lang.String
getProfile()
get CL_PLATFORM_PROFILE.java.lang.String
getVendor()
get CL_PLATFORM_VENDOR.java.lang.String
getVersion()
get CL_PLATFORM_VERSION.static void
requireAPIVersion(int apiVersion, int required)
java.lang.String
toString()
void
unloadPlatformCompiler()
Calls clUnloadPlatformCompiler.Methods inherited from class au.notzed.zcl.CLObject
getInfo, getInfo, getInfo, getInfoAny, getInfoAny, getInfoAny, getInfoAny, getInfoAnyV, getInfoByteV, getInfoByteV, getInfoInt, getInfoInt, getInfoInt, getInfoInt, getInfoJava, getInfoLong, getInfoLong, getInfoLong, getInfoLong, getInfoLongV, getInfoLongV, getInfoPropertyV, getInfoSizeT, getInfoSizeT, getInfoSizeT, getInfoSizeTA, getInfoString, getInfoString, getInfoString, getInfoString, release, release
Methods inherited from class api.Native
addr, addr, addr, debugDumpReachable, debugFlushAll, downcallHandle, downcallHandle, dumpSignature, freeUpcallStub, getAddr, getAddr, getByte, getByte, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getShort, loadLibraries, parseStruct, parseUnion, release, release, release, resolve, setAddr, setAddr, setByte, setByte, setDouble, setDouble, setFloat, setFloat, setInt, setInt, setLong, setLong, setShort, setShort, toAddrV, toAddrV, toAddrV, toByteV, toByteV, toLongV, toLongV, toObjectV, toObjectV, toString, upcallStub
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
VERSION_1_0
public static final int VERSION_1_0- See Also:
- Constant Field Values
-
VERSION_1_1
public static final int VERSION_1_1- See Also:
- Constant Field Values
-
VERSION_1_2
public static final int VERSION_1_2- See Also:
- Constant Field Values
-
VERSION_2_0
public static final int VERSION_2_0- See Also:
- Constant Field Values
-
VERSION_2_1
public static final int VERSION_2_1- See Also:
- Constant Field Values
-
cl_khr_gl_sharing
public static final int cl_khr_gl_sharingGL sharing extension id.- See Also:
- Constant Field Values
-
cl_khr_gl_event
public static final int cl_khr_gl_eventGL event extension id- See Also:
- Constant Field Values
-
-
Constructor Details
-
CLPlatform
public CLPlatform(jdk.incubator.foreign.MemoryAddress p)
-
-
Method Details
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
requireAPIVersion
public static void requireAPIVersion(int apiVersion, int required) throws java.lang.UnsupportedOperationException- Throws:
java.lang.UnsupportedOperationException
-
getPlatforms
Calls clGetPlatformIDs.- Returns:
- List of all available platforms.
- Throws:
CLRuntimeException
-
getDevices
Calls clGetDeviceIDs.All devices of the given type will be listed.
- Parameters:
type
- CL_DEVICE_TYPE_*.- Returns:
- List of matching devices in this platform.
- Throws:
CLRuntimeException
-
getBestDevice
public static CLDevice getBestDevice(long type, java.util.function.ToDoubleFunction<CLDevice> scoreFunc)Find the 'best' device using supplied statistic.- Parameters:
type
- CL_DEVICE_TYPE_*.scoreFunc
- return a higher value for a better score.- Returns:
- A device, if found.
-
getBestDevice
Find the 'best' device based on number of compute units. GPUs are assumed to have 64 FPUs per compute unit.- Parameters:
type
- CL_DEVICE_TYPE_*.- Returns:
- A device, if found.
-
unloadPlatformCompiler
Calls clUnloadPlatformCompiler.- Throws:
CLRuntimeException
-
getAPIVersion
public int getAPIVersion()Get the platform api versiom. This may be compared to the version constantsVERSION_1_0
,VERSION_1_1
, and so on.- Returns:
- platform api version.
-
getProfile
public java.lang.String getProfile()get CL_PLATFORM_PROFILE.- Returns:
- platform profile
-
getVersion
public java.lang.String getVersion()get CL_PLATFORM_VERSION.- Returns:
- platform version
-
getName
public java.lang.String getName()get CL_PLATFORM_NAME.- Returns:
- platform name
-
getVendor
public java.lang.String getVendor()get CL_PLATFORM_VENDOR.- Returns:
- platform vendor
-
getExtensions
public java.lang.String getExtensions()get CL_PLATFORM_EXTENSIONS- Returns:
- platform extensions
-