Function cudarc::driver::safe::profiler_start
source ยท pub fn profiler_start() -> Result<(), DriverError>
Expand description
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
For RAII version see Profiler::new
.
use cudarc::driver::{profiler_start, profiler_stop};
profiler_start()?;
// Hotpath
profiler_stop()?;
// Now check your results
// nsys profile -c cudaProfilerApi /path/to/bin
// And this will profile only the hotpath.