Interface GpuRuntime


public interface GpuRuntime
Abstraction over a GPU compute runtime (Metal, CUDA, Vulkan, etc.).

ComputeGraph delegates all native/driver calls through this interface, keeping the graph logic itself backend-agnostic.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    allocBuffers(int[] ids, int[] sizes, int count)
    Batch-allocate GPU buffers.
    void
    downloadBuffer(int bufId, float[] out)
    Download GPU buffer contents into a CPU float array.
    void
    flushOps(int[] cmdStream, int cmdStreamLength)
    Execute a batch of ops encoded as a flat int[] command stream, all in one command buffer submission.
    void
    releaseBuffers(int[] ids, int count)
    Release multiple GPU buffers by id.
    void
    uploadBuffer(int bufId, float[] data)
    Upload CPU float data into an existing GPU buffer.
  • Method Details

    • allocBuffers

      void allocBuffers(int[] ids, int[] sizes, int count)
      Batch-allocate GPU buffers. ids[i] gets sizes[i] floats.
    • uploadBuffer

      void uploadBuffer(int bufId, float[] data)
      Upload CPU float data into an existing GPU buffer.
    • downloadBuffer

      void downloadBuffer(int bufId, float[] out)
      Download GPU buffer contents into a CPU float array.
    • releaseBuffers

      void releaseBuffers(int[] ids, int count)
      Release multiple GPU buffers by id.
    • flushOps

      void flushOps(int[] cmdStream, int cmdStreamLength)
      Execute a batch of ops encoded as a flat int[] command stream, all in one command buffer submission.