Skip to main content
torch.js has not been released yet.
torch.js logotorch.js logotorch.js
PlaygroundContact
Login
Documentation
IntroductionType SafetyTensor ExpressionsTensor IndexingEinsumEinopsAutogradTraining a ModelProfiling & MemoryPyTorch MigrationBest PracticesRuntimesPerformancePyTorch CompatibilityBenchmarksDType Coverage
Introduction
createBufferUsageMapModeWGPUBufferWGPUShaderModuleWGPUBindGroupLayoutWGPUBindGroupWGPUComputePipelineWGPUQuerySetWGPUComputePassEncoderWGPUCommandBufferWGPUCommandEncoderWGPUQueueWGPULimitsBufferDescriptorShaderModuleDescriptorComputePipelineDescriptorBufferBindingBindGroupEntryBindGroupDescriptorQuerySetDescriptorWGPUDeviceWGPUSupportedFeaturesWGPUAdapterWGPU
torch.js· 2026
LegalTerms of UsePrivacy Policy
/
/
  1. docs
  2. wgpu-native
  3. wgpu-native
  4. WGPUQueue

wgpu-native.WGPUQueue

export interface WGPUQueue {
  /**
   * Opaque native handle to this queue.
   */
  readonly handle: QueueHandle;

  /**
   * Submit one or more command buffers for GPU execution.
   *
   * Commands are executed asynchronously. Use {@link onSubmittedWorkDone} to
   * wait for completion.
   *
   * @param commandBuffers - Array of command buffers to submit
   */
  submit(commandBuffers: WGPUCommandBuffer[]): void;

  /**
   * Write data to a buffer from the CPU.
   *
   * The data is copied from host memory to the GPU buffer.
   * This is a synchronous operation from the CPU perspective.
   *
   * @param buffer - Destination buffer (must have COPY_DST usage)
   * @param bufferOffset - Byte offset in buffer
   * @param data - Data to write as ArrayBuffer
   */
  writeBuffer(buffer: WGPUBuffer, bufferOffset: number, data: ArrayBuffer): void;

  /**
   * Wait for all submitted work to complete.
   *
   * @returns Promise that resolves when GPU is idle
   */
  onSubmittedWorkDone(): Promise<void>;
}
readonlyhandle(QueueHandle)
– Opaque native handle to this queue.
submit((commandBuffers: WGPUCommandBuffer[]) => void)
– Submit one or more command buffers for GPU execution. Commands are executed asynchronously. Use onSubmittedWorkDone to wait for completion.
writeBuffer((buffer: WGPUBuffer, bufferOffset: number, data: ArrayBuffer) => void)
– Write data to a buffer from the CPU. The data is copied from host memory to the GPU buffer. This is a synchronous operation from the CPU perspective.
onSubmittedWorkDone(() => Promise<void>)
– Wait for all submitted work to complete.

GPU command queue.

Submits command buffers and data writes to the GPU for execution.

Previous
WGPUQuerySet
Next
WGPUShaderModule