Table of Contents

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

string

DeviceId

Gets the device identifier that was reset.

public required string DeviceId { get; init; }

Property Value

string

DeviceName

Gets the device name.

public required string DeviceName { get; init; }

Property Value

string

DiagnosticInfo

Gets backend-specific diagnostic information.

public IReadOnlyDictionary<string, string>? DiagnosticInfo { get; init; }

Property Value

IReadOnlyDictionary<string, string>

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

TimeSpan

ErrorMessage

Gets the error message if reset failed.

public string? ErrorMessage { get; init; }

Property Value

string

Remarks

Null if Success is true.

Exception

Gets the exception that caused reset failure, if any.

public Exception? Exception { get; init; }

Property Value

Exception

KernelCacheCleared

Gets whether the kernel cache was cleared.

public bool KernelCacheCleared { get; init; }

Property Value

bool

KernelsCacheCleared

Gets the number of kernel compilations cleared from cache.

public int KernelsCacheCleared { get; init; }

Property Value

int

MemoryFreedBytes

Gets the amount of memory freed during reset (in bytes).

public long MemoryFreedBytes { get; init; }

Property Value

long

MemoryPoolCleared

Gets whether the memory pool was cleared.

public bool MemoryPoolCleared { get; init; }

Property Value

bool

PendingOperationsCleared

Gets the number of pending operations that were cancelled/completed.

public long PendingOperationsCleared { get; init; }

Property Value

long

ResetType

Gets the type of reset that was performed.

public required ResetType ResetType { get; init; }

Property Value

ResetType

StatusMessage

Gets a human-readable status message describing the reset result.

public string StatusMessage { get; }

Property Value

string

Success

Gets whether the reset operation succeeded.

public required bool Success { get; init; }

Property Value

bool

Timestamp

Gets the timestamp when reset was initiated.

public required DateTimeOffset Timestamp { get; init; }

Property Value

DateTimeOffset

WasReinitialized

Gets whether the device was reinitialized after reset.

public bool WasReinitialized { get; init; }

Property Value

bool

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

deviceId string
deviceName string
backendType string
resetType ResetType
timestamp DateTimeOffset
duration TimeSpan
errorMessage string
exception Exception
diagnosticInfo IReadOnlyDictionary<string, string>

Returns

ResetResult

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

deviceId string
deviceName string
backendType string
resetType ResetType
timestamp DateTimeOffset
duration TimeSpan
wasReinitialized bool
pendingOperationsCleared long
memoryFreedBytes long
kernelsCacheCleared int
memoryPoolCleared bool
kernelCacheCleared bool
diagnosticInfo IReadOnlyDictionary<string, string>

Returns

ResetResult

ToString()

Returns a string representation of the reset result.

public override string ToString()

Returns

string