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
//! Thin wrappers over `cuProfilerStart` / `cuProfilerStop`. These tell
//! external profilers (Nsight, CUPTI) which sections of a program are
//! interesting; they do not produce output themselves.
//!
//! Wrap a region with `start()` / `stop()` around the work you want
//! profiled, or use [`section`] which drops an RAII guard:
//!
//! ```no_run
//! # fn demo() -> baracuda_driver::Result<()> {
//! let _guard = baracuda_driver::profiler::section()?;
//! // ... profiled work ...
//! # Ok(())
//! # }
//! ```
use driver;
use crate;
/// Request that the external profiler begin sampling now.
/// Request that the external profiler stop sampling now.
/// Convenience guard: starts profiling on construction, stops on drop.