Skip to main content

Crate omni_ffi

Crate omni_ffi 

Source
Expand description

omni-ffi — zero-cost cxx bridge between the Rust orchestrator and the OmniPulse Module-I WST math engine.

On the default (CPU) build the bridge calls cpu_wst_forward() from cpu_wst_engine.h: a real Radix-2 Cooley-Tukey FFT + analytic Morlet filter bank + depth-m scattering cascade. No mocks.

When the cuda feature is enabled the bridge links cudart and cufft and (in the GPU build) dispatches to the templated WSTEngine<HopperTag, J, Q> defined in wst_kernel.cuh.

§Memory ownership

run_wst_pipeline returns a WSTResult whose fingerprint_ptr owns either:

  • a new float[] heap allocation (CPU build), or
  • a cudaMalloc device allocation (CUDA build).

The Rust caller MUST release it by calling free_wst_result exactly once. Forgetting to do so leaks heap or VRAM. Calling it twice is undefined behavior.

Structs§

WSTResult
Plain-old-data result struct shared with C++.

Functions§

execute_fingerprint_pass
Convenience wrapper that runs a single-batch, depth-2, plain-WST pass.
free_fingerprint
Release the tensor allocation backing a WSTResult.