Package com.jme3.opencl
Interface Device
- All Known Implementing Classes:
LwjglDevice
public interface Device
Represents a hardware device actually running the OpenCL kernels.
A
Context
can be associated with multiple Devices
that all belong to the same Platform
.
For execution, a single device must be chosen and passed to a command
queue (Context.createQueue(com.jme3.opencl.Device)
).
This class is used to query the capabilities of the underlying device.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the default compute device address space size specified as an unsigned integer value in bits.int
OpenCL C version string.int
Extracts the major version from the compiler versionint
Extracts the minor version from the compiler versionint
Returns the number of parallel compute units on the OpenCL device.int
Extracts the major version from the driver versionint
Extracts the minor version from the driver versionCollection<? extends String>
Lists all available extensionslong
long
long
int
long
Returns the maximal size of a constant buffer.long[]
Queries the maximal size of a 2D imagelong[]
Queries the maximal size of a 3D imageint
int
long
The maximum dimension that specify the local and global work item ids.long[]
Maximum number of work-items that can be specified in each dimension of the work-group toKernel.Run2(com.jme3.opencl.CommandQueue, com.jme3.opencl.Kernel.WorkSize, com.jme3.opencl.Kernel.WorkSize, java.lang.Object...)
.int
long
Maximum number of work-items in a work-group executing a kernel on a single compute unit, using the data parallel execution model.getName()
OpenCL profile string.int
OpenCL version string.int
Extracts the major version from the version stringint
Extracts the minor version from the version stringboolean
boolean
boolean
boolean
hasExtension
(String extension) Explicitly tests for the availability of the specified extensionboolean
boolean
boolean
boolean
boolean
boolean
checks if this device is available at all, must always be testedboolean
-
Method Details
-
getPlatform
Platform getPlatform()- Returns:
- the platform associated with this device
-
getDeviceType
Device.DeviceType getDeviceType()- Returns:
- queries the device type
-
getVendorId
int getVendorId()- Returns:
- the vendor id
-
isAvailable
boolean isAvailable()checks if this device is available at all, must always be tested- Returns:
- checks if this device is available at all, must always be tested
-
hasCompiler
boolean hasCompiler()- Returns:
- if this device has a compiler for kernel code
-
hasDouble
boolean hasDouble()- Returns:
- supports double precision floats (64 bit)
-
hasHalfFloat
boolean hasHalfFloat()- Returns:
- supports half precision floats (16 bit)
-
hasErrorCorrectingMemory
boolean hasErrorCorrectingMemory()- Returns:
- supports error correction for every access to global or constant memory
-
hasUnifiedMemory
boolean hasUnifiedMemory()- Returns:
- supports unified virtual memory (OpenCL 2.0)
-
hasImageSupport
boolean hasImageSupport()- Returns:
- supports images
-
hasWritableImage3D
boolean hasWritableImage3D()- Returns:
- supports writes to 3d images (this is an extension)
-
hasOpenGLInterop
boolean hasOpenGLInterop()- Returns:
- supports sharing with OpenGL
-
hasExtension
Explicitly tests for the availability of the specified extension- Parameters:
extension
- the name of the extension- Returns:
true
iff this extension is supported
-
getExtensions
Collection<? extends String> getExtensions()Lists all available extensions- Returns:
- all available extensions
-
getComputeUnits
int getComputeUnits()Returns the number of parallel compute units on the OpenCL device. A work-group executes on a single compute unit. The minimum value is 1.- Returns:
- the number of parallel compute units
- See Also:
-
getClockFrequency
int getClockFrequency()- Returns:
- maximum clock frequency of the device in MHz
-
getAddressBits
int getAddressBits()Returns the default compute device address space size specified as an unsigned integer value in bits. The values currently supported are 32 and 64.- Returns:
- the size of an address
-
isLittleEndian
boolean isLittleEndian()- Returns:
true
if this device is little endian
-
getMaximumWorkItemDimensions
long getMaximumWorkItemDimensions()The maximum dimension that specify the local and global work item ids. You can always assume to be this at least 3. Therefore, the ids are always three integers x,y,z.- Returns:
- the maximum dimension of work item ids
-
getMaximumWorkItemSizes
long[] getMaximumWorkItemSizes()Maximum number of work-items that can be specified in each dimension of the work-group toKernel.Run2(com.jme3.opencl.CommandQueue, com.jme3.opencl.Kernel.WorkSize, com.jme3.opencl.Kernel.WorkSize, java.lang.Object...)
. The array has a length of at least 3.- Returns:
- the maximum size of the work group in each dimension
-
getMaxiumWorkItemsPerGroup
long getMaxiumWorkItemsPerGroup()Maximum number of work-items in a work-group executing a kernel on a single compute unit, using the data parallel execution model.- Returns:
- maximum number of work-items in a work-group
-
getMaximumSamplers
int getMaximumSamplers()- Returns:
- the maximum number of samples that can be used in a kernel
-
getMaximumReadImages
int getMaximumReadImages()- Returns:
- the maximum number of images that can be used for reading in a kernel
-
getMaximumWriteImages
int getMaximumWriteImages()- Returns:
- the maximum number of images that can be used for writing in a kernel
-
getMaximumImage2DSize
long[] getMaximumImage2DSize()Queries the maximal size of a 2D image- Returns:
- an array of length 2 with the maximal size of a 2D image
-
getMaximumImage3DSize
long[] getMaximumImage3DSize()Queries the maximal size of a 3D image- Returns:
- an array of length 3 with the maximal size of a 3D image
-
getMaximumAllocationSize
long getMaximumAllocationSize()- Returns:
- the maximal size of a memory object (buffer and image) in bytes
-
getGlobalMemorySize
long getGlobalMemorySize()- Returns:
- the total available global memory in bytes
-
getLocalMemorySize
long getLocalMemorySize()- Returns:
- the total available local memory in bytes
-
getMaximumConstantBufferSize
long getMaximumConstantBufferSize()Returns the maximal size of a constant buffer.
Constant buffers are normal buffer objects, but passed to the kernel with the special declaration__constant BUFFER_TYPE* BUFFER_NAME
. Because they have a special caching, their size is usually very limited.- Returns:
- the maximal size of a constant buffer
-
getMaximumConstantArguments
int getMaximumConstantArguments()- Returns:
- the maximal number of constant buffer arguments in a kernel call
-
getProfile
String getProfile()OpenCL profile string. Returns the profile name supported by the device. The profile name returned can be one of the following strings:
FULL_PROFILE – if the device supports the OpenCL specification (functionality defined as part of the core specification and does not require any extensions to be supported).
EMBEDDED_PROFILE - if the device supports the OpenCL embedded profile.- Returns:
- the profile string
-
getVersion
String getVersion()OpenCL version string. Returns the OpenCL version supported by the device. This version string has the following format: OpenCL space major_version.minor_version space vendor-specific information.
E.g. OpenCL 1.1, OpenCL 1.2, OpenCL 2.0- Returns:
- the version string
-
getVersionMajor
int getVersionMajor()Extracts the major version from the version string- Returns:
- the major version
- See Also:
-
getVersionMinor
int getVersionMinor()Extracts the minor version from the version string- Returns:
- the minor version
- See Also:
-
getCompilerVersion
String getCompilerVersion()OpenCL C version string. Returns the highest OpenCL C version supported by the compiler for this device that is not of type CL_DEVICE_TYPE_CUSTOM. This version string has the following format: OpenCL space C space major_version.minor_version space vendor-specific information.
The major_version.minor_version value returned must be 1.2 if CL_DEVICE_VERSION is OpenCL 1.2. The major_version.minor_version value returned must be 1.1 if CL_DEVICE_VERSION is OpenCL 1.1. The major_version.minor_version value returned can be 1.0 or 1.1 if CL_DEVICE_VERSION is OpenCL 1.0.- Returns:
- the compiler version
-
getCompilerVersionMajor
int getCompilerVersionMajor()Extracts the major version from the compiler version- Returns:
- the major compiler version
- See Also:
-
getCompilerVersionMinor
int getCompilerVersionMinor()Extracts the minor version from the compiler version- Returns:
- the minor compiler version
- See Also:
-
getDriverVersion
String getDriverVersion()- Returns:
- the OpenCL software driver version string in the form major_number.minor_number
-
getDriverVersionMajor
int getDriverVersionMajor()Extracts the major version from the driver version- Returns:
- the major driver version
- See Also:
-
getDriverVersionMinor
int getDriverVersionMinor()Extracts the minor version from the driver version- Returns:
- the minor driver version
- See Also:
-
getName
String getName()- Returns:
- the device name
-
getVendor
String getVendor()- Returns:
- the vendor
-