Crate nvtx

source ·
Expand description

A safe rust FFI binding for the NVIDIA® Tools Extension SDK (NVTX).
NVTX API doxygen documentation by NVIDIA® can be found here.

Examples

use nvtx::{range_pop, range_push};
range_push!("Hello World!");
// <-- Expensive algorithm here
range_pop!();
use nvtx::range;
let range = range!("Hello World!");
// <-- Expensive algorithm here
drop(range);
use nvtx::{mark};
mark!("Operation A");
// <-- Expensive algorithm here
mark!("Operation B");
// <-- Expensive algorithm here
use std::thread;
use nvtx::{name_thread};
name_thread!("Thread 1");
let handler = thread::spawn(|| {
   name_thread!("Thread 2");
});
handler.join().unwrap();

Macros

  • Marks an instantaneous event in the application.
  • Annotate an OS thread with a name.
  • Starts a range, returning a guard that will end the range when it is dropped.
  • Ends a range that can occur on a different thread than the start.
  • Ends a nested thread range.
  • Starts a nested thread range.
  • Starts a range that can occur on a different thread than the end.

Structs

  • A guard object representing an open NVTX range. Construct it using the range! macro. When it goes out of scope it will call range_end!.