Class ResetResult
- Namespace
- DotCompute.Abstractions.Recovery
- Assembly
- DotCompute.Abstractions.dll
Result information from a device reset operation.
public sealed class ResetResult
- Inheritance
-
ResetResult
- Inherited Members
Remarks
Provides detailed information about reset execution, including:
- Success status and error information
- Performance metrics (duration, operations cleared)
- State changes (memory freed, kernels cleared)
- Backend-specific diagnostics
Properties
BackendType
Gets the backend type (CUDA, Metal, OpenCL, CPU).
public required string BackendType { get; init; }
Property Value
DeviceId
Gets the device identifier that was reset.
public required string DeviceId { get; init; }
Property Value
DeviceName
Gets the device name.
public required string DeviceName { get; init; }
Property Value
DiagnosticInfo
Gets backend-specific diagnostic information.
public IReadOnlyDictionary<string, string>? DiagnosticInfo { get; init; }
Property Value
Remarks
May include:
- CUDA: XID errors, ECC error counts, NVML diagnostics
- Metal: Command buffer statistics, shader compilation info
- OpenCL: Platform/device errors, queue flush results
- CPU: Thread pool statistics, SIMD state information
Duration
Gets the duration of the reset operation.
public required TimeSpan Duration { get; init; }
Property Value
ErrorMessage
Gets the error message if reset failed.
public string? ErrorMessage { get; init; }
Property Value
Remarks
Null if Success is true.
Exception
Gets the exception that caused reset failure, if any.
public Exception? Exception { get; init; }
Property Value
KernelCacheCleared
Gets whether the kernel cache was cleared.
public bool KernelCacheCleared { get; init; }
Property Value
KernelsCacheCleared
Gets the number of kernel compilations cleared from cache.
public int KernelsCacheCleared { get; init; }
Property Value
MemoryFreedBytes
Gets the amount of memory freed during reset (in bytes).
public long MemoryFreedBytes { get; init; }
Property Value
MemoryPoolCleared
Gets whether the memory pool was cleared.
public bool MemoryPoolCleared { get; init; }
Property Value
PendingOperationsCleared
Gets the number of pending operations that were cancelled/completed.
public long PendingOperationsCleared { get; init; }
Property Value
ResetType
Gets the type of reset that was performed.
public required ResetType ResetType { get; init; }
Property Value
StatusMessage
Gets a human-readable status message describing the reset result.
public string StatusMessage { get; }
Property Value
Success
Gets whether the reset operation succeeded.
public required bool Success { get; init; }
Property Value
Timestamp
Gets the timestamp when reset was initiated.
public required DateTimeOffset Timestamp { get; init; }
Property Value
WasReinitialized
Gets whether the device was reinitialized after reset.
public bool WasReinitialized { get; init; }
Property Value
Methods
CreateFailure(string, string, string, ResetType, DateTimeOffset, TimeSpan, string, Exception?, IReadOnlyDictionary<string, string>?)
Creates a failed reset result.
public static ResetResult CreateFailure(string deviceId, string deviceName, string backendType, ResetType resetType, DateTimeOffset timestamp, TimeSpan duration, string errorMessage, Exception? exception = null, IReadOnlyDictionary<string, string>? diagnosticInfo = null)
Parameters
deviceIdstringdeviceNamestringbackendTypestringresetTypeResetTypetimestampDateTimeOffsetdurationTimeSpanerrorMessagestringexceptionExceptiondiagnosticInfoIReadOnlyDictionary<string, string>
Returns
CreateSuccess(string, string, string, ResetType, DateTimeOffset, TimeSpan, bool, long, long, int, bool, bool, IReadOnlyDictionary<string, string>?)
Creates a successful reset result.
public static ResetResult CreateSuccess(string deviceId, string deviceName, string backendType, ResetType resetType, DateTimeOffset timestamp, TimeSpan duration, bool wasReinitialized, long pendingOperationsCleared = 0, long memoryFreedBytes = 0, int kernelsCacheCleared = 0, bool memoryPoolCleared = false, bool kernelCacheCleared = false, IReadOnlyDictionary<string, string>? diagnosticInfo = null)
Parameters
deviceIdstringdeviceNamestringbackendTypestringresetTypeResetTypetimestampDateTimeOffsetdurationTimeSpanwasReinitializedboolpendingOperationsClearedlongmemoryFreedByteslongkernelsCacheClearedintmemoryPoolClearedboolkernelCacheClearedbooldiagnosticInfoIReadOnlyDictionary<string, string>
Returns
ToString()
Returns a string representation of the reset result.
public override string ToString()