Skip to main content

Module debug

Module debug 

Source
Expand description

Kernel debugging utilities for OxiCUDA.

This module provides tools for debugging GPU kernels without traditional debuggers. It includes memory checking, NaN/Inf detection, printf emulation, assertion support, and PTX instrumentation for automated bounds/NaN checking.

§Architecture

The debugging system is layered:

  1. KernelDebugger — Top-level manager that creates debug sessions and manages breakpoints / watchpoints.
  2. DebugSession — Collects DebugEvents for a single kernel launch.
  3. MemoryChecker — Validates memory accesses against known allocations.
  4. NanInfChecker — Scans host-side buffers for NaN / Inf values.
  5. PrintfBuffer — Parses a raw byte buffer that emulates GPU printf.
  6. KernelAssertions — Convenience assertion helpers that produce DebugEvents instead of panicking.
  7. DebugPtxInstrumenter — Instruments PTX source for automated bounds/NaN checking and printf support.

§Example

use oxicuda_driver::debug::*;

let config = KernelDebugConfig::default();
let mut debugger = KernelDebugger::new(config);
let session = debugger.attach("my_kernel").unwrap();
assert_eq!(session.kernel_name(), "my_kernel");

Structs§

DebugEvent
A single debug event captured during kernel execution.
DebugPtxInstrumenter
Instruments PTX source code with debugging checks.
DebugSession
An active debug session for a single kernel launch.
DebugSummary
Aggregate statistics for a debug session.
KernelAssertions
Convenience assertion helpers that produce DebugEvents instead of panicking, suitable for GPU kernel emulation / validation.
KernelDebugConfig
Configuration for a kernel debug session.
KernelDebugger
Top-level kernel debugging manager.
MemoryChecker
Validates memory accesses against a set of known MemoryRegions.
MemoryRegion
A contiguous GPU memory allocation known to the memory checker.
NanInfChecker
Scans host-side buffers for NaN and Inf values.
NanInfLocation
Location of a NaN or Inf value found in a buffer.
PrintfBuffer
GPU-side printf emulation buffer.
PrintfEntry
A parsed GPU-side printf entry.

Enums§

DebugEventType
The kind of debug event captured during kernel execution.
DebugLevel
Verbosity level for kernel debugging output.
PrintfArg
A single argument captured from a GPU printf call.
WatchType
The kind of memory access a watchpoint monitors.