|
Mila
Deep Neural Network Library
|
Utility functions for compute device discovery and management. More...
#include <vector>#include <string>import Compute.DeviceType;import Compute.DeviceId;import Compute.DeviceRegistry;Namespaces | |
| namespace | Mila |
| Mila main API namespace. | |
Functions | |
| DeviceId | Mila::Dnn::Compute::getBestDevice (DeviceType type, bool preferMemory=false) |
| Gets the best DeviceId of a specific type based on performance characteristics. | |
| std::size_t | Mila::Dnn::Compute::getDeviceCount (DeviceType type) noexcept |
| Count instantiated devices of the given DeviceType. | |
| std::vector< std::string > | Mila::Dnn::Compute::listDevicesByName () |
| Lists all available compute devices by name. | |
| std::vector< std::string > | Mila::Dnn::Compute::listDevicesByType (DeviceType type) |
| Lists compute devices of a specific type. | |
Utility functions for compute device discovery and management.
Small helpers for listing and selecting devices via DeviceRegistry.
|
export |
Gets the best DeviceId of a specific type based on performance characteristics.
For CUDA the function consults Cuda::getBestDeviceId(preferMemory) and returns the matching DeviceId when available. If no device of the requested type is found the function returns a DeviceId with the requested type and index == -1 to indicate "none".
| type | The device type to filter by (e.g., DeviceType::Cuda) |
| preferMemory | When true, prioritizes memory bandwidth over compute capability |
|
exportnoexcept |
Count instantiated devices of the given DeviceType.
Lightweight, thread-safe convenience helper intended for tests and diagnostics. Non-throwing; returns 0 on error.
|
export |
Lists all available compute devices by name.
|
export |
Lists compute devices of a specific type.
| type | The device type to filter by |