Package com.jme3.opencl.lwjgl
Class LwjglDevice
java.lang.Object
com.jme3.opencl.lwjgl.LwjglDevice
- All Implemented Interfaces:
Device
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.jme3.opencl.Device
Device.DeviceType
-
Constructor 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.org.lwjgl.opencl.CLDevice
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
toString()
-
Constructor Details
-
LwjglDevice
-
-
Method Details
-
getDevice
public org.lwjgl.opencl.CLDevice getDevice() -
getPlatform
- Specified by:
getPlatform
in interfaceDevice
- Returns:
- the platform associated with this device
-
getDeviceType
- Specified by:
getDeviceType
in interfaceDevice
- Returns:
- queries the device type
-
getVendorId
public int getVendorId()- Specified by:
getVendorId
in interfaceDevice
- Returns:
- the vendor id
-
isAvailable
public boolean isAvailable()Description copied from interface:Device
checks if this device is available at all, must always be tested- Specified by:
isAvailable
in interfaceDevice
- Returns:
- checks if this device is available at all, must always be tested
-
hasCompiler
public boolean hasCompiler()- Specified by:
hasCompiler
in interfaceDevice
- Returns:
- if this device has a compiler for kernel code
-
hasDouble
public boolean hasDouble() -
hasHalfFloat
public boolean hasHalfFloat()- Specified by:
hasHalfFloat
in interfaceDevice
- Returns:
- supports half precision floats (16 bit)
-
hasErrorCorrectingMemory
public boolean hasErrorCorrectingMemory()- Specified by:
hasErrorCorrectingMemory
in interfaceDevice
- Returns:
- supports error correction for every access to global or constant memory
-
hasUnifiedMemory
public boolean hasUnifiedMemory()- Specified by:
hasUnifiedMemory
in interfaceDevice
- Returns:
- supports unified virtual memory (OpenCL 2.0)
-
hasImageSupport
public boolean hasImageSupport()- Specified by:
hasImageSupport
in interfaceDevice
- Returns:
- supports images
-
hasWritableImage3D
public boolean hasWritableImage3D()- Specified by:
hasWritableImage3D
in interfaceDevice
- Returns:
- supports writes to 3d images (this is an extension)
-
hasOpenGLInterop
public boolean hasOpenGLInterop()- Specified by:
hasOpenGLInterop
in interfaceDevice
- Returns:
- supports sharing with OpenGL
-
hasExtension
Description copied from interface:Device
Explicitly tests for the availability of the specified extension- Specified by:
hasExtension
in interfaceDevice
- Parameters:
extension
- the name of the extension- Returns:
true
iff this extension is supported
-
getExtensions
Description copied from interface:Device
Lists all available extensions- Specified by:
getExtensions
in interfaceDevice
- Returns:
- all available extensions
-
getComputeUnits
public int getComputeUnits()Description copied from interface:Device
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.- Specified by:
getComputeUnits
in interfaceDevice
- Returns:
- the number of parallel compute units
- See Also:
-
getClockFrequency
public int getClockFrequency()- Specified by:
getClockFrequency
in interfaceDevice
- Returns:
- maximum clock frequency of the device in MHz
-
getAddressBits
public int getAddressBits()Description copied from interface:Device
Returns the default compute device address space size specified as an unsigned integer value in bits. The values currently supported are 32 and 64.- Specified by:
getAddressBits
in interfaceDevice
- Returns:
- the size of an address
-
isLittleEndian
public boolean isLittleEndian()- Specified by:
isLittleEndian
in interfaceDevice
- Returns:
true
if this device is little endian
-
getMaximumWorkItemDimensions
public long getMaximumWorkItemDimensions()Description copied from interface:Device
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.- Specified by:
getMaximumWorkItemDimensions
in interfaceDevice
- Returns:
- the maximum dimension of work item ids
-
getMaximumWorkItemSizes
public long[] getMaximumWorkItemSizes()Description copied from interface:Device
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.- Specified by:
getMaximumWorkItemSizes
in interfaceDevice
- Returns:
- the maximum size of the work group in each dimension
-
getMaxiumWorkItemsPerGroup
public long getMaxiumWorkItemsPerGroup()Description copied from interface:Device
Maximum number of work-items in a work-group executing a kernel on a single compute unit, using the data parallel execution model.- Specified by:
getMaxiumWorkItemsPerGroup
in interfaceDevice
- Returns:
- maximum number of work-items in a work-group
-
getMaximumSamplers
public int getMaximumSamplers()- Specified by:
getMaximumSamplers
in interfaceDevice
- Returns:
- the maximum number of samples that can be used in a kernel
-
getMaximumReadImages
public int getMaximumReadImages()- Specified by:
getMaximumReadImages
in interfaceDevice
- Returns:
- the maximum number of images that can be used for reading in a kernel
-
getMaximumWriteImages
public int getMaximumWriteImages()- Specified by:
getMaximumWriteImages
in interfaceDevice
- Returns:
- the maximum number of images that can be used for writing in a kernel
-
getMaximumImage2DSize
public long[] getMaximumImage2DSize()Description copied from interface:Device
Queries the maximal size of a 2D image- Specified by:
getMaximumImage2DSize
in interfaceDevice
- Returns:
- an array of length 2 with the maximal size of a 2D image
-
getMaximumImage3DSize
public long[] getMaximumImage3DSize()Description copied from interface:Device
Queries the maximal size of a 3D image- Specified by:
getMaximumImage3DSize
in interfaceDevice
- Returns:
- an array of length 3 with the maximal size of a 3D image
-
getMaximumAllocationSize
public long getMaximumAllocationSize()- Specified by:
getMaximumAllocationSize
in interfaceDevice
- Returns:
- the maximal size of a memory object (buffer and image) in bytes
-
getGlobalMemorySize
public long getGlobalMemorySize()- Specified by:
getGlobalMemorySize
in interfaceDevice
- Returns:
- the total available global memory in bytes
-
getLocalMemorySize
public long getLocalMemorySize()- Specified by:
getLocalMemorySize
in interfaceDevice
- Returns:
- the total available local memory in bytes
-
getMaximumConstantBufferSize
public long getMaximumConstantBufferSize()Description copied from interface:Device
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.- Specified by:
getMaximumConstantBufferSize
in interfaceDevice
- Returns:
- the maximal size of a constant buffer
-
getMaximumConstantArguments
public int getMaximumConstantArguments()- Specified by:
getMaximumConstantArguments
in interfaceDevice
- Returns:
- the maximal number of constant buffer arguments in a kernel call
-
getProfile
Description copied from interface:Device
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.- Specified by:
getProfile
in interfaceDevice
- Returns:
- the profile string
-
getVersion
Description copied from interface:Device
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- Specified by:
getVersion
in interfaceDevice
- Returns:
- the version string
-
getVersionMajor
public int getVersionMajor()Description copied from interface:Device
Extracts the major version from the version string- Specified by:
getVersionMajor
in interfaceDevice
- Returns:
- the major version
- See Also:
-
getVersionMinor
public int getVersionMinor()Description copied from interface:Device
Extracts the minor version from the version string- Specified by:
getVersionMinor
in interfaceDevice
- Returns:
- the minor version
- See Also:
-
getCompilerVersion
Description copied from interface:Device
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.- Specified by:
getCompilerVersion
in interfaceDevice
- Returns:
- the compiler version
-
getCompilerVersionMajor
public int getCompilerVersionMajor()Description copied from interface:Device
Extracts the major version from the compiler version- Specified by:
getCompilerVersionMajor
in interfaceDevice
- Returns:
- the major compiler version
- See Also:
-
getCompilerVersionMinor
public int getCompilerVersionMinor()Description copied from interface:Device
Extracts the minor version from the compiler version- Specified by:
getCompilerVersionMinor
in interfaceDevice
- Returns:
- the minor compiler version
- See Also:
-
getDriverVersion
- Specified by:
getDriverVersion
in interfaceDevice
- Returns:
- the OpenCL software driver version string in the form major_number.minor_number
-
getDriverVersionMajor
public int getDriverVersionMajor()Description copied from interface:Device
Extracts the major version from the driver version- Specified by:
getDriverVersionMajor
in interfaceDevice
- Returns:
- the major driver version
- See Also:
-
getDriverVersionMinor
public int getDriverVersionMinor()Description copied from interface:Device
Extracts the minor version from the driver version- Specified by:
getDriverVersionMinor
in interfaceDevice
- Returns:
- the minor driver version
- See Also:
-
getName
-
getVendor
-
toString
-