pub struct MetalBurnDecoder { /* private fields */ }Expand description
Persistent Metal codec session followed by an explicit staged Burn upload.
JPEG 2000 decoding executes on Metal. Completed codec-owned device output is
copied to host staging and then uploaded through burn_core::tensor::Tensor::from_data.
This type does not provide direct-destination or zero-copy behavior.
Implementations§
Source§impl MetalBurnDecoder
impl MetalBurnDecoder
Sourcepub fn system_default(
_options: BatchDecodeOptions,
) -> Result<Self, BurnDecodeError>
pub fn system_default( _options: BatchDecodeOptions, ) -> Result<Self, BurnDecodeError>
Return a typed unavailable error on hosts without Metal.
Sourcepub const fn codec(&self) -> &CodecDecoder
pub const fn codec(&self) -> &CodecDecoder
Borrow the persistent Metal codec session.
Sourcepub const fn device(&self) -> &WgpuDevice
pub const fn device(&self) -> &WgpuDevice
Borrow the Burn wgpu device receiving the staged upload.
Sourcepub fn prepare(
&self,
inputs: Vec<EncodedImage>,
) -> Result<PreparedBatch, BurnDecodeError>
pub fn prepare( &self, inputs: Vec<EncodedImage>, ) -> Result<PreparedBatch, BurnDecodeError>
Parse and group owned inputs once for repeated decode calls.
Sourcepub fn prepare_prepared_images(
&self,
images: Vec<PreparedImage>,
) -> Result<PreparedBatch, BurnDecodeError>
pub fn prepare_prepared_images( &self, images: Vec<PreparedImage>, ) -> Result<PreparedBatch, BurnDecodeError>
Regroup caller-supplied prepared images without reparsing codestream bytes.
Sourcepub fn decode(
&mut self,
inputs: Vec<EncodedImage>,
) -> Result<BurnBatchDecode<Wgpu>, BurnDecodeError>
pub fn decode( &mut self, inputs: Vec<EncodedImage>, ) -> Result<BurnBatchDecode<Wgpu>, BurnDecodeError>
Decode on Metal, stage completed pixels through host memory, and upload to Burn.
Sourcepub fn decode_prepared_images(
&mut self,
images: Vec<PreparedImage>,
) -> Result<BurnBatchDecode<Wgpu>, BurnDecodeError>
pub fn decode_prepared_images( &mut self, images: Vec<PreparedImage>, ) -> Result<BurnBatchDecode<Wgpu>, BurnDecodeError>
Regroup prepared images, decode on Metal, and perform the staged upload.
Sourcepub fn decode_prepared(
&mut self,
prepared: &PreparedBatch,
) -> Result<BurnBatchDecode<Wgpu>, BurnDecodeError>
pub fn decode_prepared( &mut self, prepared: &PreparedBatch, ) -> Result<BurnBatchDecode<Wgpu>, BurnDecodeError>
Decode a reusable preparation on Metal and perform the staged upload.
Sourcepub fn submit(
&mut self,
_inputs: Vec<EncodedImage>,
) -> Result<SubmittedMetalBurnBatch, BurnDecodeError>
pub fn submit( &mut self, _inputs: Vec<EncodedImage>, ) -> Result<SubmittedMetalBurnBatch, BurnDecodeError>
Return a typed unavailable error on hosts without Metal.
Sourcepub fn submit_prepared(
&mut self,
_prepared: &PreparedBatch,
) -> Result<SubmittedMetalBurnBatch, BurnDecodeError>
pub fn submit_prepared( &mut self, _prepared: &PreparedBatch, ) -> Result<SubmittedMetalBurnBatch, BurnDecodeError>
Return a typed unavailable error on hosts without Metal.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MetalBurnDecoder
impl RefUnwindSafe for MetalBurnDecoder
impl Send for MetalBurnDecoder
impl Sync for MetalBurnDecoder
impl Unpin for MetalBurnDecoder
impl UnsafeUnpin for MetalBurnDecoder
impl UnwindSafe for MetalBurnDecoder
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> 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