Class MetalPerformanceProfiler
- Namespace
- DotCompute.Backends.Metal.Utilities
- Assembly
- DotCompute.Backends.Metal.dll
Provides performance profiling capabilities for Metal operations.
public sealed class MetalPerformanceProfiler : IDisposable
- Inheritance
-
MetalPerformanceProfiler
- Implements
- Inherited Members
- Extension Methods
Remarks
Initializes a new instance of the MetalPerformanceProfiler.
Constructors
MetalPerformanceProfiler(ILogger<MetalPerformanceProfiler>)
Provides performance profiling capabilities for Metal operations.
public MetalPerformanceProfiler(ILogger<MetalPerformanceProfiler> logger)
Parameters
loggerILogger<MetalPerformanceProfiler>Logger for diagnostics.
Remarks
Initializes a new instance of the MetalPerformanceProfiler.
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
GenerateReport()
Generates a performance report.
public string GenerateReport()
Returns
- string
A formatted performance report.
GetAllMetrics()
Gets all performance metrics.
public Dictionary<string, MetalOperationMetrics> GetAllMetrics()
Returns
- Dictionary<string, MetalOperationMetrics>
Dictionary of operation names to metrics.
GetMetrics(string)
Gets performance metrics for a specific operation.
public MetalOperationMetrics? GetMetrics(string operationName)
Parameters
operationNamestringName of the operation.
Returns
- MetalOperationMetrics
Performance metrics or null if not found.
Profile(string)
Starts profiling an operation.
public IDisposable Profile(string operationName)
Parameters
operationNamestringName of the operation being profiled.
Returns
- IDisposable
A disposable profiling session.
RecordOperation(string, TimeSpan, bool)
Records the completion of an operation.
public void RecordOperation(string operationName, TimeSpan elapsed, bool success = true)
Parameters
operationNamestringName of the operation.
elapsedTimeSpanTime taken for the operation.
successboolWhether the operation was successful.
Reset()
Resets all performance metrics.
public void Reset()