|
Mila
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. | |
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.