Module tornado.api

Interface TornadoBackend


public interface TornadoBackend
Interface of the TornadoVM backends. This interface contains the minimum amount of methods to be query per backend, such as the total number of devices, query the default device, etc.
  • Method Details

    • getDefaultDevice

      TornadoDevice getDefaultDevice()
      Returns the default device accelerator. If TornadoVM has access to multiple accelerators, it will select one as default one. The default accelerator depends on the backends installed. TornadoVM prioritizes compute capabilities and memory available to sort the list of devices. The default device is the first in this internal list.
      Returns:
      TornadoDevice
    • setDefaultDevice

      void setDefaultDevice(int index)
      Sets the default device. The default device is set in the first position of an internal linked list. This method swaps the selected device to be used as default.
      Parameters:
      index - Device Index within the list of devices per backend.
    • getNumDevices

      int getNumDevices()
      Returns the total number of devices per backend. TornadoVM guarantees at least one device.
      Returns:
      int
    • getDevice

      TornadoDevice getDevice(int index)
      Obtains a device object. Each backend could access multiple hardware accelerators. This method selects one device that can be used to pass to an TornadoExecutionPlan to run applications on.
      Parameters:
      index - Index within the device internal list.
      Returns:
      TornadoDevice
    • getAllDevices

      List<TornadoDevice> getAllDevices()
      Returns a list with all device objects available for the current backend.
      Returns:
      List<TornadoDevice>
    • getTypeDefaultDevice

      TornadoDeviceType getTypeDefaultDevice()
      Returns the type of the default device. The device type could be CPU, GPU, CUSTOM, FPGA.
      Returns:
      TornadoDeviceType
    • getName

      String getName()
      Returns the name of the Backend. E.g., "OpenCL", "SPIR-V".
      Returns:
      String
    • getNumPlatforms

      int getNumPlatforms()
      Returns the total number of Platforms that are accessible within a specific Backend.
      Returns:
      int
    • getBackendType

      TornadoVMBackendType getBackendType()
      Returns the type of the backend. Backends could be:
      • OpenCL: An OpenCL C Device
      • PTX: An NVIDIA Device with CUDA Support
      • SPIRV: An SPIR-V Device (OpenCL >= 2.1)
      • JAVA: A Java device. This might be removed in future versions
      • VIRTUAL: A Virtual Device
      Returns:
      TornadoVMBackendType