Table of Contents

Enum ResetType

Namespace
DotCompute.Abstractions.Recovery
Assembly
DotCompute.Abstractions.dll

Defines the type of device reset to perform.

public enum ResetType

Fields

Context = 1

Context reset: Reset device context, clear kernel compilation cache, and release temporary resources.

CUDA: Reset current context, clear NVRTC cache

Metal: Recreate command queue, clear shader cache

OpenCL: Release and recreate context

CPU: Clear SIMD state, reset thread affinity

Typical Duration: 10-50ms

Full = 3

Full reset: Complete device and driver state reset. Most thorough option, used for recovery from critical errors.

CUDA: cudaDeviceReset() + driver reinit

Metal: Release device, recreate from system default

OpenCL: Reinitialize platform and device

CPU: Full backend reinitialization

Typical Duration: 200-1000ms

Warning: All accelerator references become invalid

Hard = 2

Hard reset: Full device reset including memory deallocation. Clears all device state except driver-level configuration.

CUDA: cudaDeviceReset() - clears all allocations

Metal: Release all buffers, recreate device resources

OpenCL: Release all memory objects, recreate context

CPU: Clear memory pools, reset performance counters

Typical Duration: 50-200ms

Warning: All UnifiedBuffer instances become invalid

Soft = 0

Soft reset: Clear pending operations and flush command queues. Fastest option with minimal disruption to device state.

CUDA: Synchronize device, clear kernel queues

Metal: Wait for command buffers, clear pools

OpenCL: Flush command queues, wait for completion

CPU: Clear thread pool work items

Typical Duration: 1-10ms

Remarks

Different reset types provide varying levels of device state cleanup:

  • Soft: Quick cleanup without full reinitialization
  • Context: Reset device context and kernel state
  • Hard: Full device reset with memory clearing
  • Full: Complete reset including driver state