#[repr(u32)]pub enum ComputeBackend {
Auto = 0,
Cpu = 1,
G2d = 2,
OpenGl = 3,
}Expand description
Compute backend selection for ImageProcessor.
Use with ImageProcessorConfig::backend to select which backend the
processor should prefer. When a specific backend is selected, the
processor initializes that backend plus CPU as a fallback. When Auto
is used, the existing environment-variable-driven selection applies.
The code is the one the C EF_COMPUTE_BACKEND_* enumerators use.
Variants§
Auto = 0
Auto-detect based on available hardware and environment variables.
Cpu = 1
CPU-only processing (no hardware acceleration).
G2d = 2
Prefer G2D hardware blitter (+ CPU fallback).
OpenGl = 3
Prefer OpenGL ES (+ CPU fallback).
Implementations§
Source§impl ComputeBackend
impl ComputeBackend
Sourcepub const fn code(self) -> u32
pub const fn code(self) -> u32
The shared code for this variant. Identical on every surface.
const, deliberately: a downstream binding that cannot
write Variant = OtherEnum::Variant.code() in a #[pyclass]
discriminant position (PyO3 requires a literal there) can
still pin that literal to this value with a
const _: () = assert!(...) – a build-time check instead
of a hand-synced comment. See PyTensorMemory/PyPixelFormat
in crates/python-common/src/tensor.rs for the consumer.
Sourcepub fn from_code(code: u32) -> Option<Self>
pub fn from_code(code: u32) -> Option<Self>
Reject an unknown code rather than guessing at one.
Sourcepub fn from_str_code(s: &str) -> Option<Self>
pub fn from_str_code(s: &str) -> Option<Self>
Reject an unknown string rather than guessing at one.
Trait Implementations§
Source§impl Clone for ComputeBackend
impl Clone for ComputeBackend
impl Copy for ComputeBackend
Source§impl Debug for ComputeBackend
impl Debug for ComputeBackend
Source§impl Default for ComputeBackend
impl Default for ComputeBackend
impl Eq for ComputeBackend
Source§impl Hash for ComputeBackend
impl Hash for ComputeBackend
Source§impl PartialEq for ComputeBackend
impl PartialEq for ComputeBackend
impl StructuralPartialEq for ComputeBackend
Auto Trait Implementations§
impl Freeze for ComputeBackend
impl RefUnwindSafe for ComputeBackend
impl Send for ComputeBackend
impl Sync for ComputeBackend
impl Unpin for ComputeBackend
impl UnsafeUnpin for ComputeBackend
impl UnwindSafe for ComputeBackend
Blanket Implementations§
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> 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