Skip to content
class

Tracer

Tracer

Thread-local op recorder consumed by OpScopeFull.

Constructing a Tracer is cheap — the underlying TraceGraph starts empty. Hooks fire only between set_current_tracer (this) and set_current_tracer (nullptr); outside that window the tracer accumulates nothing.

Attributes

The recorded op DAG. Appended to by on_op_enter and exposed read-only via graph.

Notes

Non-copyable, non-movable — the active-tracer slot is a raw pointer owned by the caller; copying or moving the Tracer would either invalidate that pointer or duplicate the recording sink.

Examples

Native usage (Python binding mirrors this)::
    Tracer t;
    set_current_tracer(&t);
    // ... run a forward pass — every OpScopeFull ctor records ...
    set_current_tracer(nullptr);
    const auto& g = t.graph();  // inspect recorded nodes

Constructors

1
ctor

Tracer

void Tracer()

Construct an empty Tracer ready to be installed via set_current_tracer.

Defaulted; graph_ starts empty and impl_to_id_ starts with no entries. No op hooks fire until the tracer is installed as the active TLS sink — construction itself has zero side effects.

Operators

1
op

operator=

Tracer & operator=(const Tracer &)

Methods

35