|
oveRTOS C++ API
C++20 RAII wrappers for the oveRTOS C API
|
RAII wrapper for an ML inference model session. More...
#include <infer.hpp>
Public Member Functions | |
| Model (const struct ove_model_config &cfg) | |
| Construct a model from the given configuration. | |
| Model (const Model &)=delete | |
| Model & | operator= (const Model &)=delete |
| Model (Model &&other) noexcept | |
| Move constructor — transfers handle ownership; source becomes empty. | |
| Model & | operator= (Model &&other) noexcept |
Move-assignment — destroys current model, then takes other's handle. | |
| Result< void > | invoke () noexcept |
| Run the model forward pass. | |
| template<typename T > | |
| T * | input_data (unsigned int index=0) |
| Get a typed pointer to input tensor data; nullptr on failure. | |
| template<typename T > | |
| const T * | output_data (unsigned int index=0) const |
| Get a typed pointer to output tensor data (const); nullptr on failure. | |
| Result< struct ove_tensor_info > | input (unsigned int index) const noexcept |
| Get full tensor descriptor for an input. | |
| Result< struct ove_tensor_info > | output (unsigned int index) const noexcept |
| Get full tensor descriptor for an output. | |
| uint64_t | last_inference_us () const |
| Return last inference duration in microseconds. | |
| ove_model_t | handle () const |
| Access the underlying C handle. | |
RAII wrapper for an ML inference model session.
Wraps the C ove_model_* API with automatic resource management. In zero-heap mode, storage and arena are embedded as class members. In heap mode, they are allocated from the backend heap.
| ArenaSize | Tensor arena size in bytes (only used in zero-heap mode for the embedded arena array; in heap mode this is supplied via the config). |
|
inlineexplicit |
Construct a model from the given configuration.
Loads the FlatBuffer model and allocates tensors. Asserts on failure (embedded systems typically cannot recover from model load failure).
|
inlinenoexcept |
Run the model forward pass.
Result<void> on success; unexpected Error on failure.
|
inlinenoexcept |
Get full tensor descriptor for an input.
ove_tensor_info. On failure, an unexpected Error.