Class DeviceBroker
Device benchmarking methods for performance measurement
public sealed class DeviceBroker : IDisposable
- Inheritance
-
DeviceBroker
- Implements
- Inherited Members
Constructors
DeviceBroker(ILogger<DeviceBroker>, IOptions<GpuBridgeOptions>)
Initializes a new instance of the DeviceBroker class
public DeviceBroker(ILogger<DeviceBroker> logger, IOptions<GpuBridgeOptions> options)
Parameters
loggerILogger<DeviceBroker>Logger instance for diagnostics
optionsIOptions<GpuBridgeOptions>GPU bridge configuration options
Properties
CurrentQueueDepth
Gets the current queue depth across all devices
public int CurrentQueueDepth { get; }
Property Value
DeviceCount
Gets the total number of available devices
public int DeviceCount { get; }
Property Value
TotalMemoryBytes
Gets the total memory across all devices in bytes
public long TotalMemoryBytes { get; }
Property Value
Methods
Dispose()
Disposes the device broker and releases all resources
public void Dispose()
GetBestDevice()
Gets the best available GPU device based on current load and capabilities
public GpuDevice? GetBestDevice()
Returns
- GpuDevice
The best GPU device, or null if none available
GetDevice(int)
Gets a specific GPU device by index
public GpuDevice? GetDevice(int index)
Parameters
indexintDevice index
Returns
- GpuDevice
The GPU device, or null if not found
GetDevices()
Gets all available GPU devices
public IReadOnlyList<GpuDevice> GetDevices()
Returns
- IReadOnlyList<GpuDevice>
A read-only list of GPU devices
InitializeAsync(CancellationToken)
Initializes the device broker and detects available GPUs
public Task InitializeAsync(CancellationToken ct)
Parameters
ctCancellationTokenCancellation token
Returns
ShutdownAsync(CancellationToken)
Shuts down the device broker and stops all work queues
public Task ShutdownAsync(CancellationToken ct)
Parameters
ctCancellationTokenCancellation token