singe-cupti
Safe Rust wrappers for NVIDIA CUPTI profiling, activity tracing, callbacks, events, and metrics.
Examples
use ;
let context = create?;
context.bind?;
let _activity_callbacks = register_callbacks?;
enable?;
flush_all?;
Safe Rust wrappers for NVIDIA CUPTI profiling, activity tracing, callbacks, events, and metrics.
use singe_cupti::{
collector::{self, ActivityBufferCallbackConfig},
context::Context,
types::{ActivityFlushFlag, ActivityKind},
};
let context = Context::create()?;
context.bind()?;
let _activity_callbacks = collector::register_callbacks(
ActivityBufferCallbackConfig::create(16 * 1024),
|buffer| {
for record in buffer.records().flatten() {
println!("activity record: {:?}", record.decode());
}
},
)?;
collector::enable(ActivityKind::Kernel)?;
collector::flush_all(ActivityFlushFlag::Forced)?;