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
use crate;
/// Calls [profiler_start()] in [Profiler::new()], and [profiler_stop()] in [Drop].
;
/// Enables profile collection by the active profiling tool for the current context. If profiling is already enabled, then profiler_start() has no effect.
/// More info in [Cuda docs](https://docs.nvidia.com/cuda/profiler-users-guide/)
/// For RAII version see [`Profiler::new`].
/// ```no_run
/// use cudarc::driver::{profiler_start, profiler_stop};
/// # use cudarc::driver::result;
///
/// # fn run() -> Result<(), result::DriverError>{
/// profiler_start()?;
/// // Hotpath
/// profiler_stop()?;
/// # Ok(())
/// # }
/// // Now check your results
/// // nsys profile -c cudaProfilerApi /path/to/bin
/// // And this will profile only the hotpath.
/// ```
///
/// Disables profile collection by the active profiling tool for the current context. If profiling is already disabled, then profiler_stop() has no effect.