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

Manages device contexts for compute operations in the Mila deep neural network framework. More...

#include <memory>
#include <string>
#include <stdexcept>
#include <mutex>
#include <cuda_runtime.h>
#include <cublasLt.h>
import Compute.DeviceType;
import Compute.DeviceRegistry;
import Compute.CudaDevice;
import Compute.ComputeDevice;

Classes

class  Mila::Dnn::Compute::DeviceContext
 The DeviceContext class manages device contexts for module and tensor computations. More...
 

Namespaces

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

Detailed Description

Manages device contexts for compute operations in the Mila deep neural network framework.

This file provides the implementation of the DeviceContext class which serves as an abstraction over different compute devices (CPU, CUDA GPUs). It facilitates device selection, resource management, and execution control for neural network operations across heterogeneous hardware platforms.

The DeviceContext class enables:

  • Automatic detection and selection of available compute devices
  • Management of device-specific resources (streams, memory)
  • CUDA stream handling for asynchronous execution
  • Thread-safe handling of device contexts and resources

This is a core component of the Mila compute infrastructure that other operations depend on for device-specific execution.