Skip to main content

Crate edgefirst_hal

Crate edgefirst_hal 

Source
Expand description

The EdgeFirst Hardware Abstraction Layer, as one dependency.

This crate is a re-export shell. Every type you interact with is defined in a sub-crate, and depending on this umbrella costs nothing over depending on them individually — you get one version number and one feature surface instead of five.

ModuleCrateWhat it does
tensoredgefirst_tensorZero-copy tensor memory: platform GPU buffer, SHM, PBO, heap
codecedgefirst_codecDecodes JPEG/PNG into pre-allocated tensors
imageedgefirst_imageColour conversion, resize, rotation via OpenGL, G2D, or CPU
decoderedgefirst_decoderDecodes model output tensors into detections
trackeredgefirst-trackerByteTrack multi-object tracking (feature tracker, off by default)
tracelocalProcess-wide span capture to Chrome JSON (feature tracing)

codec and decoder are unrelated despite the names: codec sits at the front of the pipeline turning image bytes into tensors, decoder at the back turning model outputs into detections.

§Feature flags

ndarray, opengl, and tracing are on by default. tracker is opt-in because it pulls in additional dependencies.

§Tracing

The sub-crates emit tracing spans on their hot paths that cost a single relaxed atomic load while no subscriber is installed. trace::start_tracing is what turns them into a trace file:

edgefirst_hal::trace::start_tracing("/tmp/trace.json").expect("start tracing");
// ... run the pipeline ...
edgefirst_hal::trace::stop_tracing();

Load the result at https://ui.perfetto.dev/. Only one session is supported per process lifetime.

Re-exports§

pub use edgefirst_codec as codec;
pub use edgefirst_decoder as decoder;
pub use edgefirst_image as image;
pub use edgefirst_tensor as tensor;

Modules§

trace
Trace capture for performance analysis.