Run Class
Live pipeline handle: push inputs in, pull outputs out. More...
Declaration
Included Headers
Friends Index
| class | MeasureScope |
| class | Session |
Public Constructors Index
| Run ()=default | |
|
Construct an empty Run; assign from Session::build() before use. More... | |
| Run (const Run &)=delete | |
|
Non-copyable. More... | |
| Run (Run &&) noexcept | |
|
Move-constructible. More... | |
Private Constructors Index
| Run (std::shared_ptr< State > state) | |
Public Destructor Index
| ~Run () | |
|
Cleanly tears down the pipeline. More... | |
Public Operators Index
| Run & | operator= (const Run &)=delete |
|
Non-copyable. More... | |
| Run & | operator= (Run &&) noexcept |
|
Move-assignable. More... | |
| operator bool () const noexcept | |
|
Returns true if the Run is alive (constructed by Session::build, not yet stopped). More... | |
Public Member Functions Index
| bool | can_push () const |
|
Returns true if the input side accepts pushes (not closed). More... | |
| bool | can_pull () const |
|
Returns true if the output side may produce more samples (pipeline not at EOS). More... | |
| bool | running () const |
|
Returns true if the pipeline is in PLAYING state. More... | |
| bool | push (const std::vector< cv::Mat > &inputs) |
|
Push cv::Mat inputs into the pipeline. More... | |
| bool | try_push (const std::vector< cv::Mat > &inputs) |
|
Non-blocking variant of push; returns false immediately if the queue is full. More... | |
| bool | push (const TensorList &inputs) |
| bool | try_push (const TensorList &inputs) |
|
Non-blocking variant. More... | |
| bool | push (const SampleList &msgs) |
|
Push full Sample inputs (carrying per-buffer metadata). More... | |
| bool | try_push (const SampleList &msgs) |
|
Non-blocking variant. More... | |
| bool | push_holder (const std::shared_ptr< void > &holder) |
|
Internal: pushes a GstBuffer held by a tensor ref to preserve plugin metadata. More... | |
| bool | try_push_holder (const std::shared_ptr< void > &holder) |
|
Non-blocking variant of push_holder. More... | |
| void | close_input () |
|
Send EOS into the pipeline. More... | |
| PullStatus | pull (int timeout_ms, Sample &out, PullError *err=nullptr) |
|
Pull the next output sample with a structured status return. More... | |
| std::optional< Sample > | pull (int timeout_ms=-1) |
|
Convenience pull returning an optional Sample (empty on timeout/closed/error). More... | |
| TensorList | pull_tensors (int timeout_ms=-1) |
|
Pull and unpack the next sample as a TensorList. More... | |
| SampleList | pull_samples (int timeout_ms=-1) |
|
Pull the next sample as a SampleList (preserves per-sample metadata). More... | |
| TensorList | run (const std::vector< cv::Mat > &inputs, int timeout_ms=-1) |
|
One-shot synchronous push+pull from cv::Mat inputs. More... | |
| TensorList | run (const TensorList &inputs, int timeout_ms=-1) |
| SampleList | run (const SampleList &inputs, int timeout_ms=-1) |
| MeasureScope | start_measurement (const MeasureOptions &opt={}) |
|
Start observing a caller-owned push/pull interval without consuming outputs. More... | |
| int | warmup (const std::vector< cv::Mat > &inputs, int warm=-1, int timeout_ms=-1) |
|
Run warm warm-up inferences before measurement begins. More... | |
| RunStats | stats () const |
|
Returns end-to-end push/pull/latency stats. More... | |
| InputStreamStats | input_stats () const |
|
Returns input-side telemetry (push counts, drops, timing). More... | |
| RunDiagSnapshot | diag_snapshot () const |
|
Returns the full diagnostic snapshot (per-stage, per-element, per-pad). More... | |
| PowerSummary | power_summary () const |
|
Returns the optional SOM power telemetry summary for this Run. More... | |
| RunMeasurementSummary | measurement_summary () const |
|
Returns latency, throughput, input stats, and optional power telemetry in one call. More... | |
| RuntimeMetrics | metrics (const RuntimeMetricsOptions &opt={}) const |
|
Returns the preferred unified runtime metrics surface. More... | |
| std::string | metrics_report (const RuntimeMetricsOptions &opt={}, RuntimeMetricsFormat format=RuntimeMetricsFormat::Text) const |
|
Render unified runtime metrics in the requested format. More... | |
| std::string | metrics_report (RuntimeMetricsFormat format) const |
|
Convenience overload for selecting the output format with default options. More... | |
| std::string | report (const RunReportOptions &opt={}) const |
|
Returns a human-readable formatted report combining stats and diagnostics. More... | |
| std::string | last_error () const |
|
Returns the most recent runtime error string (empty if no error occurred). More... | |
| std::string | diagnostics_summary () const |
|
Returns a short diagnostics summary suitable for logging or error reports. More... | |
| void | stop () |
|
Stop the pipeline immediately (transitions to NULL). After stop, the Run is no longer running. More... | |
| void | close () |
Private Member Functions Index
| void | require_async_mode (const char *where) const |
| void | require_async_pull_mode (const char *where) const |
| void | enqueue_run_images (const std::vector< cv::Mat > &inputs) |
| void | enqueue_run_tensors (const TensorList &inputs) |
| void | enqueue_run_samples (const SampleList &inputs) |
| TensorList | pull_tensors_strict (int timeout_ms) |
| SampleList | pull_samples_strict (int timeout_ms) |
| bool | push_impl (const cv::Mat &input, bool block) |
| bool | push_impl (const simaai::neat::Tensor &input, bool block) |
| bool | push_holder_impl (const std::shared_ptr< void > &holder, bool block) |
| bool | push_message_impl (const Sample &msg, bool block) |
| bool | push_sample_impl (const Sample &msg, bool block) |
Private Member Attributes Index
| std::shared_ptr< State > | state_ |
| bool | owns_ref_ = false |
Private Static Functions Index
| static Run | create (InputStream stream, const RunOptions &opt, const struct InputStreamOptions &stream_opt, RunMode mode=RunMode::Async, const std::optional< InputOptions > &tensor_input_opt_for_cv=std::nullopt, pipeline_internal::InputRouteProcessorPtr input_route_processor=nullptr) |
Description
Live pipeline handle: push inputs in, pull outputs out.
A Run is what Session::build() returns. It owns the live GStreamer pipeline plus its internal worker threads (typically 5–15 per Run, including streaming threads, dispatcher pool threads, and a bus watcher). Application code drives the Run by push()-ing inputs and pull()-ing outputs (or run() for one-shot synchronous use).
Thread safety: push() from one thread and pull() from another is safe. Multiple threads push-ing the same Run concurrently is NOT safe — serialize push from one thread or use external synchronization.
Runs are non-copyable but movable. Destroying a Run shuts down its pipeline cleanly (sends EOS, drains, transitions to NULL).
- See Also
Session::build for how a Run is constructed
- See Also
RunOptions for runtime configuration
- See Also
"Runs and the parallelism story" (§0.13 of the design deep dive)
Definition at line 512 of file Run.h.
Friends
MeasureScope
|
Definition at line 615 of file Run.h.
Session
Public Constructors
Run()
| default |
Construct an empty Run; assign from Session::build() before use.
Run()
Run()
Public Operators
operator bool()
| explicit noexcept |
Returns true if the Run is alive (constructed by Session::build, not yet stopped).
operator=()
| delete |
operator=()
Public Member Functions
can_pull()
|
can_push()
|
close()
|
close_input()
|
Send EOS into the pipeline.
Drain remaining outputs by continuing to pull until PullStatus::Closed.
diag_snapshot()
|
diagnostics_summary()
|
input_stats()
|
last_error()
|
measurement_summary()
|
metrics()
|
metrics_report()
|
metrics_report()
|
power_summary()
|
pull()
Pull the next output sample with a structured status return.
- Parameters
-
timeout_ms Wait up to this many ms; -1 waits forever; 0 is non-blocking.
out Filled with the next sample on Ok.
err Optional out-parameter populated on Error with a structured PullError.
- Returns
Ok, Timeout, Closed, or Error.
pull()
|
pull_samples()
|
pull_tensors()
|
push()
|
Push cv::Mat inputs into the pipeline.
Multi-input models accept one Mat per ingress.
- Returns
true on success; behavior on full queue is governed by RunOptions::overflow_policy.
push()
|
push()
|
push_holder()
|
report()
|
run()
|
run()
|
run()
|
running()
|
start_measurement()
|
stats()
|
stop()
|
try_push()
|
try_push()
|
try_push()
|
try_push_holder()
|
warmup()
|
Private Member Functions
enqueue_run_images()
|
enqueue_run_samples()
|
enqueue_run_tensors()
|
pull_samples_strict()
|
pull_tensors_strict()
|
push_holder_impl()
|
push_impl()
|
push_impl()
|
push_message_impl()
|
push_sample_impl()
|
require_async_mode()
|
require_async_pull_mode()
Private Static Functions
create()
| static |
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.