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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//! Runtime-API initialization helpers.
//!
//! The CUDA Runtime API initializes lazily on first use (typically when you
//! call `cudaSetDevice`), so there's no explicit `init()` you _must_ call.
//! The helpers here exist for fail-fast setup: version queries, `cudaInitDevice`
//! for pre-warming the primary context without making it current, etc.
use runtime;
use CudaVersion;
use crate;
/// CUDA Runtime version linked via `libcudart`.
/// CUDA driver version (latest supported by the installed `libcuda`).
/// Block the calling host thread until all work on the current device has
/// completed. Equivalent to `cudaDeviceSynchronize`.
/// Retrieve and clear the per-thread "sticky" error from the runtime.
///
/// This is how the Runtime API reports async kernel failures — failed
/// launches are latched into a thread-local slot that persists across
/// unrelated calls until this function (or `cudaPeekAtLastError`) reads it.
/// As [`last_error`] but doesn't clear the sticky slot.
/// Set the process's device-level scheduling/map flags. Typically called
/// before the first CUDA call on the current thread — the flags bind
/// when the primary context is created. Passes are flags from
/// [`baracuda_cuda_sys::runtime::types::cudaDeviceScheduleFlags`].
/// Query current device-scheduling flags.