Mila
Deep Neural Network Library
|
Class representing a CUDA compute device. More...
Public Types | |
using | MANAGED_MR = CudaManagedMemoryResource |
Type alias for managed memory resource. | |
using | MR = CudaMemoryResource |
Type alias for device memory resource. | |
using | PINNED_MR = CudaPinnedMemoryResource |
Type alias for pinned memory resource. | |
Public Member Functions | |
CudaDevice (int device_id) | |
Constructs a CudaDevice with specified device ID. | |
int | getDeviceId () const |
Gets the CUDA device ID. | |
constexpr DeviceType | getDeviceType () const override |
Gets the type of this compute device. | |
std::string | getName () const override |
Gets the name of this CUDA device. | |
const DeviceProps & | getProperties () const |
Gets the properties of this CUDA device. | |
bool | isFp16Supported () |
Checks if the device supports FP16 precision. | |
bool | isFp4Supported () |
Checks if the device supports FP4 precision. | |
bool | isFp8Supported () |
Checks if the device supports FP8 precision. | |
![]() | |
virtual | ~ComputeDevice ()=default |
Virtual destructor. | |
Static Public Member Functions | |
static void | registerDevices () |
Registers all available CUDA devices with the DeviceRegistry. | |
Private Attributes | |
int | device_id_ |
The CUDA device ID. | |
DeviceProps | props_ |
Device properties. | |
Static Private Attributes | |
static bool | registered_ { false } |
Flag indicating if devices have been registered. | |
Class representing a CUDA compute device.
This class provides an interface to interact with NVIDIA CUDA-capable GPUs within the Mila framework. It handles device properties retrieval and registration in the DeviceRegistry. Device activation is managed by the DeviceContext class.
Type alias for managed memory resource.
Type alias for device memory resource.
Type alias for pinned memory resource.
|
inlineexplicit |
Constructs a CudaDevice with specified device ID.
device_id | The CUDA device ID to initialize. |
|
inline |
Gets the CUDA device ID.
|
inlineconstexproverridevirtual |
Gets the type of this compute device.
Implements Mila::Dnn::Compute::ComputeDevice.
|
inlineoverridevirtual |
Gets the name of this CUDA device.
Implements Mila::Dnn::Compute::ComputeDevice.
|
inline |
Gets the properties of this CUDA device.
|
inline |
Checks if the device supports FP16 precision.
|
inline |
Checks if the device supports FP4 precision.
|
inline |
Checks if the device supports FP8 precision.
|
inlinestatic |
Registers all available CUDA devices with the DeviceRegistry.
This method discovers all CUDA devices in the system and registers them with the DeviceRegistry for later instantiation. It performs the registration only once, even if called multiple times.
|
private |
The CUDA device ID.
|
private |
Device properties.
|
inlinestaticprivate |
Flag indicating if devices have been registered.