pub trait BackendFactory: Send + Sync {
// Required methods
fn create_compute_backend<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 BackendConfig,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn ComputeBackend>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn create_weight_loader<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 WeightLoaderConfig,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn WeightLoader>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn supported_backend_types(&self) -> Vec<BackendType>;
fn validate_config(&self, config: &BackendConfig) -> Result<()>;
}Expand description
Backend factory for creating backend instances
Required Methods§
Sourcefn create_compute_backend<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 BackendConfig,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn ComputeBackend>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_compute_backend<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 BackendConfig,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn ComputeBackend>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create compute backend
Sourcefn create_weight_loader<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 WeightLoaderConfig,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn WeightLoader>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_weight_loader<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 WeightLoaderConfig,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn WeightLoader>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create weight loader
Sourcefn supported_backend_types(&self) -> Vec<BackendType>
fn supported_backend_types(&self) -> Vec<BackendType>
Get supported backend types
Sourcefn validate_config(&self, config: &BackendConfig) -> Result<()>
fn validate_config(&self, config: &BackendConfig) -> Result<()>
Validate backend configuration