Mila
Deep Neural Network Library
Loading...
Searching...
No Matches
Mila::Dnn::Compute::ComputeDevice Class Referenceabstractexport

Abstract interface for compute devices (CPU, CUDA, etc.). More...

Inheritance diagram for Mila::Dnn::Compute::ComputeDevice:

Public Member Functions

virtual ~ComputeDevice ()=default
 Virtual destructor.
 
virtual constexpr DeviceType getDeviceType () const =0
 Gets the device type of this compute device.
 
virtual std::string getName () const =0
 Gets the name of this compute device.
 

Detailed Description

Abstract interface for compute devices (CPU, CUDA, etc.).

The ComputeDevice class defines a common interface for different types of compute devices that can be used for tensor operations and neural network computations. Each device implementation (CPU, CUDA) inherits from this class and provides specific implementations of the virtual methods.

Devices are registered with the DeviceRegistry to allow runtime discovery and selection of available compute devices.

See also
DeviceType
CpuDevice
DeviceRegistry

Constructor & Destructor Documentation

◆ ~ComputeDevice()

virtual Mila::Dnn::Compute::ComputeDevice::~ComputeDevice ( )
virtualdefault

Virtual destructor.

Ensures proper cleanup of derived device classes.

Member Function Documentation

◆ getDeviceType()

virtual constexpr DeviceType Mila::Dnn::Compute::ComputeDevice::getDeviceType ( ) const
constexprpure virtual

Gets the device type of this compute device.

Returns
DeviceType The type of the device (CPU, CUDA, etc.).

Implemented in Mila::Dnn::Compute::CpuDevice, and Mila::Dnn::Compute::CudaDevice.

◆ getName()

virtual std::string Mila::Dnn::Compute::ComputeDevice::getName ( ) const
pure virtual

Gets the name of this compute device.

Returns
std::string The human-readable name of the device (e.g., "CPU", "NVIDIA RTX 3090").

Implemented in Mila::Dnn::Compute::CpuDevice, and Mila::Dnn::Compute::CudaDevice.


The documentation for this class was generated from the following file: