pub struct DebugPtxInstrumenter { /* private fields */ }Expand description
Instruments PTX source code with debugging checks.
This instrumenter inserts additional PTX instructions for bounds checking, NaN detection, and printf buffer support. The instrumented code writes diagnostic data to a designated debug buffer that the host can read back after kernel execution.
Implementations§
Source§impl DebugPtxInstrumenter
impl DebugPtxInstrumenter
Sourcepub fn new(config: &KernelDebugConfig) -> Self
pub fn new(config: &KernelDebugConfig) -> Self
Create an instrumenter from a debug configuration.
Sourcepub fn instrument_bounds_checks(&self, ptx: &str) -> String
pub fn instrument_bounds_checks(&self, ptx: &str) -> String
Insert bounds-checking instrumentation into PTX source.
Adds setp + trap sequences after every ld.global / st.global
instruction to validate the address against the allocation size
parameter.
Sourcepub fn instrument_nan_checks(&self, ptx: &str) -> String
pub fn instrument_nan_checks(&self, ptx: &str) -> String
Insert NaN-detection instrumentation into PTX source.
After every floating-point arithmetic instruction (add.f32,
mul.f64, etc.) a testp.nan check is inserted.
Sourcepub fn instrument_printf(&self, ptx: &str) -> String
pub fn instrument_printf(&self, ptx: &str) -> String
Insert printf buffer support into PTX source.
Adds a .param .u64 __oxicuda_printf_buf to each entry and inserts
stub store sequences where // PRINTF markers appear.
Sourcepub fn strip_debug(&self, ptx: &str) -> String
pub fn strip_debug(&self, ptx: &str) -> String
Remove all OxiCUDA debug instrumentation from PTX source.