|
Mila 0.13.48
Deep Neural Network Library
|
Wrapper for CUDA device properties with cached values. More...
Public Member Functions | |
| CudaDeviceProps (int device_id) | |
| Constructs device properties for specified CUDA device. | |
| std::pair< int, int > | getComputeCapability () const |
| Gets compute capability as major/minor version pair. | |
| std::string | getName () const |
| Gets the device name. | |
Public Attributes | |
| int | clockRate { 0 } |
| int | l2CacheSize { 0 } |
| int | major { 0 } |
| int | maxGridSize [3] { 0, 0, 0 } |
| int | maxThreadsDim [3] { 0, 0, 0 } |
| int | maxThreadsPerBlock { 0 } |
| int | memoryBusWidth { 0 } |
| int | memoryClockRate { 0 } |
| int | minor { 0 } |
| int | multiProcessorCount { 0 } |
| std::string | name |
| int | pciBusID { 0 } |
| int | pciDeviceID { 0 } |
| int | pciDomainID { 0 } |
| size_t | sharedMemPerBlock { 0 } |
| size_t | totalGlobalMem { 0 } |
| int | warpSize { 0 } |
Private Attributes | |
| int | device_id_ { 0 } |
Wrapper for CUDA device properties with cached values.
Queries and caches CUDA device properties on construction. The underlying cudaDeviceProp struct is used only during construction as a local variable and is not retained as a member to keep this class safe to import from any module that exports a class template.
CUDA 13.0+ Compatibility:
|
inlineexplicit |
Constructs device properties for specified CUDA device.
Queries CUDA runtime for device properties and caches all needed values. For CUDA 13.0+, clock rates are queried via device attributes.
| device_id | CUDA device ID (0-based). |
| std::runtime_error | If device properties query fails. |

|
inline |
Gets compute capability as major/minor version pair.
|
inline |
Gets the device name.
| int Mila::Dnn::Compute::CudaDeviceProps::clockRate { 0 } |
|
private |
| int Mila::Dnn::Compute::CudaDeviceProps::l2CacheSize { 0 } |
| int Mila::Dnn::Compute::CudaDeviceProps::major { 0 } |
| int Mila::Dnn::Compute::CudaDeviceProps::maxGridSize[3] { 0, 0, 0 } |
| int Mila::Dnn::Compute::CudaDeviceProps::maxThreadsDim[3] { 0, 0, 0 } |
| int Mila::Dnn::Compute::CudaDeviceProps::maxThreadsPerBlock { 0 } |
| int Mila::Dnn::Compute::CudaDeviceProps::memoryBusWidth { 0 } |
| int Mila::Dnn::Compute::CudaDeviceProps::memoryClockRate { 0 } |
| int Mila::Dnn::Compute::CudaDeviceProps::minor { 0 } |
| int Mila::Dnn::Compute::CudaDeviceProps::multiProcessorCount { 0 } |
| std::string Mila::Dnn::Compute::CudaDeviceProps::name |
| int Mila::Dnn::Compute::CudaDeviceProps::pciBusID { 0 } |
| int Mila::Dnn::Compute::CudaDeviceProps::pciDeviceID { 0 } |
| int Mila::Dnn::Compute::CudaDeviceProps::pciDomainID { 0 } |
| size_t Mila::Dnn::Compute::CudaDeviceProps::sharedMemPerBlock { 0 } |
| size_t Mila::Dnn::Compute::CudaDeviceProps::totalGlobalMem { 0 } |
| int Mila::Dnn::Compute::CudaDeviceProps::warpSize { 0 } |