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

CUDA utility functions for device management and kernel execution. More...

#include <cuda_runtime.h>
#include <cstdint>
#include <stdexcept>
import Cuda.Error;

Namespaces

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

Functions

constexpr int Mila::Dnn::Compute::ceil_div (int M, int N)
 Calculates ceiling division for kernel grid/block dimensions.
 
int Mila::Dnn::Compute::checkDevice (int deviceId)
 Validates that a device ID is valid and available.
 
int Mila::Dnn::Compute::findCudaDevice (int deviceId=-1, bool preferMemory=false)
 Finds the most appropriate CUDA device for computation.
 
int Mila::Dnn::Compute::getBestDeviceId (bool preferMemory=false)
 Identifies the best CUDA device based on performance characteristics.
 
int Mila::Dnn::Compute::getDeviceCount ()
 Gets the number of available CUDA devices.
 
int Mila::Dnn::Compute::getDriverVersion ()
 Gets the installed CUDA driver version.
 
int Mila::Dnn::Compute::getRuntimeVersion ()
 Gets the installed CUDA runtime version.
 

Detailed Description

CUDA utility functions for device management and kernel execution.

Provides helper functions for CUDA device discovery, selection, and kernel execution optimization. These utilities simplify working with CUDA devices and provide consistent error handling.