Mila
Deep Neural Network Library
Loading...
Searching...
No Matches
DeviceHelpers.ixx File Reference

Utility functions for compute device discovery and management. More...

#include <vector>
#include <string>
import Cuda.Helpers;
import Compute.DeviceType;
import Compute.DeviceRegistry;
import Compute.DeviceContext;

Namespaces

namespace  Mila
 
namespace  Mila::Dnn
 
namespace  Mila::Dnn::Compute
 

Functions

std::string Mila::Dnn::Compute::getBestDevice (DeviceType type, bool preferMemory=false)
 Gets the best device of a specific type based on performance characteristics.
 
bool Mila::Dnn::Compute::isDeviceAvailable (const std::string &device_name)
 Checks if a specific device is available.
 
std::vector< std::string > Mila::Dnn::Compute::listDevices ()
 Lists all available compute devices.
 
std::vector< std::string > Mila::Dnn::Compute::listDevicesByType (DeviceType type)
 Lists compute devices of a specific type.
 

Detailed Description

Utility functions for compute device discovery and management.

This module provides a set of helper functions for working with compute devices in the Mila framework. It abstracts device management operations such as:

  • Discovering available compute devices in the system
  • Verifying device availability
  • Getting device information

These utilities help applications interact with heterogeneous compute environments in a device-agnostic way, making it easier to write code that can run across different device types (CPU, CUDA, etc.) without device-specific logic.

The module depends on the DeviceRegistry to enumerate devices and DeviceContext to validate device availability.