Skip to main content

OpenVinoAccelerator

Struct OpenVinoAccelerator 

Source
pub struct OpenVinoAccelerator { /* private fields */ }
Expand description

Intel OpenVINO backend instance bound to one inference device.

Implementations§

Source§

impl OpenVinoAccelerator

Source

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.

Source

pub fn available_devices() -> Result<Vec<String>, InitError>

Enumerate concrete runtime endpoints without choosing a default device.

Source

pub fn new() -> Result<Self, InitError>

Open the preferred available inference device: NPU, then GPU, then CPU.

Source

pub fn with_device(device: &str) -> Result<Self, InitError>

Open one specific device, by enumerated name ("GPU.1") or class prefix ("NPU").

Source

pub fn advertises_fp8(&self) -> bool

Whether this instance advertises the FP8 tier, which depends on the device it opened.

Source

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.

Source

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.

Source

pub fn device_name(&self) -> &str

Source

pub fn runtime_devices(&self) -> Result<Vec<String>, InitError>

Re-enumerate inference devices through this instance’s runtime core.

Source

pub fn direct_binding_admissions(&self) -> u64

Cumulative count of buffers admitted as direct bindings.

Source

pub fn explicit_transfer_bytes(&self) -> u64

Cumulative bytes moved by explicit write_buffer/read_buffer transfers.

Trait Implementations§

Source§

impl Accelerator for OpenVinoAccelerator

Source§

type Context = OpenVinoContext

Owned context handle. It may be a native value and need not be boxed, cloneable, or thread safe.
Source§

type Buffer = OpenVinoBuffer

Owned handle for the exact allocation described by its accompanying BufferInfo.
Source§

type Program = OpenVinoProgram

Owned resident-program handle with no borrow of its source artifact.
Source§

type Queue = OpenVinoQueue

Owned accelerator execution-queue handle.
Source§

type Event = OpenVinoEvent

Owned submission and completion token with no borrow of the submitted binding slice.
Source§

fn device_info(&self) -> Result<DeviceInfo, BackendError>

Return immutable identity, capability, and limit metadata. Read more
Source§

fn create_context( &self, desc: ContextDesc, ) -> Result<Self::Context, BackendError>

Create one context from prevalidated intent. Read more
Source§

fn destroy_context( &self, _context: Self::Context, ) -> Result<(), ReleaseFailure<Self::Context>>

Destroy an empty context. Read more
Source§

fn allocate_buffer( &self, context: &Self::Context, desc: BufferDesc, ) -> Result<AllocatedBuffer<Self::Buffer>, BackendError>

Allocate one exact provider-owned buffer backing. Read more
Source§

fn write_buffer( &self, buffer: &mut Self::Buffer, offset: u64, data: &dyn ByteSource, ) -> Result<(), BackendError>

Perform one explicit host-to-buffer transfer. Read more
Source§

fn read_buffer( &self, buffer: &Self::Buffer, offset: u64, data: &mut dyn ByteSink, ) -> Result<(), BackendError>

Perform one explicit buffer-to-host transfer. Read more
Source§

fn free_buffer( &self, _buffer: Self::Buffer, ) -> Result<(), ReleaseFailure<Self::Buffer>>

Release an unreferenced buffer and its exact backing allocation. Read more
Source§

fn load_program( &self, context: &Self::Context, artifact: ArtifactRef<'_>, ) -> Result<Self::Program, BackendError>

Create a resident program from an opaque, possibly segmented artifact. Read more
Source§

fn unload_program( &self, _program: Self::Program, ) -> Result<(), ReleaseFailure<Self::Program>>

Release an unreferenced resident program. Read more
Source§

fn create_queue( &self, context: &Self::Context, desc: QueueDesc, ) -> Result<Self::Queue, BackendError>

Create one accelerator execution queue. Read more
Source§

fn destroy_queue( &self, _queue: Self::Queue, ) -> Result<(), ReleaseFailure<Self::Queue>>

Release an unreferenced execution queue. Read more
Source§

fn submit( &self, queue: &Self::Queue, program: &Self::Program, bindings: &[BindingRef<'_, Self::Buffer>], timeout: Timeout, ) -> Result<Self::Event, SubmitFailure<Self::Event>>

Attempt to admit one program execution and return its event. Read more
Source§

fn poll_event(&self, event: &Self::Event) -> Result<EventState, BackendError>

Observe event state without blocking or driving an executor. Read more
Source§

fn destroy_event( &self, event: Self::Event, ) -> Result<(), ReleaseFailure<Self::Event>>

Release one terminal event and its provider invocation state. Read more
Source§

fn cancel_event(&self, _event: &Self::Event) -> Result<(), BackendError>

Attempt to make a pending event terminal as EventState::Cancelled. Read more
Source§

impl Debug for OpenVinoAccelerator

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl TosaCapabilityProvider for OpenVinoAccelerator

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.