Skip to main content

init

Function init 

Source
pub fn init() -> Result<()>
Expand description

Initialise the NVTX subsystem from the ENV_VAR environment variable. Must be called once at runtime startup before any annotation macros fire.

The value is validated even when the nvtx Cargo feature is off. DYN_NVTX is one switch shared with the Python layer, which rejects an unrecognized value outright; if this half quietly read DYN_NVTX=maybe as “off”, the same capture would half-start and the operator would be told nothing. Rejecting it in both halves is what makes it a single switch.

Storing the flag and emitting markers remain no-ops without the feature.