MCPcopy Create free account
hub / github.com/apache/tvm / copyRawBytesToBuffer

Method copyRawBytesToBuffer

web/src/webgpu.ts:547–562  ·  view source on GitHub ↗

* Copy raw bytes into buffer ptr. * * @param rawBytes The raw bytes * @param toPtr The target gpu buffer ptr * @param toOffset The beginning offset * @param nbytes Number of bytes

(
    rawBytes: Uint8Array,
    toPtr: GPUPointer,
    toOffset: number,
    nbytes: number
  )

Source from the content-addressed store, hash-verified

545 * @param nbytes Number of bytes
546 */
547 copyRawBytesToBuffer(
548 rawBytes: Uint8Array,
549 toPtr: GPUPointer,
550 toOffset: number,
551 nbytes: number
552 ): void {
553 // Flush batched compute passes before writing, to preserve execution order.
554 this.flushCommands();
555 this.device.queue.writeBuffer(
556 this.gpuBufferFromPtr(toPtr),
557 toOffset,
558 rawBytes as GPUAllowSharedBufferSource,
559 0,
560 nbytes
561 );
562 }
563 /**
564 * Clear canvas
565 */

Callers 1

copyFromRawBytesMethod · 0.80

Calls 2

flushCommandsMethod · 0.95
gpuBufferFromPtrMethod · 0.95

Tested by

no test coverage detected