pub struct CompressionPlan { /* private fields */ }Expand description
A validated, granularity-aligned plan for a compressed allocation.
Records the logically requested size and the physically reserved size
(rounded up to the compression granularity). The physical footprint is the
number of bytes that cuMemCreate would reserve; the effective footprint
after compression depends on the data and is modelled separately by
CompressedDeviceBuffer.
Implementations§
Source§impl CompressionPlan
impl CompressionPlan
Sourcepub fn new(
requested_bytes: usize,
support: CompressionSupport,
) -> CudaResult<Self>
pub fn new( requested_bytes: usize, support: CompressionSupport, ) -> CudaResult<Self>
Builds a compression plan for requested_bytes against support.
§Errors
CudaError::InvalidValueifrequested_bytesis zero or rounding to the granularity overflows.CudaError::NotSupportedifsupportreports that the device does not support generic compression.
Sourcepub fn requested_bytes(&self) -> usize
pub fn requested_bytes(&self) -> usize
The number of bytes the caller asked for.
Sourcepub fn physical_bytes(&self) -> usize
pub fn physical_bytes(&self) -> usize
The number of physical bytes reserved (granularity-aligned).
Sourcepub fn granularity(&self) -> usize
pub fn granularity(&self) -> usize
The granularity this plan was aligned to.
Sourcepub fn padding_bytes(&self) -> usize
pub fn padding_bytes(&self) -> usize
The padding bytes added by granularity rounding (physical - requested).
Trait Implementations§
Source§impl Clone for CompressionPlan
impl Clone for CompressionPlan
Source§fn clone(&self) -> CompressionPlan
fn clone(&self) -> CompressionPlan
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CompressionPlan
Source§impl Debug for CompressionPlan
impl Debug for CompressionPlan
impl Eq for CompressionPlan
Source§impl PartialEq for CompressionPlan
impl PartialEq for CompressionPlan
Source§fn eq(&self, other: &CompressionPlan) -> bool
fn eq(&self, other: &CompressionPlan) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CompressionPlan
Auto Trait Implementations§
impl Freeze for CompressionPlan
impl RefUnwindSafe for CompressionPlan
impl Send for CompressionPlan
impl Sync for CompressionPlan
impl Unpin for CompressionPlan
impl UnsafeUnpin for CompressionPlan
impl UnwindSafe for CompressionPlan
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
Mutably borrows from an owned value. Read more