Class CudaDeviceManager
- Namespace
- DotCompute.Backends.CUDA.DeviceManagement
- Assembly
- DotCompute.Backends.CUDA.dll
Production-grade CUDA device manager with comprehensive device enumeration, capability detection, multi-GPU coordination, and P2P support.
public sealed class CudaDeviceManager : IDisposable
- Inheritance
-
CudaDeviceManager
- Implements
- Inherited Members
- Extension Methods
Constructors
CudaDeviceManager(ILogger<CudaDeviceManager>)
Initializes a new instance of the CudaDeviceManager class.
public CudaDeviceManager(ILogger<CudaDeviceManager> logger)
Parameters
loggerILogger<CudaDeviceManager>The logger.
Exceptions
- ArgumentNullException
logger
Properties
CurrentDevice
Gets or sets the current device for CUDA operations.
public int CurrentDevice { get; set; }
Property Value
DeviceCount
Gets the number of available CUDA devices.
public int DeviceCount { get; }
Property Value
Devices
Gets information about all available devices.
public IReadOnlyList<CudaDeviceInfo> Devices { get; }
Property Value
Methods
CanAccessPeer(int, int)
Checks if P2P access is available between two devices.
public bool CanAccessPeer(int fromDevice, int toDevice)
Parameters
Returns
DisablePeerAccess(int, int)
Disables P2P access between two devices.
public void DisablePeerAccess(int fromDevice, int toDevice)
Parameters
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
EnablePeerAccess(int, int)
Enables P2P access between two devices if available.
public void EnablePeerAccess(int fromDevice, int toDevice)
Parameters
GetDevice(int)
Gets device information by ID.
public CudaDeviceInfo GetDevice(int deviceId)
Parameters
deviceIdint
Returns
ResetAllDevices()
Resets all devices.
public void ResetAllDevices()
SelectBestDevice(DeviceSelectionCriteria)
Selects the best device based on criteria.
public int SelectBestDevice(DeviceSelectionCriteria criteria)
Parameters
criteriaDeviceSelectionCriteria
Returns
SetDevice(int)
Sets the current CUDA device for operations.
public void SetDevice(int deviceId)
Parameters
deviceIdint
SynchronizeAllDevices()
Synchronizes all devices.
public void SynchronizeAllDevices()