pub enum CpuAccess {
None,
Read,
Write,
ReadWrite,
}Expand description
Declared CPU involvement for an image tensor, chosen at allocation.
The HAL assumes buffers are produced and consumed by hardware (ISP,
codec, GPU, NPU) — hardware access needs no declaration. CPU access is
the opt-in: it selects the CPU usage/mapping mode at allocation
(write-combined for Write, cached for Read) and, on Android, pins
the layout linear (vendor tile compression requires None).
Mapping beyond the declared access is best-effort, never silent: it
may be refused (Error::NotSupported) or take a slow path, and it
always increments unplanned_cpu_access_count with a once-per-buffer
warning.
Variants§
None
Hardware-only buffer (the default): no CPU mapping declared. Compression-eligible on platforms with vendor tile layouts.
Read
CPU reads (verification, CPU consumers) — cached mapping.
Write
CPU writes (decode targets) — write-combined mapping where the
platform supports it; reading through a Write map is undeclared.
ReadWrite
CPU reads and writes — the pre-CpuAccess implicit behavior.
Implementations§
Trait Implementations§
impl Copy for CpuAccess
impl Eq for CpuAccess
impl StructuralPartialEq for CpuAccess
Auto Trait Implementations§
impl Freeze for CpuAccess
impl RefUnwindSafe for CpuAccess
impl Send for CpuAccess
impl Sync for CpuAccess
impl Unpin for CpuAccess
impl UnsafeUnpin for CpuAccess
impl UnwindSafe for CpuAccess
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