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
createdestroyBufferUsageMapModeShaderStageBufferHandleDeviceHandleAdapterHandleShaderModuleHandleComputePipelineHandleBindGroupHandleBindGroupLayoutHandleCommandEncoderHandleCommandBufferHandleComputePassEncoderHandleQuerySetHandleQueueHandleWGPUBufferWGPUShaderModuleWGPUBindGroupLayoutWGPUBindGroupWGPUComputePipelineWGPUQuerySetWGPUComputePassEncoderWGPUCommandBufferWGPUCommandEncoderWGPUQueueWGPULimitsBufferDescriptorShaderModuleDescriptorComputePipelineDescriptorBufferBindingBindGroupEntryBindGroupDescriptorQuerySetDescriptorWGPUDeviceWGPUSupportedFeaturesWGPUAdapterWGPU
torch.js· 2026
LegalTerms of UsePrivacy Policy
/
/
  1. docs
  2. dawn
  3. dawn
  4. destroy

dawn.destroy

function destroy(): void

Cleanup and destroy the GPU instance.

Should be called before process exit to clean up native resources. After calling destroy(), the GPU instance cannot be reused.

Examples

import { destroy } from '@torchjsorg/dawn';

// ... use GPU ...
destroy();
Previous
create
Next
DeviceHandle