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 classCLDevice.CapabilitiesEnumeration for the execution capabilities of the device.static classCLDevice.FPConfigDescribes floating-point capability of the device.static classCLDevice.GlobalMemCacheTypeType of global memory cache supported.static classCLDevice.LocalMemTypeType of local memory cache supported.static classCLDevice.TypeEnumeration for the type of a device.
-
Constructor Summary
Constructors Modifier Constructor Description protectedCLDevice(CLContext context, long id)protectedCLDevice(CLPlatform platform, long id)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CLCommandQueuecreateCommandQueue()CLCommandQueuecreateCommandQueue(long properties)CLCommandQueuecreateCommandQueue(CLCommandQueue.Mode property)CLCommandQueuecreateCommandQueue(CLCommandQueue.Mode... properties)booleanequals(Object obj)intgetAddressBits()The default compute device address space size specified in bits.ByteOrdergetByteOrder()ReturnsByteOrder.LITTLE_ENDIANorByteOrder.BIG_ENDIAN.CLInfoAccessorgetCLAccessor()CLVersiongetCVersion()Returns the OpenCL-C version supported by the device.EnumSet<CLDevice.FPConfig>getDoubleFPConfig()Returns the optional double precision floating-point capability of the device.StringgetDriverVersion()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.longgetGlobalMemCachelineSize()Returns the size of global memory cache line in bytes.longgetGlobalMemCacheSize()Returns the size of global memory cache in bytes.CLDevice.GlobalMemCacheTypegetGlobalMemCacheType()Returns the type of global memory cache supported.longgetGlobalMemSize()Returns the global memory size in bytes.EnumSet<CLDevice.FPConfig>getHalfFPConfig()Returns the optional half precision floating-point capability of the device.longgetLocalMemSize()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.LocalMemTypegetLocalMemType()Returns the local memory type.intgetMaxClockFrequency()Returns the maximum configured clock frequency of the device in MHz.intgetMaxComputeUnits()Returns the number of parallel compute cores on the OpenCL device.longgetMaxConstantArgs()Returns the max number of arguments declared with theconstantqualifier in a kernel.longgetMaxConstantBufferSize()Returns the max size in bytes of a constant buffer allocation.intgetMaxImage2dHeight()Returns the max height of 2D image in pixels.intgetMaxImage2dWidth()Returns the max width of 2D image in pixels.intgetMaxImage3dDepth()Returns the max depth of 3D image in pixels.intgetMaxImage3dHeight()Returns the max height of 3D image in pixels.intgetMaxImage3dWidth()Returns the max width of 3D image in pixels.longgetMaxMemAllocSize()Returns the largest allocatable size of aCLBufferon this device.longgetMaxParameterSize()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.intgetMaxReadImageArgs()Returns the max number of simultaneous image objects that can be read by a kernel.intgetMaxSamplers()Returns the maximum number of samplers that can be used in a kernel.intgetMaxWorkGroupSize()Returns the maximum number of work-items in a work-group executing a kernel using the data parallel execution model.intgetMaxWorkItemDimensions()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.intgetMaxWriteImageArgs()Returns the max number of simultaneous image objects that can be written by a kernel.longgetMemBaseAddrAlign()Returns theuint32_tmemory base address alignment value reinterpreted as alongvalue.StringgetName()Returns the name of this device.intgetNativeCharVectorWidth()Native vector width size for built-in char vectors.intgetNativeDoubleVectorWidth()Native vector width size for built-in double vectors.intgetNativeFloatVectorWidth()Native vector width size for built-in float vectors.intgetNativeHalfVectorWidth()Native vector width size for built-in half vectors.intgetNativeIntVectorWidth()Native vector width size for built-in int vectors.intgetNativeLongVectorWidth()Native vector width size for built-in long vectors.intgetNativeShortVectorWidth()Native vector width size for built-in short vectors.CLPlatformgetPlatform()Returns the platform for this OpenCL object.intgetPreferredCharVectorWidth()Preferred native vector width size for built-in char vectors.intgetPreferredDoubleVectorWidth()Preferred native vector width size for built-in double vectors.intgetPreferredFloatVectorWidth()Preferred native vector width size for built-in float vectors.intgetPreferredIntVectorWidth()Preferred native vector width size for built-in int vectors.intgetPreferredLongVectorWidth()Preferred native vector width size for built-in long vectors.intgetPreferredShortVectorWidth()Preferred native vector width size for built-in short vectors.StringgetProfile()Returns the OpenCL profile of this device.longgetProfilingTimerResolution()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.TypegetType()Returns the type of this device.StringgetVendor()Returns the vendor of this device.longgetVendorID()Returns the vendor id of this device.CLVersiongetVersion()Returns the OpenCL version supported by the device.inthashCode()booleanisAvailable()Returns true if this device is available.booleanisCompilerAvailable()Returns false if the implementation does not have a compiler available to compile the program source.booleanisDoubleFPAvailable()ReturnsisExtensionAvailable(java.lang.String)("cl_khr_fp64").booleanisErrorCorrectionSupported()Returns true if the device implements error correction for the memories, caches, registers etc.booleanisExtensionAvailable(String extension)Returns true if the extension is supported on this device.booleanisGLMemorySharingSupported()ReturnsisExtensionAvailable(java.lang.String)("cl_khr_gl_sharing") ||isExtensionAvailable(java.lang.String)("cl_APPLE_gl_sharing").booleanisHalfFPAvailable()ReturnsisExtensionAvailable(java.lang.String)("cl_khr_fp16").booleanisICDAvailable()ReturnsisExtensionAvailable(java.lang.String)("cl_khr_icd").booleanisImageSupportAvailable()Returns true if images are supported by the OpenCL device and false otherwise.booleanisLittleEndian()Returns true if the OpenCL device is a little endian device and false otherwise.booleanisMemoryUnified()Returns true if the device and the host have a unified memory subsystem.StringtoString()-
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:CLObjectReturns the platform for this OpenCL object.- Overrides:
getPlatformin 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 aCLBufferon this device.
-
getMemBaseAddrAlign
public long getMemBaseAddrAlign()
Returns theuint32_tmemory base address alignment value reinterpreted as alongvalue.
-
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 theconstantqualifier 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_INFandCLDevice.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_NEARESTandCLDevice.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_ENDIANorByteOrder.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()
-
-