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§
Sourcefn compile(
&self,
module: &Module,
opts: &BackendOptions,
) -> Result<BackendOutput, BackendError>
fn compile( &self, module: &Module, opts: &BackendOptions, ) -> Result<BackendOutput, BackendError>
Compile an optimized IR module to backend-specific output.
Provided Methods§
Sourcefn preferred_precision(&self) -> Precision
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".