Package net.haesleinhuepf.clij.clearcl
Class ClearCLDevice
- java.lang.Object
-
- net.haesleinhuepf.clij.clearcl.abs.ClearCLBase
-
- net.haesleinhuepf.clij.clearcl.ClearCLDevice
-
- All Implemented Interfaces:
AutoCloseable
public class ClearCLDevice extends ClearCLBase
ClearCLDevice is the ClearCL abstraction for OpenCl devices.- Author:
- royer
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()ClearCLContextcreateContext()Creates device context.longgetClockFrequency()Returns this device clock frequency.StringgetExtensions()Returns device OpenL extensions string.longgetGlobalMemorySizeInBytes()Returns this device global memory size in bytes.StringgetInfoString()Returns device info string.longgetLocalMemorySizeInBytes()Returns this device local memory size.longgetMaxMemoryAllocationSizeInBytes()Returns this device max memory allocation size.longgetMaxWorkGroupSize()Returns the max work group size.StringgetName()Returns device name.intgetNumberOfAvailableContexts()Returns the number of 'available' contexts, i.e.longgetNumberOfComputeUnits()Returns this device number of compute units.intgetNumberOfLiveContexts()Returns the number of 'live' contexts, i.e.DeviceTypegetType()Returns device type.doublegetVersion()Returns OpenCL versionStringtoString()-
Methods inherited from class net.haesleinhuepf.clij.clearcl.abs.ClearCLBase
getBackend, getPeerPointer, setPeerPointer
-
-
-
-
Method Detail
-
getName
public String getName()
Returns device name.- Returns:
- device name.
-
getType
public DeviceType getType()
Returns device type.- Returns:
- device type
-
getVersion
public double getVersion()
Returns OpenCL version- Returns:
- OpenCL version
-
getExtensions
public String getExtensions()
Returns device OpenL extensions string.- Returns:
- extensions string
-
getGlobalMemorySizeInBytes
public long getGlobalMemorySizeInBytes()
Returns this device global memory size in bytes.- Returns:
- global memory size in bytes
-
getMaxMemoryAllocationSizeInBytes
public long getMaxMemoryAllocationSizeInBytes()
Returns this device max memory allocation size.- Returns:
- max allocation size
-
getLocalMemorySizeInBytes
public long getLocalMemorySizeInBytes()
Returns this device local memory size.- Returns:
- local memory size
-
getClockFrequency
public long getClockFrequency()
Returns this device clock frequency.- Returns:
- clock frequency in MHz
-
getNumberOfComputeUnits
public long getNumberOfComputeUnits()
Returns this device number of compute units.- Returns:
- number of compute units
-
getMaxWorkGroupSize
public long getMaxWorkGroupSize()
Returns the max work group size. This means that the product of the local sizes cannot be bigger that this value.- Returns:
- max work group size
-
getInfoString
public String getInfoString()
Returns device info string.- Returns:
- device info string
-
createContext
public ClearCLContext createContext()
Creates device context. Contexts are mannaged internally by a recycler (CoreMem recycler), and are automatically released back to the recycler just before garbage collection. So in theory, there is no need to manually release a context as long as its reference is forgotten.Note: There is a maximal number of contexts that can be created. This is a large number that should accomodate any reasonable application. An exception is thrown by this method if we run out of contexts, which can only happen if they are all used (reference is still known and thus not garbage collected).
- Returns:
- context
-
getNumberOfLiveContexts
public int getNumberOfLiveContexts()
Returns the number of 'live' contexts, i.e. contexts that have been created but not yet released.- Returns:
- number of live contexts
-
getNumberOfAvailableContexts
public int getNumberOfAvailableContexts()
Returns the number of 'available' contexts, i.e. contexts that have been created and the released, and that are now available for recycling- Returns:
- number of available contexts
-
toString
public String toString()
- Overrides:
toStringin classClearCLBase
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein classClearCLBase
-
-