Expand description
NVTX timeline-annotation helpers for Nsight Systems profiling.
Delegates to [cudarc::nvtx] for the actual NVTX calls
§Gating (two-level)
Cargo feature nvtx | DYN_ENABLE_RUST_NVTX env | Effect |
|---|---|---|
| off (default) | any | macros compile to nothing; zero overhead |
| on | unset | one Relaxed load per site (~1 ns) |
| on | 1 / true / yes | cudarc NVTX calls (~50 ns/annotation) |
§Usage
ⓘ
let _r = dynamo_nvtx_range!("preprocess.tokenize"); // RAII — pops at scope end
dynamo_nvtx_push!("codec.encode");
dynamo_nvtx_pop!();
dynamo_nvtx_name_thread!("tokio-worker-0");§Build
cargo build --profile profiling --features nvtxRequires libnvToolsExt.so at runtime (CUDA Toolkit or NVHPC).
Structs§
- Nvtx
Range Guard - Zero-sized no-op guard used when the
nvtxfeature is off.
Functions§
- enabled
- Returns
truewhen thenvtxfeature is compiled in andDYN_ENABLE_RUST_NVTXis set. - init
- Initialise the NVTX subsystem from the
DYN_ENABLE_RUST_NVTXenvironment variable. Must be called once at runtime startup before any annotation macros fire. No-op when thenvtxCargo feature is off. - name_
current_ thread_ impl - Name the current OS thread in the Nsight Systems timeline.
No-op (compiled out) when the
nvtxfeature is off. - pop_
impl - Pop the innermost NVTX range from the calling thread’s stack.
No-op (compiled out) when the
nvtxfeature is off. - push_
impl - Push an NVTX range onto the calling thread’s stack.
No-op (compiled out) when the
nvtxfeature is off.