|
Mila
Deep Neural Network Library
|
Device type definitions and conversion utilities for compute devices. More...
#include <stdexcept>#include <algorithm>#include <string>#include <cctype>#include <string_view>#include <format>Namespaces | |
| namespace | Mila |
| Mila main API namespace. | |
Enumerations | |
| enum class | Mila::Dnn::Compute::DeviceType { Cpu , Cuda , Metal , Rocm } |
| Enumeration of supported compute device types. More... | |
Functions | |
| std::string | Mila::Dnn::Compute::deviceTypeToString (DeviceType device_type) |
| Converts a DeviceType to its string representation. | |
| DeviceType | Mila::Dnn::Compute::toDeviceType (std::string_view device_type) |
| Converts a string to the corresponding DeviceType. | |
Device type definitions and conversion utilities for compute devices.
|
exportstrong |
|
export |
Converts a DeviceType to its string representation.
| device_type | The device type to convert. |
| std::invalid_argument | If the device type is invalid. |
|
export |
Converts a string to the corresponding DeviceType.
Performs case-insensitive matching to convert device type strings to the corresponding enum value.
| device_type | The string representation of the device type. |
| std::invalid_argument | If the string does not represent a valid device type. Valid options are: Device::Cpu(), "CUDA", "AUTO". |