pub enum ExecutionProvider {
Cpu,
CoreMl,
Nnapi,
Cuda,
XnnPack,
}Expand description
Which ONNX Runtime execution provider to request for a session.
Canonical home is here (the module that owns session creation) so the
low-level constructors can name it without depending on pipeline_v2;
pipeline_v2::config re-exports it, so existing imports keep compiling.
EP is ort-specific config — it is not part of InferenceRuntime.
Stages pass it only at session construction via build_session_with_ep.
Wiring status (ort): Cpu always works. CoreMl registers when built
with the coreml feature on macOS aarch64. XnnPack registers with the
xnnpack feature. Nnapi and Cuda are reserved — they warn and fall
back to CPU until wired. Uncompiled / unwired choices never fail the build.
Variants§
Cpu
Always available. No EP registration; ort uses its built-in CPU path.
CoreMl
CoreML on macOS aarch64 when the coreml feature is enabled; else CPU + warn.
Nnapi
Reserved for Android NNAPI — not wired yet (CPU + warn).
Cuda
Reserved for NVIDIA CUDA — not wired yet (CPU + warn).
XnnPack
XNNPACK when the xnnpack feature is enabled; else CPU + warn.
Implementations§
Source§impl ExecutionProvider
impl ExecutionProvider
Sourcepub fn auto() -> Self
pub fn auto() -> Self
Best default for the current target: CoreML on Apple Silicon, XNNPACK on aarch64 Linux, plain CPU elsewhere. Unwired / uncompiled providers fall back to CPU with a warning at session-build time.
Sourcepub fn is_available(self) -> bool
pub fn is_available(self) -> bool
Whether this variant can register under the current build + target.
Nnapi / Cuda always return false until wired. CoreMl / XnnPack
require their cargo features (and CoreML also needs macOS aarch64).
Trait Implementations§
Source§impl Clone for ExecutionProvider
impl Clone for ExecutionProvider
Source§fn clone(&self) -> ExecutionProvider
fn clone(&self) -> ExecutionProvider
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ExecutionProvider
Source§impl Debug for ExecutionProvider
impl Debug for ExecutionProvider
Source§impl PartialEq for ExecutionProvider
impl PartialEq for ExecutionProvider
impl StructuralPartialEq for ExecutionProvider
Auto Trait Implementations§
impl Freeze for ExecutionProvider
impl RefUnwindSafe for ExecutionProvider
impl Send for ExecutionProvider
impl Sync for ExecutionProvider
impl Unpin for ExecutionProvider
impl UnsafeUnpin for ExecutionProvider
impl UnwindSafe for ExecutionProvider
Blanket Implementations§
impl<T> Boilerplate for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more