MCPcopy Index your code
hub / github.com/apache/tvm / deviceCopyWithinGPU

Method deviceCopyWithinGPU

web/src/webgpu.ts:1034–1053  ·  view source on GitHub ↗
(
    from: GPUPointer,
    fromOffset: number,
    to: Pointer,
    toOffset: number,
    nbytes: number
  )

Source from the content-addressed store, hash-verified

1032 }
1033
1034 private deviceCopyWithinGPU(
1035 from: GPUPointer,
1036 fromOffset: number,
1037 to: Pointer,
1038 toOffset: number,
1039 nbytes: number
1040 ): void {
1041 // Flush batched compute passes before the GPU-to-GPU copy.
1042 this.flushCommands();
1043 const copyEncoder = this.device.createCommandEncoder();
1044 copyEncoder.copyBufferToBuffer(
1045 this.gpuBufferFromPtr(from),
1046 fromOffset,
1047 this.gpuBufferFromPtr(to),
1048 toOffset,
1049 nbytes
1050 );
1051 const copyCommands = copyEncoder.finish();
1052 this.device.queue.submit([copyCommands]);
1053 }
1054
1055 private gpuBufferFromPtr(ptr: GPUPointer): GPUBuffer {
1056 const buffer = this.bufferTable[ptr];

Callers 1

getDeviceAPIMethod · 0.95

Calls 4

flushCommandsMethod · 0.95
gpuBufferFromPtrMethod · 0.95
finishMethod · 0.80
submitMethod · 0.80

Tested by

no test coverage detected