pub struct SparsityMetadata {
pub active_chunks: Vec<u64>,
pub chunk_size: usize,
pub num_chunks: usize,
}Expand description
Sparsity metadata for efficient plane skipping.
Tracks which chunks of dimensions are entirely zero, enabling the kernel to skip computation for those regions.
Fields§
§active_chunks: Vec<u64>Bitmap of active chunks (bit set if chunk has non-zero elements).
Each bit represents chunk_size consecutive dimensions.
chunk_size: usizeSize of each chunk in dimensions.
num_chunks: usizeTotal number of chunks.
Implementations§
Source§impl SparsityMetadata
impl SparsityMetadata
Sourcepub fn from_planes(
planes: &TernaryPlanes,
chunk_size: usize,
) -> SparsityMetadata
pub fn from_planes( planes: &TernaryPlanes, chunk_size: usize, ) -> SparsityMetadata
Create metadata from ternary planes.
Sourcepub fn is_chunk_active(&self, chunk_idx: usize) -> bool
pub fn is_chunk_active(&self, chunk_idx: usize) -> bool
Check if a specific chunk is active.
Sourcepub fn active_count(&self) -> usize
pub fn active_count(&self) -> usize
Count active chunks.
Sourcepub fn chunk_sparsity(&self) -> f32
pub fn chunk_sparsity(&self) -> f32
Effective sparsity (fraction of inactive chunks).
Trait Implementations§
Source§impl Clone for SparsityMetadata
impl Clone for SparsityMetadata
Source§fn clone(&self) -> SparsityMetadata
fn clone(&self) -> SparsityMetadata
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SparsityMetadata
impl RefUnwindSafe for SparsityMetadata
impl Send for SparsityMetadata
impl Sync for SparsityMetadata
impl Unpin for SparsityMetadata
impl UnwindSafe for SparsityMetadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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