Module tornado.api

Interface TornadoDevice


public interface TornadoDevice
  • Method Details

    • allocate

      long allocate(Object object, long batchSize, DeviceBufferState state, Access access)
      It allocates an object in the pre-defined heap of the target device. It also ensures that there is enough space for the input object.
      Parameters:
      object - to be allocated
      batchSize - size of the object to be allocated. If this value is invalid input: '<'= 0, then it allocates the sizeof(object).
      state - state of the object in the target device DeviceBufferState
      Returns:
      an event ID
    • allocateObjects

      long allocateObjects(Object[] objects, long batchSize, DeviceBufferState[] states, Access[] accesses)
    • deallocate

      long deallocate(DeviceBufferState state)
    • ensurePresent

      List<Integer> ensurePresent(long executionPlanId, Object object, DeviceBufferState objectState, int[] events, long batchSize, long hostOffset)
      It allocates and copy in the content of the object to the target device.
      Parameters:
      object - to be allocated
      objectState - state of the object in the target device DeviceBufferState
      events - list of pending events (dependencies)
      batchSize - size of the object to be allocated. If this value is invalid input: '<'= 0, then it allocates the sizeof(object).
      hostOffset - offset in bytes for the copy within the host input array (or object)
      Returns:
      an event ID
    • streamIn

      List<Integer> streamIn(long executionPlanId, Object object, long batchSize, long hostOffset, DeviceBufferState objectState, int[] events)
      It always copies in the input data (object) from the host to the target device.
      Parameters:
      object - to be copied
      batchSize - size of the object to be allocated. If this value is invalid input: '<'= 0, then it allocates the sizeof(object).
      hostOffset - offset in bytes for the copy within the host input array (or object)
      objectState - state of the object in the target device DeviceBufferState
      events - list of previous events
      Returns:
      and event ID
    • streamOut

      int streamOut(long executionPlanId, Object object, long hostOffset, DeviceBufferState objectState, int[] events)
      It copies a device buffer from the target device to the host. Copies are non-blocking
      Parameters:
      object - to be copied.
      hostOffset - offset in bytes for the copy within the host input array (or object)
      objectState - state of the object in the target device DeviceBufferState
      events - of pending events
      Returns:
      and event ID
    • streamOutBlocking

      int streamOutBlocking(long executionPlanId, Object object, long hostOffset, DeviceBufferState objectState, int[] events)
      It copies a device buffer from the target device to the host. Copies are blocking between the device and the host.
      Parameters:
      object - to be copied.
      hostOffset - offset in bytes for the copy within the host input array (or object)
      objectState - state of the object in the target device DeviceBufferState
      events - of pending events
      Returns:
      and event ID
    • resolveEvent

      Event resolveEvent(long executionPlanId, int event)
      It resolves a pending event.
      Parameters:
      event - ID
      Returns:
      an object of type Event
    • ensureLoaded

      void ensureLoaded(long executionPlanId)
    • flushEvents

      void flushEvents(long executionPlanId)
    • enqueueBarrier

      int enqueueBarrier(long executionPlanId)
    • enqueueBarrier

      int enqueueBarrier(long executionPlanId, int[] events)
    • enqueueMarker

      int enqueueMarker(long executionPlanId)
    • enqueueMarker

      int enqueueMarker(long executionPlanId, int[] events)
    • sync

      void sync(long executionPlanId)
    • flush

      void flush(long executionPlanId)
    • clean

      void clean()
    • dumpEvents

      void dumpEvents(long executionPlanId)
    • getDeviceName

      String getDeviceName()
    • getDescription

      String getDescription()
    • getPlatformName

      String getPlatformName()
    • getDeviceContext

      TornadoDeviceContext getDeviceContext()
    • getPhysicalDevice

      TornadoTargetDevice getPhysicalDevice()
    • getMemoryProvider

      TornadoMemoryProvider getMemoryProvider()
    • getDeviceType

      TornadoDeviceType getDeviceType()
    • getMaxAllocMemory

      long getMaxAllocMemory()
    • getMaxGlobalMemory

      long getMaxGlobalMemory()
    • getDeviceLocalMemorySize

      long getDeviceLocalMemorySize()
    • getDeviceMaxWorkgroupDimensions

      long[] getDeviceMaxWorkgroupDimensions()
    • getDeviceOpenCLCVersion

      String getDeviceOpenCLCVersion()
    • getDeviceInfo

      Object getDeviceInfo()
    • getBackendIndex

      int getBackendIndex()
    • getAvailableProcessors

      default int getAvailableProcessors()
      Returns the number of processors available to the JVM. We need to overwrite this function only for Virtual Devices, where we read the value from the descriptor file.
    • getAtomic

      Object getAtomic()
    • setAtomicsMapping

      @Deprecated void setAtomicsMapping(ConcurrentHashMap<Object,Integer> mappingAtomics)
      Deprecated.
    • getTornadoVMBackend

      TornadoVMBackendType getTornadoVMBackend()
    • isSPIRVSupported

      boolean isSPIRVSupported()
    • mapDeviceRegion

      void mapDeviceRegion(long executionPlanId, Object destArray, Object srcArray, DeviceBufferState deviceStateSrc, DeviceBufferState deviceStateDest, long offset)