pub struct CompressionSupport { /* private fields */ }Expand description
Describes whether and how a given device supports generic compression.
Construct via CompressionSupport::for_compute_capability to apply the
capability gate (compression requires compute capability ≥ 8.0).
Implementations§
Source§impl CompressionSupport
impl CompressionSupport
Sourcepub fn for_compute_capability(major: u32, minor: u32) -> Self
pub fn for_compute_capability(major: u32, minor: u32) -> Self
Returns the compression support for a device with the given compute
capability (major, minor).
Generic memory compression is an Ampere+ feature, so any capability
with major >= 8 is considered supported. Older devices report
unsupported with the granularity still set to the default (so that
alignment math remains well-defined).
Sourcepub fn new(supported: bool, granularity: usize) -> Self
pub fn new(supported: bool, granularity: usize) -> Self
Builds an explicit support descriptor.
granularity is clamped to a minimum of 1 so that alignment never
divides by zero.
Sourcepub fn is_supported(&self) -> bool
pub fn is_supported(&self) -> bool
Returns true if generic compression is available.
Sourcepub fn granularity(&self) -> usize
pub fn granularity(&self) -> usize
Returns the allocation granularity in bytes.
Trait Implementations§
Source§impl Clone for CompressionSupport
impl Clone for CompressionSupport
Source§fn clone(&self) -> CompressionSupport
fn clone(&self) -> CompressionSupport
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 CompressionSupport
Source§impl Debug for CompressionSupport
impl Debug for CompressionSupport
impl Eq for CompressionSupport
Source§impl PartialEq for CompressionSupport
impl PartialEq for CompressionSupport
Source§fn eq(&self, other: &CompressionSupport) -> bool
fn eq(&self, other: &CompressionSupport) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CompressionSupport
Auto Trait Implementations§
impl Freeze for CompressionSupport
impl RefUnwindSafe for CompressionSupport
impl Send for CompressionSupport
impl Sync for CompressionSupport
impl Unpin for CompressionSupport
impl UnsafeUnpin for CompressionSupport
impl UnwindSafe for CompressionSupport
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