Package com.jogamp.opencl
Class CLDevice
- java.lang.Object
-
- com.jogamp.opencl.CLObject
-
- com.jogamp.opencl.CLDevice
-
public class CLDevice extends CLObject
This object represents an OpenCL device.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CLDevice.Capabilities
Enumeration for the execution capabilities of the device.static class
CLDevice.FPConfig
Describes floating-point capability of the device.static class
CLDevice.GlobalMemCacheType
Type of global memory cache supported.static class
CLDevice.LocalMemType
Type of local memory cache supported.static class
CLDevice.Type
Enumeration for the type of a device.
-
Constructor Summary
Constructors Modifier Constructor Description protected
CLDevice(CLContext context, long id)
protected
CLDevice(CLPlatform platform, long id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CLCommandQueue
createCommandQueue()
CLCommandQueue
createCommandQueue(long properties)
CLCommandQueue
createCommandQueue(CLCommandQueue.Mode property)
CLCommandQueue
createCommandQueue(CLCommandQueue.Mode... properties)
boolean
equals(Object obj)
int
getAddressBits()
The default compute device address space size specified in bits.ByteOrder
getByteOrder()
ReturnsByteOrder.LITTLE_ENDIAN
orByteOrder.BIG_ENDIAN
.CLInfoAccessor
getCLAccessor()
CLVersion
getCVersion()
Returns the OpenCL-C version supported by the device.EnumSet<CLDevice.FPConfig>
getDoubleFPConfig()
Returns the optional double precision floating-point capability of the device.String
getDriverVersion()
Returns OpenCL software driver version string in the form major_number.minor_number.EnumSet<CLDevice.Capabilities>
getExecutionCapabilities()
Returns the execution capabilities as EnumSet.Set<String>
getExtensions()
Returns all device extension names as unmodifiable Set.long
getGlobalMemCachelineSize()
Returns the size of global memory cache line in bytes.long
getGlobalMemCacheSize()
Returns the size of global memory cache in bytes.CLDevice.GlobalMemCacheType
getGlobalMemCacheType()
Returns the type of global memory cache supported.long
getGlobalMemSize()
Returns the global memory size in bytes.EnumSet<CLDevice.FPConfig>
getHalfFPConfig()
Returns the optional half precision floating-point capability of the device.long
getLocalMemSize()
Returns the local memory size in bytes.
The minimum OpenCL 1.0 value is 16 KB.
The minimum OpenCL 1.1 value is 32 KB.CLDevice.LocalMemType
getLocalMemType()
Returns the local memory type.int
getMaxClockFrequency()
Returns the maximum configured clock frequency of the device in MHz.int
getMaxComputeUnits()
Returns the number of parallel compute cores on the OpenCL device.long
getMaxConstantArgs()
Returns the max number of arguments declared with theconstant
qualifier in a kernel.long
getMaxConstantBufferSize()
Returns the max size in bytes of a constant buffer allocation.int
getMaxImage2dHeight()
Returns the max height of 2D image in pixels.int
getMaxImage2dWidth()
Returns the max width of 2D image in pixels.int
getMaxImage3dDepth()
Returns the max depth of 3D image in pixels.int
getMaxImage3dHeight()
Returns the max height of 3D image in pixels.int
getMaxImage3dWidth()
Returns the max width of 3D image in pixels.long
getMaxMemAllocSize()
Returns the largest allocatable size of aCLBuffer
on this device.long
getMaxParameterSize()
Returns the max size in bytes of the arguments that can be passed to a kernel.
The minimum OpenCL 1.0 value is 256.
The minimum OpenCL 1.1 value is 1024.int
getMaxReadImageArgs()
Returns the max number of simultaneous image objects that can be read by a kernel.int
getMaxSamplers()
Returns the maximum number of samplers that can be used in a kernel.int
getMaxWorkGroupSize()
Returns the maximum number of work-items in a work-group executing a kernel using the data parallel execution model.int
getMaxWorkItemDimensions()
Returns the maximum dimensions that specify the global and local work-item IDs used by the data parallel execution model.int[]
getMaxWorkItemSizes()
Returns the maximum number of work-items that can be specified in each dimension of the work-group.int
getMaxWriteImageArgs()
Returns the max number of simultaneous image objects that can be written by a kernel.long
getMemBaseAddrAlign()
Returns theuint32_t
memory base address alignment value reinterpreted as along
value.String
getName()
Returns the name of this device.int
getNativeCharVectorWidth()
Native vector width size for built-in char vectors.int
getNativeDoubleVectorWidth()
Native vector width size for built-in double vectors.int
getNativeFloatVectorWidth()
Native vector width size for built-in float vectors.int
getNativeHalfVectorWidth()
Native vector width size for built-in half vectors.int
getNativeIntVectorWidth()
Native vector width size for built-in int vectors.int
getNativeLongVectorWidth()
Native vector width size for built-in long vectors.int
getNativeShortVectorWidth()
Native vector width size for built-in short vectors.CLPlatform
getPlatform()
Returns the platform for this OpenCL object.int
getPreferredCharVectorWidth()
Preferred native vector width size for built-in char vectors.int
getPreferredDoubleVectorWidth()
Preferred native vector width size for built-in double vectors.int
getPreferredFloatVectorWidth()
Preferred native vector width size for built-in float vectors.int
getPreferredIntVectorWidth()
Preferred native vector width size for built-in int vectors.int
getPreferredLongVectorWidth()
Preferred native vector width size for built-in long vectors.int
getPreferredShortVectorWidth()
Preferred native vector width size for built-in short vectors.String
getProfile()
Returns the OpenCL profile of this device.long
getProfilingTimerResolution()
Returns the resolution of device timer.Map<String,String>
getProperties()
Returns a Map of device properties with the enum names as keys.EnumSet<CLCommandQueue.Mode>
getQueueProperties()
Returns the command-queue properties supported by the device.EnumSet<CLDevice.FPConfig>
getSingleFPConfig()
Returns the single precision floating-point capability of the device.CLDevice.Type
getType()
Returns the type of this device.String
getVendor()
Returns the vendor of this device.long
getVendorID()
Returns the vendor id of this device.CLVersion
getVersion()
Returns the OpenCL version supported by the device.int
hashCode()
boolean
isAvailable()
Returns true if this device is available.boolean
isCompilerAvailable()
Returns false if the implementation does not have a compiler available to compile the program source.boolean
isDoubleFPAvailable()
ReturnsisExtensionAvailable(java.lang.String)
("cl_khr_fp64").boolean
isErrorCorrectionSupported()
Returns true if the device implements error correction for the memories, caches, registers etc.boolean
isExtensionAvailable(String extension)
Returns true if the extension is supported on this device.boolean
isGLMemorySharingSupported()
ReturnsisExtensionAvailable(java.lang.String)
("cl_khr_gl_sharing") ||isExtensionAvailable(java.lang.String)
("cl_APPLE_gl_sharing").boolean
isHalfFPAvailable()
ReturnsisExtensionAvailable(java.lang.String)
("cl_khr_fp16").boolean
isICDAvailable()
ReturnsisExtensionAvailable(java.lang.String)
("cl_khr_icd").boolean
isImageSupportAvailable()
Returns true if images are supported by the OpenCL device and false otherwise.boolean
isLittleEndian()
Returns true if the OpenCL device is a little endian device and false otherwise.boolean
isMemoryUnified()
Returns true if the device and the host have a unified memory subsystem.String
toString()
-
Methods inherited from class com.jogamp.opencl.CLObject
getContext, getID
-
-
-
-
Constructor Detail
-
CLDevice
protected CLDevice(CLPlatform platform, long id)
-
CLDevice
protected CLDevice(CLContext context, long id)
-
-
Method Detail
-
createCommandQueue
public CLCommandQueue createCommandQueue()
-
createCommandQueue
public CLCommandQueue createCommandQueue(CLCommandQueue.Mode property)
-
createCommandQueue
public CLCommandQueue createCommandQueue(CLCommandQueue.Mode... properties)
-
createCommandQueue
public CLCommandQueue createCommandQueue(long properties)
-
getPlatform
public CLPlatform getPlatform()
Description copied from class:CLObject
Returns the platform for this OpenCL object.- Overrides:
getPlatform
in classCLObject
-
getName
public String getName()
Returns the name of this device.
-
getProfile
public String getProfile()
Returns the OpenCL profile of this device.
-
getVendor
public String getVendor()
Returns the vendor of this device.
-
getVendorID
public long getVendorID()
Returns the vendor id of this device.
-
getVersion
public CLVersion getVersion()
Returns the OpenCL version supported by the device.
-
getCVersion
public CLVersion getCVersion()
Returns the OpenCL-C version supported by the device.
-
getDriverVersion
public String getDriverVersion()
Returns OpenCL software driver version string in the form major_number.minor_number.
-
getType
public CLDevice.Type getType()
Returns the type of this device.
-
getAddressBits
public int getAddressBits()
The default compute device address space size specified in bits. Currently supported values are 32 or 64 bits.
-
getPreferredShortVectorWidth
public int getPreferredShortVectorWidth()
Preferred native vector width size for built-in short vectors. The vector width is defined as the number of scalar elements that can be stored in the vector.
-
getPreferredCharVectorWidth
public int getPreferredCharVectorWidth()
Preferred native vector width size for built-in char vectors. The vector width is defined as the number of scalar elements that can be stored in the vector.
-
getPreferredIntVectorWidth
public int getPreferredIntVectorWidth()
Preferred native vector width size for built-in int vectors. The vector width is defined as the number of scalar elements that can be stored in the vector.
-
getPreferredLongVectorWidth
public int getPreferredLongVectorWidth()
Preferred native vector width size for built-in long vectors. The vector width is defined as the number of scalar elements that can be stored in the vector.
-
getPreferredFloatVectorWidth
public int getPreferredFloatVectorWidth()
Preferred native vector width size for built-in float vectors. The vector width is defined as the number of scalar elements that can be stored in the vector.
-
getPreferredDoubleVectorWidth
public int getPreferredDoubleVectorWidth()
Preferred native vector width size for built-in double vectors. The vector width is defined as the number of scalar elements that can be stored in the vector.
-
getNativeCharVectorWidth
public int getNativeCharVectorWidth()
Native vector width size for built-in char vectors. The vector width is defined as the number of scalar elements that can be stored in the vector.
-
getNativeShortVectorWidth
public int getNativeShortVectorWidth()
Native vector width size for built-in short vectors. The vector width is defined as the number of scalar elements that can be stored in the vector.
-
getNativeIntVectorWidth
public int getNativeIntVectorWidth()
Native vector width size for built-in int vectors. The vector width is defined as the number of scalar elements that can be stored in the vector.
-
getNativeLongVectorWidth
public int getNativeLongVectorWidth()
Native vector width size for built-in long vectors. The vector width is defined as the number of scalar elements that can be stored in the vector.
-
getNativeHalfVectorWidth
public int getNativeHalfVectorWidth()
Native vector width size for built-in half vectors. The vector width is defined as the number of scalar elements that can be stored in the vector.
-
getNativeFloatVectorWidth
public int getNativeFloatVectorWidth()
Native vector width size for built-in float vectors. The vector width is defined as the number of scalar elements that can be stored in the vector.
-
getNativeDoubleVectorWidth
public int getNativeDoubleVectorWidth()
Native vector width size for built-in double vectors. The vector width is defined as the number of scalar elements that can be stored in the vector.
-
getMaxComputeUnits
public int getMaxComputeUnits()
Returns the number of parallel compute cores on the OpenCL device. The minimum value is 1.
-
getMaxWorkGroupSize
public int getMaxWorkGroupSize()
Returns the maximum number of work-items in a work-group executing a kernel using the data parallel execution model. The minimum value is 1.
-
getMaxClockFrequency
public int getMaxClockFrequency()
Returns the maximum configured clock frequency of the device in MHz.
-
getMaxWorkItemDimensions
public int getMaxWorkItemDimensions()
Returns the maximum dimensions that specify the global and local work-item IDs used by the data parallel execution model. The minimum value is 3.
-
getMaxWorkItemSizes
public int[] getMaxWorkItemSizes()
Returns the maximum number of work-items that can be specified in each dimension of the work-group. The minimum value is (1, 1, 1).
-
getMaxParameterSize
public long getMaxParameterSize()
Returns the max size in bytes of the arguments that can be passed to a kernel.
The minimum OpenCL 1.0 value is 256.
The minimum OpenCL 1.1 value is 1024.
-
getMaxMemAllocSize
public long getMaxMemAllocSize()
Returns the largest allocatable size of aCLBuffer
on this device.
-
getMemBaseAddrAlign
public long getMemBaseAddrAlign()
Returns theuint32_t
memory base address alignment value reinterpreted as along
value.
-
getGlobalMemSize
public long getGlobalMemSize()
Returns the global memory size in bytes.
-
getLocalMemSize
public long getLocalMemSize()
Returns the local memory size in bytes.
The minimum OpenCL 1.0 value is 16 KB.
The minimum OpenCL 1.1 value is 32 KB.
-
isMemoryUnified
public boolean isMemoryUnified()
Returns true if the device and the host have a unified memory subsystem.
-
getMaxConstantBufferSize
public long getMaxConstantBufferSize()
Returns the max size in bytes of a constant buffer allocation. The minimum value is 64 KB.
-
getGlobalMemCachelineSize
public long getGlobalMemCachelineSize()
Returns the size of global memory cache line in bytes.
-
getGlobalMemCacheSize
public long getGlobalMemCacheSize()
Returns the size of global memory cache in bytes.
-
getMaxConstantArgs
public long getMaxConstantArgs()
Returns the max number of arguments declared with theconstant
qualifier in a kernel. The minimum value is 8.
-
isImageSupportAvailable
public boolean isImageSupportAvailable()
Returns true if images are supported by the OpenCL device and false otherwise.
-
getMaxReadImageArgs
public int getMaxReadImageArgs()
Returns the max number of simultaneous image objects that can be read by a kernel. The minimum value is 128 if image support is available.
-
getMaxWriteImageArgs
public int getMaxWriteImageArgs()
Returns the max number of simultaneous image objects that can be written by a kernel. The minimum value is 8 if image support is available.
-
getMaxImage2dWidth
public int getMaxImage2dWidth()
Returns the max width of 2D image in pixels. The minimum value is 8192 if image support is available.
-
getMaxImage2dHeight
public int getMaxImage2dHeight()
Returns the max height of 2D image in pixels. The minimum value is 8192 if image support is available.
-
getMaxImage3dWidth
public int getMaxImage3dWidth()
Returns the max width of 3D image in pixels. The minimum value is 2048 if image support is available.
-
getMaxImage3dHeight
public int getMaxImage3dHeight()
Returns the max height of 3D image in pixels. The minimum value is 2048 if image support is available.
-
getMaxImage3dDepth
public int getMaxImage3dDepth()
Returns the max depth of 3D image in pixels. The minimum value is 2048 if image support is available.
-
getMaxSamplers
public int getMaxSamplers()
Returns the maximum number of samplers that can be used in a kernel. The minimum value is 16 if image support is available.
-
getProfilingTimerResolution
public long getProfilingTimerResolution()
Returns the resolution of device timer. This is measured in nanoseconds.
-
getExecutionCapabilities
public EnumSet<CLDevice.Capabilities> getExecutionCapabilities()
Returns the execution capabilities as EnumSet.
-
getHalfFPConfig
public EnumSet<CLDevice.FPConfig> getHalfFPConfig()
Returns the optional half precision floating-point capability of the device. The required minimum half precision floating-point capabilities as implemented by this extension areCLDevice.FPConfig.ROUND_TO_ZERO
,CLDevice.FPConfig.ROUND_TO_INF
andCLDevice.FPConfig.INF_NAN
.- Returns:
- An EnumSet containing the extensions, never null.
-
getSingleFPConfig
public EnumSet<CLDevice.FPConfig> getSingleFPConfig()
Returns the single precision floating-point capability of the device. The mandated minimum floating-point capabilities areCLDevice.FPConfig.ROUND_TO_NEAREST
andCLDevice.FPConfig.INF_NAN
.- Returns:
- An EnumSet containing the extensions, never null.
-
getDoubleFPConfig
public EnumSet<CLDevice.FPConfig> getDoubleFPConfig()
Returns the optional double precision floating-point capability of the device. The mandated minimum double precision floating-point capabilities areCLDevice.FPConfig.FMA
,CLDevice.FPConfig.ROUND_TO_NEAREST
,CLDevice.FPConfig.ROUND_TO_ZERO
,CLDevice.FPConfig.ROUND_TO_INF
,CLDevice.FPConfig.INF_NAN
, andCLDevice.FPConfig.DENORM
.- Returns:
- An EnumSet containing the extensions, never null.
-
getLocalMemType
public CLDevice.LocalMemType getLocalMemType()
Returns the local memory type.
-
getGlobalMemCacheType
public CLDevice.GlobalMemCacheType getGlobalMemCacheType()
Returns the type of global memory cache supported.
-
getQueueProperties
public EnumSet<CLCommandQueue.Mode> getQueueProperties()
Returns the command-queue properties supported by the device.
-
isAvailable
public boolean isAvailable()
Returns true if this device is available.
-
isCompilerAvailable
public boolean isCompilerAvailable()
Returns false if the implementation does not have a compiler available to compile the program source. Is true if the compiler is available. This can be false for the OpenCL ES profile only.
-
isLittleEndian
public boolean isLittleEndian()
Returns true if the OpenCL device is a little endian device and false otherwise.
-
isErrorCorrectionSupported
public boolean isErrorCorrectionSupported()
Returns true if the device implements error correction for the memories, caches, registers etc. in the device. Is false if the device does not implement error correction.
-
isHalfFPAvailable
public boolean isHalfFPAvailable()
ReturnsisExtensionAvailable(java.lang.String)
("cl_khr_fp16").- See Also:
getExtensions()
-
isDoubleFPAvailable
public boolean isDoubleFPAvailable()
ReturnsisExtensionAvailable(java.lang.String)
("cl_khr_fp64").- See Also:
getExtensions()
-
isICDAvailable
public boolean isICDAvailable()
ReturnsisExtensionAvailable(java.lang.String)
("cl_khr_icd").- See Also:
getExtensions()
-
isGLMemorySharingSupported
public boolean isGLMemorySharingSupported()
ReturnsisExtensionAvailable(java.lang.String)
("cl_khr_gl_sharing") ||isExtensionAvailable(java.lang.String)
("cl_APPLE_gl_sharing").- See Also:
getExtensions()
-
isExtensionAvailable
public boolean isExtensionAvailable(String extension)
Returns true if the extension is supported on this device.- See Also:
getExtensions()
-
getByteOrder
public ByteOrder getByteOrder()
ReturnsByteOrder.LITTLE_ENDIAN
orByteOrder.BIG_ENDIAN
.
-
getExtensions
public Set<String> getExtensions()
Returns all device extension names as unmodifiable Set.
-
getProperties
public Map<String,String> getProperties()
Returns a Map of device properties with the enum names as keys.
-
getCLAccessor
public final CLInfoAccessor getCLAccessor()
-
-