pub struct CompilationTracer { /* private fields */ }Expand description
Compilation tracer that can be enabled/disabled.
Use this to instrument compilation with tracing:
ⓘ
let mut tracer = CompilationTracer::new(true); // enabled
tracer.start(&expr);
// During compilation:
tracer.record_step("Parse", "Parsed expression", &ctx, &graph);
tracer.record_step("Optimize", "Applied CSE", &ctx, &graph);
let trace = tracer.finish(&graph);
trace.print_summary();Implementations§
Source§impl CompilationTracer
impl CompilationTracer
Sourcepub fn record_step(
&mut self,
phase: impl Into<String>,
description: impl Into<String>,
ctx: &CompilerContext,
graph: &EinsumGraph,
)
pub fn record_step( &mut self, phase: impl Into<String>, description: impl Into<String>, ctx: &CompilerContext, graph: &EinsumGraph, )
Record a compilation step.
Sourcepub fn record_error(&mut self, error: impl Into<String>)
pub fn record_error(&mut self, error: impl Into<String>)
Record an error.
Sourcepub fn finish(&mut self, graph: &EinsumGraph) -> Option<CompilationTrace>
pub fn finish(&mut self, graph: &EinsumGraph) -> Option<CompilationTrace>
Finish tracing and return the trace.
Auto Trait Implementations§
impl Freeze for CompilationTracer
impl RefUnwindSafe for CompilationTracer
impl Send for CompilationTracer
impl Sync for CompilationTracer
impl Unpin for CompilationTracer
impl UnwindSafe for CompilationTracer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more