pub trait ExecutionProvider: Send + Sync {
// Required methods
fn provider_id(&self) -> ProviderId;
fn get_capability(&self) -> ProviderCapability;
fn can_handle(&self, operators: &[OperatorSpec]) -> Vec<bool>;
fn compile_subgraph(
&self,
subgraph: SubGraph,
) -> Result<Box<dyn CompiledKernel>, Error>;
fn get_allocator(&self) -> Arc<dyn TensorAllocator>;
fn configure(&mut self, config: ProviderConfig) -> Result<(), Error>;
fn shutdown(&self) -> Result<(), Error>;
}Expand description
Core execution provider interface.
Required Methods§
Sourcefn provider_id(&self) -> ProviderId
fn provider_id(&self) -> ProviderId
Get the unique identifier for this provider.
Sourcefn get_capability(&self) -> ProviderCapability
fn get_capability(&self) -> ProviderCapability
Get the capabilities of this execution provider.
Sourcefn can_handle(&self, operators: &[OperatorSpec]) -> Vec<bool>
fn can_handle(&self, operators: &[OperatorSpec]) -> Vec<bool>
Check if this provider can handle specific operations.
Sourcefn compile_subgraph(
&self,
subgraph: SubGraph,
) -> Result<Box<dyn CompiledKernel>, Error>
fn compile_subgraph( &self, subgraph: SubGraph, ) -> Result<Box<dyn CompiledKernel>, Error>
Compile a subgraph into an executable kernel.
Sourcefn get_allocator(&self) -> Arc<dyn TensorAllocator>
fn get_allocator(&self) -> Arc<dyn TensorAllocator>
Get the memory allocator for this provider.