Table of Contents

Class CudaErrorHandler

Namespace
DotCompute.Backends.CUDA.ErrorHandling
Assembly
DotCompute.Backends.CUDA.dll

Production-grade CUDA error handler with retry logic, graceful degradation, and comprehensive error recovery strategies.

public sealed class CudaErrorHandler : IDisposable
Inheritance
CudaErrorHandler
Implements
Inherited Members
Extension Methods

Constructors

CudaErrorHandler(ILogger<CudaErrorHandler>, ErrorRecoveryOptions?)

Initializes a new instance of the CudaErrorHandler class.

public CudaErrorHandler(ILogger<CudaErrorHandler> logger, ErrorRecoveryOptions? options = null)

Parameters

logger ILogger<CudaErrorHandler>

The logger.

options ErrorRecoveryOptions

The options.

Exceptions

ArgumentNullException

logger

Properties

IsGpuAvailable

Gets whether GPU is currently available.

public bool IsGpuAvailable { get; }

Property Value

bool

TimeSinceLastSuccess

Gets time since last successful operation.

public TimeSpan TimeSinceLastSuccess { get; }

Property Value

TimeSpan

Methods

ClearStatistics()

Clears error statistics.

public void ClearStatistics()

Dispose()

Disposes the error handler resources.

public void Dispose()

ExecuteWithRetryAsync<T>(Func<Task<T>>, string, CancellationToken)

Executes a CUDA operation with comprehensive error handling.

public Task<T> ExecuteWithRetryAsync<T>(Func<Task<T>> operation, string operationName, CancellationToken cancellationToken = default)

Parameters

operation Func<Task<T>>
operationName string
cancellationToken CancellationToken

Returns

Task<T>

Type Parameters

T