Wrappers for Runtime API functions involving versions - of the CUDA runtime and of the CUDA driver.
More...
#include "error.hpp"
#include <ostream>
#include <utility>
Go to the source code of this file.
|
| cuda |
| All definitions and functionality wrapping the CUDA Runtime API.
|
|
|
using | cuda::combined_version_t = int |
|
Wrappers for Runtime API functions involving versions - of the CUDA runtime and of the CUDA driver.
Also defines a cuda::version_t class for working with such versions (as they are not really single numbers) - which is what the wrappers return.
◆ driver()
version_t cuda::version_numbers::driver |
( |
| ) |
|
|
inline |
Obtains the maximum version of the CUDA Runtime supported by the driver currently loaded by the operating system.
- Todo:
- In future CUDA versions which support C++17 - return an optional
- Returns
- If an nVIDIA GPU driver is installed on this system, the maximum CUDA version it supports is returned. If no version is supported, version_numbers::none() is returned.
◆ make() [1/2]
version_t cuda::version_numbers::make |
( |
combined_version_t |
combined_version | ) |
|
|
inlinenoexcept |
Convert an integer representing a major and minor number (e.g.
55 for major version 5, minor version 5) into the version type we use (version_t).
◆ make() [2/2]
version_t cuda::version_numbers::make |
( |
int |
major, |
|
|
int |
minor |
|
) |
| |
|
inlinenoexcept |
Convert a pair integer representing a major and minor number (e.g.
5 and 5) into the version type we use (version_t).
◆ none()
constexpr version_t cuda::version_numbers::none |
( |
| ) |
|
|
noexcept |
This "value" is what the Runtime API returns if no version is supported by the driver.
- Note
- this is super-ugly, I'd rather n ot use it at all
◆ runtime()
version_t cuda::version_numbers::runtime |
( |
| ) |
|
|
inline |
Obtains the CUDA Runtime version.
- Note
- unlike {driver()}, the value of none() cannot be returned, as we are actually using the runtime to obtain the version.