pub struct CudaBurnDecoder { /* private fields */ }Expand description
Persistent CUDA codec session followed by an explicit staged Burn upload.
JPEG 2000 decoding executes on CUDA. 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 CudaBurnDecoder
impl CudaBurnDecoder
Sourcepub fn new(device: CudaDevice, options: BatchDecodeOptions) -> Self
pub fn new(device: CudaDevice, options: BatchDecodeOptions) -> Self
Create a staged decoder for one Burn CUDA device.
Sourcepub const fn codec(&self) -> &CodecDecoder
pub const fn codec(&self) -> &CodecDecoder
Borrow the persistent CUDA codec session.
Sourcepub const fn device(&self) -> &CudaDevice
pub const fn device(&self) -> &CudaDevice
Borrow the Burn CUDA 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<Cuda>, BurnDecodeError>
pub fn decode( &mut self, inputs: Vec<EncodedImage>, ) -> Result<BurnBatchDecode<Cuda>, BurnDecodeError>
Decode on CUDA, stage completed pixels through host memory, and upload to Burn.
Sourcepub fn decode_prepared_images(
&mut self,
images: Vec<PreparedImage>,
) -> Result<BurnBatchDecode<Cuda>, BurnDecodeError>
pub fn decode_prepared_images( &mut self, images: Vec<PreparedImage>, ) -> Result<BurnBatchDecode<Cuda>, BurnDecodeError>
Regroup prepared images, decode on CUDA, and perform the staged upload.
Sourcepub fn decode_prepared(
&mut self,
prepared: &PreparedBatch,
) -> Result<BurnBatchDecode<Cuda>, BurnDecodeError>
pub fn decode_prepared( &mut self, prepared: &PreparedBatch, ) -> Result<BurnBatchDecode<Cuda>, BurnDecodeError>
Decode a reusable preparation on CUDA and perform the staged upload.
Sourcepub fn submit(
&mut self,
inputs: Vec<EncodedImage>,
) -> Result<SubmittedCudaBurnBatch, BurnDecodeError>
pub fn submit( &mut self, inputs: Vec<EncodedImage>, ) -> Result<SubmittedCudaBurnBatch, BurnDecodeError>
Submit CUDA codec work. The later SubmittedCudaBurnBatch::wait
performs a synchronous device-to-host copy and ordinary Burn upload.
Sourcepub fn submit_prepared(
&mut self,
prepared: &PreparedBatch,
) -> Result<SubmittedCudaBurnBatch, BurnDecodeError>
pub fn submit_prepared( &mut self, prepared: &PreparedBatch, ) -> Result<SubmittedCudaBurnBatch, BurnDecodeError>
Submit a reusable preparation to codec-owned CUDA output.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CudaBurnDecoder
impl RefUnwindSafe for CudaBurnDecoder
impl Send for CudaBurnDecoder
impl Sync for CudaBurnDecoder
impl Unpin for CudaBurnDecoder
impl UnsafeUnpin for CudaBurnDecoder
impl UnwindSafe for CudaBurnDecoder
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