Skip to main content

ironaccelerator_qnn/
lib.rs

1//! # `ironaccelerator-qnn`
2//!
3//! Qualcomm AI Engine backend, dispatching through the **QNN SDK**:
4//!
5//! - **HTP** (Hexagon Tensor Processor) — primary NPU path; INT8 / FP16
6//!   with HMX matrix-engine acceleration on Hexagon v73+.
7//! - **HVX** — fallback Hexagon vector path for ops not yet supported by HMX.
8//! - **Adreno GPU** — alternative target for FP16 graphs.
9//!
10//! Scope is the same as every other backend here: probe the runtime, enumerate
11//! targets, report capability bits. QNN graphs are built ahead of time by the
12//! SDK, so graph construction and quantisation calibration belong to the
13//! consumer, not to this crate.
14//!
15//! ## Status
16//!
17//! v0.1 scaffold. Library probe via libloading; FFI bindings for `QnnApi.h`,
18//! `QnnContext.h`, `QnnGraph.h`, `QnnHtp.h` are tracked next.
19
20#![warn(missing_docs)]
21#![allow(clippy::missing_safety_doc)]
22
23pub mod backend;
24pub mod drv;
25
26pub use backend::{QnnBackend, QNN_BACKEND};
27pub use iron_qnn_sys as sys;
28
29/// Registers the QNN backend with `reg`.
30pub fn register(reg: &mut ironaccelerator_core::BackendRegistry) {
31    let b: &'static backend::QnnBackend = &QNN_BACKEND;
32    reg.register(b);
33}