pub struct CudaDecoderSession { /* private fields */ }Expand description
Reusable CUDA runtime session with cached kernels, uploads, streams, and scratch.
Implementations§
Source§impl CudaDecoderSession
impl CudaDecoderSession
Sourcepub fn is_available() -> bool
pub fn is_available() -> bool
Probe for both dynamically loaded CUDA driver and NVRTC libraries.
This performs no CUDA initialization and is safe on CPU-only hosts.
Sourcepub fn system_default() -> Result<Self, CudaError>
pub fn system_default() -> Result<Self, CudaError>
Create a reusable session on device ordinal zero.
Sourcepub fn new(device_ordinal: usize) -> Result<Self, CudaError>
pub fn new(device_ordinal: usize) -> Result<Self, CudaError>
Create a reusable session on a caller-selected CUDA device ordinal.
Sourcepub const fn is_usable(&self) -> bool
pub const fn is_usable(&self) -> bool
Whether this initialized session can accept reconstruction work.
Sourcepub fn device_ordinal(&self) -> usize
pub fn device_ordinal(&self) -> usize
Device ordinal retained by this session.
Sourcepub fn stream_count(&self) -> usize
pub fn stream_count(&self) -> usize
Number of reusable nonblocking streams available to batch work.
Sourcepub fn buffer_pool_diagnostics(
&self,
) -> Result<CudaBufferPoolDiagnostics, CudaError>
pub fn buffer_pool_diagnostics( &self, ) -> Result<CudaBufferPoolDiagnostics, CudaError>
Return retained exact-size scratch allocation counters.
Sourcepub fn upload_cache_diagnostics(
&self,
) -> Result<CudaUploadCacheDiagnostics, CudaError>
pub fn upload_cache_diagnostics( &self, ) -> Result<CudaUploadCacheDiagnostics, CudaError>
Return immutable coefficient upload-cache counters.
Sourcepub fn allocate_destination(
&self,
layout: SurfaceLayout,
) -> Result<CudaDestination, CudaError>
pub fn allocate_destination( &self, layout: SurfaceLayout, ) -> Result<CudaDestination, CudaError>
Allocate an exact device output owned by the caller.
Sourcepub fn allocate_batch_destination(
&self,
layout: DenseCudaBatchLayout,
) -> Result<CudaBatchDestination, CudaError>
pub fn allocate_batch_destination( &self, layout: DenseCudaBatchLayout, ) -> Result<CudaBatchDestination, CudaError>
Allocate a dense device batch output owned by the caller.
Sourcepub fn submit(&self, plan: &CudaDecodePlan) -> Result<CudaSubmission, CudaError>
pub fn submit(&self, plan: &CudaDecodePlan) -> Result<CudaSubmission, CudaError>
Submit one validated plan without waiting for completion.
Sourcepub fn submit_batch(
&self,
plans: &[CudaDecodePlan],
) -> Result<CudaBatchSubmission, CudaError>
pub fn submit_batch( &self, plans: &[CudaDecodePlan], ) -> Result<CudaBatchSubmission, CudaError>
Submit a bounded batch across the session’s reusable streams.
Sourcepub fn submit_dense_batch(
&self,
plans: &[CudaDecodePlan],
) -> Result<CudaResidentBatchSubmission, CudaError>
pub fn submit_dense_batch( &self, plans: &[CudaDecodePlan], ) -> Result<CudaResidentBatchSubmission, CudaError>
Submit a homogeneous batch into one internally owned device allocation.
Sourcepub fn submit_into(
&self,
plan: &CudaDecodePlan,
destination: CudaDestination,
) -> Result<CudaDestinationSubmission, CudaError>
pub fn submit_into( &self, plan: &CudaDecodePlan, destination: CudaDestination, ) -> Result<CudaDestinationSubmission, CudaError>
Submit into an exclusively retained caller-owned device allocation.
Sourcepub fn submit_batch_into(
&self,
plans: &[CudaDecodePlan],
destination: CudaBatchDestination,
) -> Result<CudaBatchDestinationSubmission, CudaError>
pub fn submit_batch_into( &self, plans: &[CudaDecodePlan], destination: CudaBatchDestination, ) -> Result<CudaBatchDestinationSubmission, CudaError>
Submit a homogeneous batch into caller-owned dense device storage.
Sourcepub fn decode_to_host(
&self,
plan: &CudaDecodePlan,
) -> Result<DecodedImage, CudaError>
pub fn decode_to_host( &self, plan: &CudaDecodePlan, ) -> Result<DecodedImage, CudaError>
Decode one plan and copy its exact native bytes to typed host storage.
Sourcepub fn decode_batch_to_host(
&self,
plans: &[CudaDecodePlan],
) -> Result<Vec<DecodedImage>, CudaError>
pub fn decode_batch_to_host( &self, plans: &[CudaDecodePlan], ) -> Result<Vec<DecodedImage>, CudaError>
Decode a batch to host storage while preserving caller order.
Sourcepub fn readback(&self, image: &ResidentCudaImage) -> Result<Vec<u8>, CudaError>
pub fn readback(&self, image: &ResidentCudaImage) -> Result<Vec<u8>, CudaError>
Copy one completed resident image to host bytes.
Sourcepub fn readback_batch_image(
&self,
batch: &CudaResidentBatch,
image: usize,
) -> Result<Vec<u8>, CudaError>
pub fn readback_batch_image( &self, batch: &CudaResidentBatch, image: usize, ) -> Result<Vec<u8>, CudaError>
Copy one image from a completed dense batch to host bytes.