Table of Contents

Class ProfilingSnapshot

Namespace
DotCompute.Abstractions.Profiling
Assembly
DotCompute.Abstractions.dll

Represents a comprehensive profiling snapshot of accelerator performance at a point in time.

public sealed class ProfilingSnapshot
Inheritance
ProfilingSnapshot
Inherited Members

Remarks

This snapshot provides detailed performance metrics for kernel execution, memory operations, and overall device utilization. It is designed for performance analysis, optimization, and runtime decision-making.

Unlike health monitoring which focuses on device availability and hardware status, profiling focuses on execution performance and resource utilization patterns.

Use Cases: - Performance benchmarking and comparison - Identifying bottlenecks in kernel execution - Memory transfer optimization - Backend selection based on workload characteristics - Real-time performance monitoring dashboards

Properties

AverageLatencyMs

Gets the average operation latency in milliseconds.

public double AverageLatencyMs { get; init; }

Property Value

double

BackendType

Gets the backend type (e.g., "CUDA", "Metal", "OpenCL", "CPU").

public required string BackendType { get; init; }

Property Value

string

DeviceId

Gets the unique identifier for the device being profiled.

public required string DeviceId { get; init; }

Property Value

string

DeviceName

Gets the friendly name of the device being profiled.

public required string DeviceName { get; init; }

Property Value

string

DeviceUtilizationPercent

Gets the overall device utilization percentage (0-100).

public double DeviceUtilizationPercent { get; init; }

Property Value

double

Remarks

Represents the fraction of time the device was actively executing work. Values near 100% indicate high utilization, values near 0% indicate idle time.

IdentifiedBottlenecks

Gets bottlenecks identified in the profiling data.

public IReadOnlyList<string> IdentifiedBottlenecks { get; init; }

Property Value

IReadOnlyList<string>

IsAvailable

Gets whether profiling data is available for this device.

public bool IsAvailable { get; init; }

Property Value

bool

KernelStats

Gets the current kernel execution statistics.

public KernelProfilingStats? KernelStats { get; init; }

Property Value

KernelProfilingStats

MemoryStats

Gets the current memory operation statistics.

public MemoryProfilingStats? MemoryStats { get; init; }

Property Value

MemoryProfilingStats

Metrics

Gets the collection of profiling metrics for this snapshot.

public IReadOnlyList<ProfilingMetric> Metrics { get; init; }

Property Value

IReadOnlyList<ProfilingMetric>

PerformanceTrends

Gets performance trends identified in recent profiling data.

public IReadOnlyList<string> PerformanceTrends { get; init; }

Property Value

IReadOnlyList<string>

Recommendations

Gets optimization recommendations based on profiling data.

public IReadOnlyList<string> Recommendations { get; init; }

Property Value

IReadOnlyList<string>

StatusMessage

Gets the profiling status message providing context about the current state.

public string StatusMessage { get; init; }

Property Value

string

ThroughputOpsPerSecond

Gets the throughput in operations per second.

public double ThroughputOpsPerSecond { get; init; }

Property Value

double

Timestamp

Gets the timestamp when this snapshot was captured.

public DateTimeOffset Timestamp { get; init; }

Property Value

DateTimeOffset

TotalOperations

Gets the total number of operations profiled since last reset.

public long TotalOperations { get; init; }

Property Value

long

Methods

CreateUnavailable(string, string, string, string)

Creates an unavailable profiling snapshot when profiling is not supported or enabled.

public static ProfilingSnapshot CreateUnavailable(string deviceId, string deviceName, string backendType, string reason)

Parameters

deviceId string

Device identifier.

deviceName string

Device name.

backendType string

Backend type.

reason string

Reason why profiling is unavailable.

Returns

ProfilingSnapshot

A profiling snapshot indicating unavailability.