Run.h File
Run push/pull runtime handle and diagnostics stats. More...
Included Headers
#include "pipeline/SessionOptions.h"
#include <cstdint>
#include <functional>
#include <memory>
#include <optional>
#include <string>
#include <vector>
Namespaces Index
| namespace | cv |
| namespace | simaai |
| namespace | neat |
Classes Index
| struct | RunAdvancedOptions |
| struct | RunOptions |
| struct | InputDropInfo |
| struct | InputStreamStats |
| struct | RunStats |
| struct | RunStageStats |
| struct | RunElementTimingStats |
| struct | RunElementFlowStats |
| struct | RunDiagSnapshot |
| struct | RunReportOptions |
| class | Run |
|
Runtime handle for pushing inputs and pulling outputs. More... | |
Description
Run push/pull runtime handle and diagnostics stats.
File Listing
The file content with the documentation metadata removed is:
8#include "pipeline/SessionOptions.h"
21namespace simaai::neat {
26enum class OverflowPolicy {
27 Block = 0,
28 KeepLatest,
29 DropIncoming,
33 Realtime,
34 Balanced,
35 Reliable,
38enum class OutputMemory {
39 Auto = 0,
40 ZeroCopy,
41 Owned,
44struct RunAdvancedOptions {
45 bool copy_input = false;
46 std::size_t max_input_bytes = 0;
49struct RunOptions {
51 int queue_depth = 4;
54 bool enable_metrics = false;
56 std::function<void(const struct InputDropInfo&)> on_input_drop;
59struct InputDropInfo {
61 std::string media_type;
72struct InputStreamStats {
73 std::uint64_t push_count = 0;
74 std::uint64_t push_failures = 0;
75 std::uint64_t pull_count = 0;
76 std::uint64_t poll_count = 0;
77 std::uint64_t dropped_frames = 0;
78 std::uint64_t renegotiations = 0;
79 std::uint64_t alloc_grows = 0;
80 std::uint64_t growth_blocked = 0;
81 std::uint64_t renegotiation_blocked = 0;
82 double avg_alloc_us = 0.0;
83 double avg_map_us = 0.0;
84 double avg_copy_us = 0.0;
85 double avg_push_us = 0.0;
86 double avg_pull_wait_us = 0.0;
87 double avg_decode_us = 0.0;
91 std::uint64_t inputs_enqueued = 0;
92 std::uint64_t inputs_dropped = 0;
93 std::uint64_t inputs_pushed = 0;
94 std::uint64_t outputs_ready = 0;
95 std::uint64_t outputs_pulled = 0;
96 std::uint64_t outputs_dropped = 0;
97 double avg_latency_ms = 0.0;
98 double min_latency_ms = 0.0;
99 double max_latency_ms = 0.0;
102struct RunStageStats {
103 std::string stage_name;
109struct RunElementTimingStats {
110 std::string element_name;
116 std::uint64_t missed_out = 0;
119struct RunElementFlowStats {
120 std::string element_name;
121 std::uint64_t in_buffers = 0;
122 std::uint64_t out_buffers = 0;
125 std::uint64_t caps_changes = 0;
128struct RunDiagSnapshot {
130 std::vector<BoundaryFlowStats> boundaries;
131 std::vector<RunElementTimingStats> element_timings;
132 std::vector<RunElementFlowStats> element_flows;
135struct RunReportOptions {
136 bool include_pipeline = true;
137 bool include_stage_timings = true;
138 bool include_element_timings = true;
139 bool include_boundaries = true;
140 bool include_flow_stats = true;
141 bool include_node_reports = false;
142 bool include_next_cpu = false;
143 bool include_queue_depth = true;
144 bool include_num_buffers = true;
145 bool include_run_stats = true;
146 bool include_input_stats = true;
147 bool include_system_info = false;
163 explicit operator bool() const noexcept;
175 bool push_holder(const std::shared_ptr<void>& holder);
176 bool try_push_holder(const std::shared_ptr<void>& holder);
177 void close_input();
178 PullStatus pull(int timeout_ms, Sample& out, PullError* err = nullptr);
180 std::optional<simaai::neat::Tensor> pull_tensor(int timeout_ms = -1);
181 simaai::neat::Tensor pull_tensor_or_throw(int timeout_ms = -1);
182 std::optional<simaai::neat::Tensor> pull_tensor_matching(const std::string& payload_tag,
184 Sample push_and_pull(const cv::Mat& input, int timeout_ms = -1);
185 Sample push_and_pull(const simaai::neat::Tensor& input, int timeout_ms = -1);
186 Sample push_and_pull_holder(const std::shared_ptr<void>& holder, int timeout_ms = -1);
193 InputStreamStats input_stats() const;
194 RunDiagSnapshot diag_snapshot() const;
195 std::string report(const RunReportOptions& opt = {}) const;
196 std::string last_error() const;
197 std::string diagnostics_summary() const;
207 explicit Run(std::shared_ptr<State> state);
209 bool push_impl(const simaai::neat::Tensor& input, bool block);
211 bool push_message_impl(const Sample& msg, bool block);
212 static Run create(InputStream stream, const RunOptions& opt,
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.1.