pub struct OpenVinoAccelerator { /* private fields */ }Expand description
Intel OpenVINO backend instance bound to one inference device.
Implementations§
Source§impl OpenVinoAccelerator
impl OpenVinoAccelerator
Sourcepub fn load_runtime_from(path: &Path) -> Result<(), InitError>
pub fn load_runtime_from(path: &Path) -> Result<(), InitError>
Initialize runtime loading from an installed library (for example a Python OpenVINO wheel). The first successful load is retained for the process lifetime. Call before discovery; this never replaces an active runtime.
Sourcepub fn available_devices() -> Result<Vec<String>, InitError>
pub fn available_devices() -> Result<Vec<String>, InitError>
Enumerate concrete runtime endpoints without choosing a default device.
Sourcepub fn new() -> Result<Self, InitError>
pub fn new() -> Result<Self, InitError>
Open the preferred available inference device: NPU, then GPU, then CPU.
Sourcepub fn with_device(device: &str) -> Result<Self, InitError>
pub fn with_device(device: &str) -> Result<Self, InitError>
Open one specific device, by enumerated name ("GPU.1") or class prefix ("NPU").
Sourcepub fn advertises_fp8(&self) -> bool
pub fn advertises_fp8(&self) -> bool
Whether this instance advertises the FP8 tier, which depends on the device it opened.
Sourcepub fn runtime_version() -> Result<String, InitError>
pub fn runtime_version() -> Result<String, InitError>
The enumerated name of the device this instance executes on.
The runtime’s build number (ov_get_openvino_version), the version a captured compiled
blob must be bound to.
Sourcepub fn export_program(
&self,
program: &OpenVinoProgram,
path: &Path,
) -> Result<(), BackendError>
pub fn export_program( &self, program: &OpenVinoProgram, path: &Path, ) -> Result<(), BackendError>
Export the plugin-compiled form of program to path through
ov_compiled_model_export_model: the NPU plugin writes its VPUX ELF, the GPU plugin its
serialized graph with the OpenCL program binaries (Intel GT zebin ELFs) embedded. The
bytes are the runtime’s own export format for this device and OpenVINO version; a
consumer that keeps them must bind them to the artifact and version that produced them.
The program stays loaded and usable afterwards.
pub fn device_name(&self) -> &str
Sourcepub fn runtime_devices(&self) -> Result<Vec<String>, InitError>
pub fn runtime_devices(&self) -> Result<Vec<String>, InitError>
Re-enumerate inference devices through this instance’s runtime core.
Sourcepub fn direct_binding_admissions(&self) -> u64
pub fn direct_binding_admissions(&self) -> u64
Cumulative count of buffers admitted as direct bindings.
Sourcepub fn explicit_transfer_bytes(&self) -> u64
pub fn explicit_transfer_bytes(&self) -> u64
Cumulative bytes moved by explicit write_buffer/read_buffer transfers.
Trait Implementations§
Source§impl Accelerator for OpenVinoAccelerator
impl Accelerator for OpenVinoAccelerator
Source§type Context = OpenVinoContext
type Context = OpenVinoContext
Source§type Buffer = OpenVinoBuffer
type Buffer = OpenVinoBuffer
BufferInfo.Source§type Program = OpenVinoProgram
type Program = OpenVinoProgram
Source§type Queue = OpenVinoQueue
type Queue = OpenVinoQueue
Source§type Event = OpenVinoEvent
type Event = OpenVinoEvent
Source§fn device_info(&self) -> Result<DeviceInfo, BackendError>
fn device_info(&self) -> Result<DeviceInfo, BackendError>
Source§fn create_context(
&self,
desc: ContextDesc,
) -> Result<Self::Context, BackendError>
fn create_context( &self, desc: ContextDesc, ) -> Result<Self::Context, BackendError>
Source§fn destroy_context(
&self,
_context: Self::Context,
) -> Result<(), ReleaseFailure<Self::Context>>
fn destroy_context( &self, _context: Self::Context, ) -> Result<(), ReleaseFailure<Self::Context>>
Source§fn allocate_buffer(
&self,
context: &Self::Context,
desc: BufferDesc,
) -> Result<AllocatedBuffer<Self::Buffer>, BackendError>
fn allocate_buffer( &self, context: &Self::Context, desc: BufferDesc, ) -> Result<AllocatedBuffer<Self::Buffer>, BackendError>
Source§fn write_buffer(
&self,
buffer: &mut Self::Buffer,
offset: u64,
data: &dyn ByteSource,
) -> Result<(), BackendError>
fn write_buffer( &self, buffer: &mut Self::Buffer, offset: u64, data: &dyn ByteSource, ) -> Result<(), BackendError>
Source§fn read_buffer(
&self,
buffer: &Self::Buffer,
offset: u64,
data: &mut dyn ByteSink,
) -> Result<(), BackendError>
fn read_buffer( &self, buffer: &Self::Buffer, offset: u64, data: &mut dyn ByteSink, ) -> Result<(), BackendError>
Source§fn free_buffer(
&self,
_buffer: Self::Buffer,
) -> Result<(), ReleaseFailure<Self::Buffer>>
fn free_buffer( &self, _buffer: Self::Buffer, ) -> Result<(), ReleaseFailure<Self::Buffer>>
Source§fn load_program(
&self,
context: &Self::Context,
artifact: ArtifactRef<'_>,
) -> Result<Self::Program, BackendError>
fn load_program( &self, context: &Self::Context, artifact: ArtifactRef<'_>, ) -> Result<Self::Program, BackendError>
Source§fn unload_program(
&self,
_program: Self::Program,
) -> Result<(), ReleaseFailure<Self::Program>>
fn unload_program( &self, _program: Self::Program, ) -> Result<(), ReleaseFailure<Self::Program>>
Source§fn create_queue(
&self,
context: &Self::Context,
desc: QueueDesc,
) -> Result<Self::Queue, BackendError>
fn create_queue( &self, context: &Self::Context, desc: QueueDesc, ) -> Result<Self::Queue, BackendError>
Source§fn destroy_queue(
&self,
_queue: Self::Queue,
) -> Result<(), ReleaseFailure<Self::Queue>>
fn destroy_queue( &self, _queue: Self::Queue, ) -> Result<(), ReleaseFailure<Self::Queue>>
Source§fn submit(
&self,
queue: &Self::Queue,
program: &Self::Program,
bindings: &[BindingRef<'_, Self::Buffer>],
timeout: Timeout,
) -> Result<Self::Event, SubmitFailure<Self::Event>>
fn submit( &self, queue: &Self::Queue, program: &Self::Program, bindings: &[BindingRef<'_, Self::Buffer>], timeout: Timeout, ) -> Result<Self::Event, SubmitFailure<Self::Event>>
Source§fn poll_event(&self, event: &Self::Event) -> Result<EventState, BackendError>
fn poll_event(&self, event: &Self::Event) -> Result<EventState, BackendError>
Source§fn destroy_event(
&self,
event: Self::Event,
) -> Result<(), ReleaseFailure<Self::Event>>
fn destroy_event( &self, event: Self::Event, ) -> Result<(), ReleaseFailure<Self::Event>>
Source§fn cancel_event(&self, _event: &Self::Event) -> Result<(), BackendError>
fn cancel_event(&self, _event: &Self::Event) -> Result<(), BackendError>
EventState::Cancelled. Read more