pub struct OpHistogram {
pub literal: u32,
pub arithmetic: u32,
pub memory: u32,
pub control_flow: u32,
pub subgroup: u32,
pub builtin: u32,
pub other: u32,
}Fields§
§literal: u32§arithmetic: u32§memory: u32§control_flow: u32§subgroup: u32§builtin: u32§other: u32Implementations§
Source§impl OpHistogram
impl OpHistogram
pub fn total(&self) -> u32
Sourcepub fn dominant(&self) -> Option<(&'static str, u32)>
pub fn dominant(&self) -> Option<(&'static str, u32)>
The dominant category and its count. Returns None if the
histogram is empty. Useful for one-line “this kernel is mostly
X” reporting.
Sourcepub fn is_memory_bound(&self) -> bool
pub fn is_memory_bound(&self) -> bool
True iff the kernel is dominated by memory ops (memory > all other categories combined). Memory-bound kernels typically benefit most from coalesce / vec_pack / shared-mem promotion.
Sourcepub fn is_arithmetic_bound(&self) -> bool
pub fn is_arithmetic_bound(&self) -> bool
True iff the kernel is dominated by arithmetic ops. ALU-bound kernels benefit from strength_reduce / fma fusion / tensor cores.
Sourcepub fn merge(&mut self, other: OpHistogram)
pub fn merge(&mut self, other: OpHistogram)
Merge another histogram into self (saturating-adds every category). Useful for corpus-level rollup.
Sourcepub fn zero() -> Self
pub fn zero() -> Self
Identity element for Self::merge - all zeros. Default produces
the same value but zero() reads more naturally as a fold seed.
Sourcepub fn format_short(&self) -> String
pub fn format_short(&self) -> String
One-line human-readable summary suitable for log lines.
Format: "N ops: lit=X arith=Y mem=Z cf=W sg=V bi=U other=T".
Trait Implementations§
Source§impl Clone for OpHistogram
impl Clone for OpHistogram
Source§fn clone(&self) -> OpHistogram
fn clone(&self) -> OpHistogram
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for OpHistogram
Source§impl Debug for OpHistogram
impl Debug for OpHistogram
Source§impl Default for OpHistogram
impl Default for OpHistogram
Source§fn default() -> OpHistogram
fn default() -> OpHistogram
Source§impl<'de> Deserialize<'de> for OpHistogram
impl<'de> Deserialize<'de> for OpHistogram
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for OpHistogram
impl Display for OpHistogram
impl Eq for OpHistogram
Source§impl PartialEq for OpHistogram
impl PartialEq for OpHistogram
Source§impl Serialize for OpHistogram
impl Serialize for OpHistogram
impl StructuralPartialEq for OpHistogram
Auto Trait Implementations§
impl Freeze for OpHistogram
impl RefUnwindSafe for OpHistogram
impl Send for OpHistogram
impl Sync for OpHistogram
impl Unpin for OpHistogram
impl UnsafeUnpin for OpHistogram
impl UnwindSafe for OpHistogram
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.