Skip to main content

LatencyProfiler Class

Per-sample latency tracker; attach to a Run to capture timing telemetry. More...

Declaration​

class simaai::neat::LatencyProfiler { ... }

Included Headers​

#include <LatencyProfiler.h>

Public Member Typedefs Index​

usingOptions = LatencyProfilerOptions

Tunable knobs for the profiler. More...

Public Constructors Index​

LatencyProfiler (Options o=Options())

Construct a profiler with the given options. More...

LatencyProfiler (const LatencyProfiler &)=delete

Deleted copy constructor; the profiler owns thread-bound state. More...

Public Destructor Index​

~LatencyProfiler ()

Destructor; detaches from any attached Run/Session. More...

Public Operators Index​

LatencyProfiler &operator= (const LatencyProfiler &)=delete

Deleted copy assignment; the profiler owns thread-bound state. More...

Public Member Functions Index​

voidattach (Run &run)

Attach to a Run (Session-level path). More...

voidattach (Session &session)

Optional: attach a Session directly. More...

voidmark_warmup_done ()

Reset all counters/event ring to mark the warmup→measured boundary. More...

ProfilerReportfinalize ()

Drain the event ring and snapshot all telemetry sources. More...

Private Member Attributes Index​

Optionsoptions_
Run *attached_run_ = nullptr
Session *attached_session_ = nullptr
boolenabled_at_attach_ = false

Public Static Functions Index​

static std::stringto_text (const ProfilerReport &report)

Render report as a human-readable text summary. More...

static std::stringto_chrome_trace (const ProfilerReport &report)

Render report as a Chrome/Perfetto trace JSON document. More...

Description​

Per-sample latency tracker; attach to a Run to capture timing telemetry.

Lifetime: construct, attach() to a Run (or Session) before pushing frames, push frames, optionally call mark_warmup_done() after the warmup window, then call finalize() to obtain a ProfilerReport. The profiler is single-owner (non-copyable) and detaches automatically on destruction.

See Also

ProfilerReport

See Also

Run

Definition at line 202 of file LatencyProfiler.h.

Public Member Typedefs​

Options​

using simaai::neat::LatencyProfiler::Options = LatencyProfilerOptions

Tunable knobs for the profiler.

Definition at line 205 of file LatencyProfiler.h.

Public Constructors​

LatencyProfiler()​

simaai::neat::LatencyProfiler::LatencyProfiler (Options o=Options())
explicit

Construct a profiler with the given options.

Definition at line 208 of file LatencyProfiler.h.

LatencyProfiler()​

simaai::neat::LatencyProfiler::LatencyProfiler (const LatencyProfiler &)
delete

Deleted copy constructor; the profiler owns thread-bound state.

Definition at line 213 of file LatencyProfiler.h.

Public Destructor​

~LatencyProfiler()​

simaai::neat::LatencyProfiler::~LatencyProfiler ()

Destructor; detaches from any attached Run/Session.

Definition at line 210 of file LatencyProfiler.h.

Public Operators​

operator=()​

LatencyProfiler& simaai::neat::LatencyProfiler::operator= (const LatencyProfiler &)
delete

Deleted copy assignment; the profiler owns thread-bound state.

Definition at line 215 of file LatencyProfiler.h.

Public Member Functions​

attach()​

void simaai::neat::LatencyProfiler::attach (Run & run)

Attach to a Run (Session-level path).

After this call, every kernel event emitted by the runtime is captured in the profiler's ring. Must be called before frames are pushed for events to be observed.

Definition at line 226 of file LatencyProfiler.h.

attach()​

void simaai::neat::LatencyProfiler::attach (Session & session)

Optional: attach a Session directly.

Reserved for V2: would let per-output frame_id stamping hook the existing tensor_callback. No-op for V1.

Definition at line 236 of file LatencyProfiler.h.

finalize()​

ProfilerReport simaai::neat::LatencyProfiler::finalize ()

Drain the event ring and snapshot all telemetry sources.

Safe to call multiple times; each call drains incremental events since the previous drain (use mark_warmup_done() to discard rather than emit).

Returns

Snapshot bundle ready for serialisation via to_text() or to_chrome_trace().

Definition at line 260 of file LatencyProfiler.h.

mark_warmup_done()​

void simaai::neat::LatencyProfiler::mark_warmup_done ()

Reset all counters/event ring to mark the warmup→measured boundary.

Call after pushing Options::warmup_frames inputs. Subsequent telemetry starts fresh from this point.

Definition at line 246 of file LatencyProfiler.h.

Private Member Attributes​

attached_run_​

Run* simaai::neat::LatencyProfiler::attached_run_ = nullptr

Definition at line 270 of file LatencyProfiler.h.

270 Run* attached_run_ = nullptr;

attached_session_​

Session* simaai::neat::LatencyProfiler::attached_session_ = nullptr

Definition at line 271 of file LatencyProfiler.h.

271 Session* attached_session_ = nullptr;

enabled_at_attach_​

bool simaai::neat::LatencyProfiler::enabled_at_attach_ = false

Definition at line 272 of file LatencyProfiler.h.

272 bool enabled_at_attach_ = false;

options_​

Options simaai::neat::LatencyProfiler::options_

Definition at line 269 of file LatencyProfiler.h.

269 Options options_;

Public Static Functions​

to_chrome_trace()​

std::string simaai::neat::LatencyProfiler::to_chrome_trace (const ProfilerReport & report)
static

Render report as a Chrome/Perfetto trace JSON document.

Definition at line 266 of file LatencyProfiler.h.

to_text()​

std::string simaai::neat::LatencyProfiler::to_text (const ProfilerReport & report)
static

Render report as a human-readable text summary.

Definition at line 264 of file LatencyProfiler.h.


The documentation for this class was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.1.