use super::{error::RuntimeError, session::RuntimeSession};
pub trait RuntimeFactory: Send + Sync + 'static {
fn create(&self, intra_threads: usize) -> Result<Box<dyn Runtime>, RuntimeError>;
fn cpu_fallback(&self) -> Box<dyn RuntimeFactory>;
}
pub trait Runtime: Send + Sync + 'static {
fn load_session(
&self,
model_path: &std::path::Path,
is_encoder: bool,
) -> Result<Box<dyn RuntimeSession>, RuntimeError>;
}