Skip to main content

ExecutionProvider

Trait ExecutionProvider 

Source
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§

Source

fn provider_id(&self) -> ProviderId

Get the unique identifier for this provider.

Source

fn get_capability(&self) -> ProviderCapability

Get the capabilities of this execution provider.

Source

fn can_handle(&self, operators: &[OperatorSpec]) -> Vec<bool>

Check if this provider can handle specific operations.

Source

fn compile_subgraph( &self, subgraph: SubGraph, ) -> Result<Box<dyn CompiledKernel>, Error>

Compile a subgraph into an executable kernel.

Source

fn get_allocator(&self) -> Arc<dyn TensorAllocator>

Get the memory allocator for this provider.

Source

fn configure(&mut self, config: ProviderConfig) -> Result<(), Error>

Configure the provider with specific settings.

Source

fn shutdown(&self) -> Result<(), Error>

Shutdown and cleanup provider resources.

Implementations on Foreign Types§

Source§

impl ExecutionProvider for CpuExecutionProvider

Source§

impl ExecutionProvider for GpuExecutionProvider

Implementors§