Skip to main content

Runner Class

Long-lived execution handle returned by Model::build(...). More...

Declaration

class simaai::neat::Model::Runner { ... }

Included Headers

#include <Model.h>

Public Constructors Index

Runner ()=default

Construct an empty Runner; assign from a built Runner before use. More...

Runner (simaai::neat::Run run)

Wrap a Run handle with no special tensor/ingress configuration. More...

Runner (simaai::neat::Run run, const simaai::neat::InputOptions &tensor_input_opt)

Wrap a Run handle that was built for tensor-mode input with the given InputOptions. More...

Runner (simaai::neat::Run run, const simaai::neat::InputOptions &tensor_input_opt, std::vector< std::string > ingress_names)

Wrap a Run handle with tensor input options and explicit ingress port names (multi-input models). More...

Runner (simaai::neat::Run run, std::vector< std::string > ingress_names)

Wrap a Run handle with explicit ingress port names (multi-input, non-tensor mode). More...

Public Operators Index

operator bool () const noexcept

Returns true if the underlying Run is alive and ready to push/pull. More...

Public Member Functions Index

boolpush (const simaai::neat::TensorList &inputs)

Push a list of Tensor inputs (one per ingress port). More...

boolpush (const simaai::neat::SampleList &inputs)

Push a list of Sample inputs (full Samples carry per-buffer metadata). More...

simaai::neat::SampleListpull (int timeout_ms=-1)

Pull the next produced output Sample list. More...

simaai::neat::TensorListrun (const simaai::neat::TensorList &inputs, int timeout_ms=-1)

One-shot synchronous push+pull from Tensor inputs. More...

simaai::neat::SampleListrun (const simaai::neat::SampleList &inputs, int timeout_ms=-1)

One-shot synchronous push+pull from Sample inputs. More...

simaai::neat::MeasureScopestart_measurement (const simaai::neat::MeasureOptions &opt={})

Start observing caller-owned push/pull code without consuming outputs. More...

intwarmup (const simaai::neat::TensorList &inputs, int warm=-1, int timeout_ms=-1)

Warm up the pipeline by running warm inferences before measurement begins. More...

voidclose ()

Close input (sends EOS) and release the underlying Run. More...

simaai::neat::RunStatsstats () const

End-to-end push/pull/latency stats (forwards to underlying Run). More...

simaai::neat::RunMeasurementSummarymeasurement_summary () const

Latency, throughput, input stats, and optional power telemetry (forwards to Run). More...

simaai::neat::RuntimeMetricsmetrics (const simaai::neat::RuntimeMetricsOptions &opt={}) const

Unified latency/throughput/power/counter metrics (forwards to underlying Run). More...

std::stringmetrics_report (const simaai::neat::RuntimeMetricsOptions &opt={}, simaai::neat::RuntimeMetricsFormat format=simaai::neat::RuntimeMetricsFormat::Text) const

Render unified runtime metrics (forwards to underlying Run). More...

std::stringmetrics_report (simaai::neat::RuntimeMetricsFormat format) const

Convenience overload for selecting the output format with default options. More...

simaai::neat::RunDiagSnapshotdiag_snapshot () const

Per-stage / per-element / per-pad diagnostic snapshot (forwards to underlying Run). More...

std::stringreport (const simaai::neat::RunReportOptions &opt={}) const

Human-readable formatted report of stats + diagnostics (forwards to underlying Run). More...

voidclose_input ()

Send EOS into the input queue without releasing the Run (lets pull drain in flight). More...

Private Member Attributes Index

simaai::neat::Runrun_ {}
std::optional< simaai::neat::InputOptions >tensor_input_opt_for_cv_ {}
std::vector< std::string >ingress_names_

Description

Long-lived execution handle returned by Model::build(...).

Wraps an underlying Run plus the bookkeeping needed to convert user-friendly input types (cv::Mat, TensorList, SampleList) into the right Sample shape for the model's appsrc. Use the Runner for streaming workloads; use the convenience Model::run() overloads for one-shot inference.

 sima::Model model("yolo.tar.gz");
 auto runner = model.build();
 while (have_input) {
  runner.push(next_frame);
  auto sample = runner.pull(/ * timeout_ms = * / 100);
  if (!sample.empty()) handle(sample);
 }
 runner.close();

Definition at line 429 of file Model.h.

Public Constructors

Runner()

simaai::neat::Model::Runner::Runner ()
default

Construct an empty Runner; assign from a built Runner before use.

Definition at line 432 of file Model.h.

Runner()

simaai::neat::Model::Runner::Runner (simaai::neat::Run run)
explicit

Wrap a Run handle with no special tensor/ingress configuration.

Definition at line 434 of file Model.h.

Runner()

simaai::neat::Model::Runner::Runner (simaai::neat::Run run, const simaai::neat::InputOptions & tensor_input_opt)

Wrap a Run handle that was built for tensor-mode input with the given InputOptions.

Definition at line 436 of file Model.h.

Runner()

simaai::neat::Model::Runner::Runner (simaai::neat::Run run, const simaai::neat::InputOptions & tensor_input_opt, std::vector< std::string > ingress_names)

Wrap a Run handle with tensor input options and explicit ingress port names (multi-input models).

Definition at line 439 of file Model.h.

Runner()

simaai::neat::Model::Runner::Runner (simaai::neat::Run run, std::vector< std::string > ingress_names)

Wrap a Run handle with explicit ingress port names (multi-input, non-tensor mode).

Definition at line 442 of file Model.h.

Public Operators

operator bool()

simaai::neat::Model::Runner::operator bool ()
explicit noexcept

Returns true if the underlying Run is alive and ready to push/pull.

Definition at line 445 of file Model.h.

Public Member Functions

close()

void simaai::neat::Model::Runner::close ()

Close input (sends EOS) and release the underlying Run.

Definition at line 483 of file Model.h.

close_input()

void simaai::neat::Model::Runner::close_input ()

Send EOS into the input queue without releasing the Run (lets pull drain in flight).

Definition at line 501 of file Model.h.

diag_snapshot()

simaai::neat::RunDiagSnapshot simaai::neat::Model::Runner::diag_snapshot ()

Per-stage / per-element / per-pad diagnostic snapshot (forwards to underlying Run).

Definition at line 497 of file Model.h.

measurement_summary()

simaai::neat::RunMeasurementSummary simaai::neat::Model::Runner::measurement_summary ()

Latency, throughput, input stats, and optional power telemetry (forwards to Run).

Definition at line 487 of file Model.h.

metrics()

simaai::neat::RuntimeMetrics simaai::neat::Model::Runner::metrics (const simaai::neat::RuntimeMetricsOptions & opt={})

Unified latency/throughput/power/counter metrics (forwards to underlying Run).

Definition at line 489 of file Model.h.

metrics_report()

std::string simaai::neat::Model::Runner::metrics_report (const simaai::neat::RuntimeMetricsOptions & opt={}, simaai::neat::RuntimeMetricsFormat format=simaai::neat::RuntimeMetricsFormat::Text)

Render unified runtime metrics (forwards to underlying Run).

Definition at line 491 of file Model.h.

metrics_report()

std::string simaai::neat::Model::Runner::metrics_report (simaai::neat::RuntimeMetricsFormat format)

Convenience overload for selecting the output format with default options.

Definition at line 495 of file Model.h.

pull()

simaai::neat::SampleList simaai::neat::Model::Runner::pull (int timeout_ms=-1)

Pull the next produced output Sample list.

Parameters
timeout_ms

Maximum time to wait, in milliseconds; -1 means wait forever; 0 is non-blocking.

Returns

The next SampleList. Empty if the timeout elapsed or the pipeline closed.

Definition at line 463 of file Model.h.

push()

bool simaai::neat::Model::Runner::push (const simaai::neat::TensorList & inputs)

Push a list of Tensor inputs (one per ingress port).

Definition at line 454 of file Model.h.

push()

bool simaai::neat::Model::Runner::push (const simaai::neat::SampleList & inputs)

Push a list of Sample inputs (full Samples carry per-buffer metadata).

Definition at line 456 of file Model.h.

report()

std::string simaai::neat::Model::Runner::report (const simaai::neat::RunReportOptions & opt={})

Human-readable formatted report of stats + diagnostics (forwards to underlying Run).

Definition at line 499 of file Model.h.

run()

simaai::neat::TensorList simaai::neat::Model::Runner::run (const simaai::neat::TensorList & inputs, int timeout_ms=-1)

One-shot synchronous push+pull from Tensor inputs.

Definition at line 469 of file Model.h.

run()

simaai::neat::SampleList simaai::neat::Model::Runner::run (const simaai::neat::SampleList & inputs, int timeout_ms=-1)

One-shot synchronous push+pull from Sample inputs.

Definition at line 471 of file Model.h.

start_measurement()

simaai::neat::MeasureScope simaai::neat::Model::Runner::start_measurement (const simaai::neat::MeasureOptions & opt={})

Start observing caller-owned push/pull code without consuming outputs.

Definition at line 474 of file Model.h.

stats()

simaai::neat::RunStats simaai::neat::Model::Runner::stats ()

End-to-end push/pull/latency stats (forwards to underlying Run).

Definition at line 485 of file Model.h.

warmup()

int simaai::neat::Model::Runner::warmup (const simaai::neat::TensorList & inputs, int warm=-1, int timeout_ms=-1)

Warm up the pipeline by running warm inferences before measurement begins.

Useful for stable performance numbers — the first few inferences pay one-time setup costs (kernel load, JIT compilation, cache fill). Pass warm = -1 to use a sensible default.

Definition at line 481 of file Model.h.

Private Member Attributes

ingress_names_

std::vector<std::string> simaai::neat::Model::Runner::ingress_names_

Definition at line 506 of file Model.h.

506 std::vector<std::string> ingress_names_;

run_

simaai::neat::Run simaai::neat::Model::Runner::run_ {}

Definition at line 504 of file Model.h.

504 simaai::neat::Run run_{};

tensor_input_opt_for_cv_

std::optional<simaai::neat::InputOptions> simaai::neat::Model::Runner::tensor_input_opt_for_cv_ {}

Definition at line 505 of file Model.h.

505 std::optional<simaai::neat::InputOptions> tensor_input_opt_for_cv_{};

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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.