mnn_runtime/lib.rs
1//! Safe, named multi-input/multi-output inference on top of MNN.
2//!
3//! The native interpreter and session live on a dedicated worker thread. This
4//! keeps raw MNN handles out of application threads, makes [`Model`] safely
5//! shareable, and guarantees that the session is destroyed before its
6//! interpreter. All tensor data currently uses `f32`, matching the vision
7//! models this initial release targets.
8
9mod config;
10mod error;
11mod model;
12mod runtime;
13mod tensor;
14
15pub use config::{
16 Backend, ExecutionMode, GpuMemoryMode, GpuTuning, MemoryMode, PowerMode, PrecisionMode,
17 RuntimeConfig,
18};
19pub use error::{Error, Result};
20pub use model::{InferenceOutput, Model, ModelInfo, PendingRun, RunTimings};
21pub use runtime::Runtime;
22pub use tensor::{Tensor, TensorInfo};
23
24/// Pinned low-level ABI for advanced integration and native-version diagnostics.
25///
26/// Application code should normally use the safe types in this crate. Exposing
27/// this module ensures every downstream component reaches the same `mnn-runtime-sys`
28/// package instead of embedding another MNN copy.
29pub use mnn_runtime_sys as sys;