Class ClearCLDevice

  • All Implemented Interfaces:
    AutoCloseable

    public class ClearCLDevice
    extends ClearCLBase
    ClearCLDevice is the ClearCL abstraction for OpenCl devices.
    Author:
    royer
    • 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