类 RPCSession

java.lang.Object
org.apache.tvm.rpc.RPCSession

public class RPCSession extends Object
RPC 客户端会话模块。请勿直接创建对象,使用 Client.connect。
  • 方法详细信息

    • getFunction

      public Function getFunction(String name)
      从会话中获取函数。
      参数
      name - 函数的名称。
      返回
      结果函数。
    • device

      public Device device(String devType, int devId)
      构造一个远程设备。
      参数
      devType - 设备类型。
      devId - 设备 ID。
      返回
      对应的编码远程设备。
    • device

      public Device device(String devType)
      构造一个远程设备。
      参数
      devType - 设备类型。
      返回
      对应的编码远程设备。
    • device

      public Device device(int devType, int devId)
      构造一个远程设备。
      参数
      devType - 设备类型。
      devId - 设备 ID。
      返回
      对应的编码远程设备。
    • device

      public Device device(int devType)
      构造一个远程设备。
      参数
      devType - 设备类型。
      返回
      对应的编码远程设备。
    • cpu

      public Device cpu(int devId)
      构造远程 CPU 设备。
      参数
      devId - 设备 ID。
      返回
      远程 CPU 设备。
    • cpu

      public Device cpu()
      构造远程 CPU 设备。
      返回
      远程 CPU 设备。
    • cuda

      public Device cuda(int devId)
      构造远程 CUDA GPU 设备。
      参数
      devId - 设备 ID。
      返回
      远程 CUDA GPU 设备。
    • cuda

      public Device cuda()
      构造远程 CUDA GPU 设备。
      返回
      远程 CUDA GPU 设备。
    • cl

      public Device cl(int devId)
      构造远程 OpenCL 设备。
      参数
      devId - 设备 ID。
      返回
      远程 OpenCL 设备。
    • cl

      public Device cl()
      构造远程 OpenCL 设备。
      返回
      远程 OpenCL 设备。
    • vulkan

      public Device vulkan(int devId)
      构造远程 OpenCL 设备。
      参数
      devId - 设备 ID。
      返回
      远程 OpenCL 设备。
    • vulkan

      public Device vulkan()
      构造远程 OpenCL 设备。
      返回
      远程 OpenCL 设备。
    • metal

      public Device metal(int devId)
      构造远程 Metal 设备。
      参数
      devId - 设备 ID。
      返回
      远程 metal 设备。
    • metal

      public Device metal()
      构造远程 Metal 设备。
      返回
      远程 metal 设备。
    • upload

      public void upload(byte[] data, String target)
      上传二进制文件到远程运行时临时文件夹。
      参数
      data - 要上传的本地二进制数据。
      target - 远程路径,不能为空。
    • upload

      public void upload(File data, String target) throws IOException
      上传文件到远程运行时临时文件夹。
      参数
      data - 要上传的本地文件。
      target - 远程路径。
      抛出
      IOException - 网络故障时抛出。
    • upload

      public void upload(File data) throws IOException
      上传文件到远程运行时临时文件夹。
      参数
      data - 要上传的本地文件。
      抛出
      IOException - 网络故障时抛出。
    • download

      public byte[] download(String path)
      从远程临时文件夹下载文件。
      参数
      path - 相对于远程临时文件夹的位置。
      返回
      从文件获取的结果 blob。
    • loadModule

      public Module loadModule(String path)
      加载远程模块,文件需要先上传。
      参数
      path - 相对于远程临时文件夹的位置。
      返回
      包含远程函数的远程模块。