Class ResetOptions
- Namespace
- DotCompute.Abstractions.Recovery
- Assembly
- DotCompute.Abstractions.dll
Configuration options for device reset operations.
public sealed class ResetOptions
- Inheritance
-
ResetOptions
- Inherited Members
Remarks
Reset options control the behavior and scope of device reset operations. Different backends may support different features based on hardware capabilities.
Orleans Integration: Use reset operations during grain deactivation, error recovery, or when transferring device ownership between grains.
Properties
ClearKernelCache
Gets or sets whether to clear the kernel compilation cache.
public bool ClearKernelCache { get; set; }
Property Value
Remarks
When true, removes all cached compiled kernels. When false, retains compiled kernels for faster reuse.
Default: false (preserve cache for performance)
Note: Context and above always clear cache.
ClearMemoryPool
Gets or sets whether to clear the memory pool during reset.
public bool ClearMemoryPool { get; set; }
Property Value
Remarks
When true, releases all pooled memory allocations. When false, retains memory pool for faster subsequent allocations.
Default: false (preserve pool for performance)
CompleteCleanup
Gets reset options for complete device cleanup.
public static ResetOptions CompleteCleanup { get; }
Property Value
Context
Gets reset options for context reset (clear caches).
public static ResetOptions Context { get; }
Property Value
Default
Gets the default reset options for routine cleanup.
public static ResetOptions Default { get; }
Property Value
ErrorRecovery
Gets reset options for error recovery scenarios.
public static ResetOptions ErrorRecovery { get; }
Property Value
Force
Gets or sets whether to force reset even if device appears healthy.
public bool Force { get; set; }
Property Value
Remarks
When true, performs reset unconditionally. When false, may skip reset if device health checks pass.
Default: false (skip unnecessary resets)
Full
Gets reset options for full reset (complete reinitialization).
public static ResetOptions Full { get; }
Property Value
GrainDeactivation
Gets reset options for grain deactivation (Orleans).
public static ResetOptions GrainDeactivation { get; }
Property Value
Hard
Gets reset options for hard reset (clear memory and caches).
public static ResetOptions Hard { get; }
Property Value
Reinitialize
Gets or sets whether to reinitialize the device after reset.
public bool Reinitialize { get; set; }
Property Value
Remarks
When true, recreates device context and resources after reset. When false, leaves device in uninitialized state (requires manual reinitialization).
Default: true (device remains usable)
Note: Full may require reinit regardless of this setting.
ResetType
Gets or sets the type of reset to perform.
public ResetType ResetType { get; set; }
Property Value
Remarks
Default: Soft for minimal disruption.
Soft
Gets reset options for soft reset (minimal disruption).
public static ResetOptions Soft { get; }
Property Value
Timeout
Gets or sets the maximum time to wait for reset completion.
public TimeSpan Timeout { get; set; }
Property Value
Remarks
Prevents indefinite blocking if device becomes unresponsive. If timeout expires, reset fails with TimeoutException.
Default: 30 seconds
Recommended: 5-10 seconds for Soft/Context, 30-60 seconds for Hard/Full
WaitForCompletion
Gets or sets whether to wait for all pending operations to complete before reset.
public bool WaitForCompletion { get; set; }
Property Value
Remarks
When true, ensures all submitted kernels and memory transfers complete before reset. When false, may cancel pending operations (behavior varies by backend).
Default: true (safe default, prevents data loss)