Skip to main content

Backend

Trait Backend 

Source
pub trait Backend:
    Debug
    + Send
    + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn targets(&self) -> &[&str];
    fn compile(
        &self,
        module: &Module,
        opts: &BackendOptions,
    ) -> Result<BackendOutput, BackendError>;

    // Provided method
    fn preferred_precision(&self) -> Precision { ... }
}
Expand description

A backend that compiles NxPU IR to target-specific output.

Required Methods§

Source

fn name(&self) -> &str

Human-readable name (e.g. “apple-ane”).

Source

fn targets(&self) -> &[&str]

Target identifiers this backend handles (for --target dispatch).

Source

fn compile( &self, module: &Module, opts: &BackendOptions, ) -> Result<BackendOutput, BackendError>

Compile an optimized IR module to backend-specific output.

Provided Methods§

Source

fn preferred_precision(&self) -> Precision

The precision this backend prefers for optimal NPU execution.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§