Class Device

java.lang.Object
org.apache.tvm.Device
Direct Known Subclasses:
TVMRemoteDevice

public class Device extends Object
  • Field Details

    • deviceType

      public final int deviceType
    • deviceId

      public final int deviceId
  • Constructor Details

    • Device

      public Device(int deviceType, int deviceId)
    • Device

      public Device(String deviceType, int deviceId)
  • Method Details

    • cpu

      public static Device cpu(int devId)
      Construct a CPU device.
      Parameters:
      devId - The device id
      Returns:
      The created device
    • cpu

      public static Device cpu()
    • cuda

      public static Device cuda(int devId)
      Construct a CUDA GPU device.
      Parameters:
      devId - The device id
      Returns:
      The created device
    • cuda

      public static Device cuda()
    • opencl

      public static Device opencl(int devId)
      Construct a OpenCL device.
      Parameters:
      devId - The device id
      Returns:
      The created device
    • opencl

      public static Device opencl()
    • vulkan

      public static Device vulkan(int devId)
      Construct a Vulkan device.
      Parameters:
      devId - The device id
      Returns:
      The created device
    • vulkan

      public static Device vulkan()
    • metal

      public static Device metal(int devId)
      Construct a metal device.
      Parameters:
      devId - The device id
      Returns:
      The created device
    • metal

      public static Device metal()
    • vpi

      public static Device vpi(int devId)
      Construct a VPI simulated device.
      Parameters:
      devId - The device id
      Returns:
      The created device
    • vpi

      public static Device vpi()
    • hexagon

      public static Device hexagon(int devId)
      Construct a Hexagon device.
      Parameters:
      devId - The device id
      Returns:
      The created device
    • hexagon

      public static Device hexagon()
    • exist

      public boolean exist()
      Whether this device exists.
      Returns:
      true if exists.
    • maxThreadsPerBlock

      public long maxThreadsPerBlock()
      Maximum number of threads on each block.
      Returns:
      the maximum thread number.
    • warpSize

      public long warpSize()
      Number of threads that executes in concurrent.
      Returns:
      the thread number.
    • sync

      public void sync()
      Synchronize until jobs finished at the device.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object