Skip to main content

Module trace

Module trace 

Source
Expand description

Launch telemetry / tracing integration.

This module provides the kernel_launch_span! macro that emits a tracing instrumentation span around every kernel launch when the tracing Cargo feature is enabled. When the feature is disabled the macro expands to a unit expression () with zero overhead.

§Feature gate

Add tracing to the features in Cargo.toml to enable live spans:

[dependencies]
oxicuda-launch = { version = "*", features = ["tracing"] }

§Span fields

When enabled, each span carries:

FieldTypeDescription
kernel&strFunction name as passed to Kernel::new
gridDebugGrid dimensions (x, y, z)
blockDebugBlock dimensions (x, y, z)

§Example (with tracing enabled)

use oxicuda_launch::trace::kernel_launch_span;

let _span = kernel_launch_span!("my_kernel", (4u32, 1u32, 1u32), (256u32, 1u32, 1u32));
// The span is entered while `_span` is in scope.

Macros§

kernel_launch_span
No-op version used when the tracing feature is disabled.

Structs§

KernelSpanGuard
RAII guard that enters a kernel-launch tracing span and exits on drop.