1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! CUDA runtime version queries.
use CudaVersion;
use runtime;
use crate::;
/// Returns the version of the loaded CUDA Runtime.
///
/// As of CUDA 12.0, this no longer initializes CUDA.
/// The purpose of this call is solely to return a compile-time constant stating the CUDA Toolkit version.
///
/// This may also return [`crate::error::Status::NotInitialized`], [`crate::error::Status::CallRequiresNewerDriver`], or [`crate::error::Status::NoDevice`] if the call tries to initialize internal CUDA Runtime state.
///
/// No CUDA function may be called from a [`Stream::add_callback`](crate::stream::Stream::add_callback) callback.
/// [`crate::error::Status::NotPermitted`] may be returned as a diagnostic in that case, but this is not guaranteed.
///
/// # Errors
///
/// Returns an error if CUDA Runtime cannot report its version, if a previous asynchronous launch failed, if CUDA Runtime reports initialization or driver/device availability errors, or if the version is negative.