pub struct OpCounter {
pub matmul_ops: u64,
pub attention_ops: u64,
pub activation_ops: u64,
pub normalization_ops: u64,
pub memory_read_bytes: u64,
pub memory_write_bytes: u64,
}Fields§
§matmul_ops: u64§attention_ops: u64§activation_ops: u64§normalization_ops: u64§memory_read_bytes: u64§memory_write_bytes: u64Implementations§
Source§impl OpCounter
impl OpCounter
pub const fn new() -> Self
pub fn add_matmul(&mut self, m: usize, n: usize, k: usize)
pub fn add_attention(&mut self, q: usize, k: usize, d: usize)
pub fn add_activation(&mut self, elems: usize)
pub fn add_normalization(&mut self, elems: usize)
pub fn add_memory_read(&mut self, bytes: usize)
pub fn add_memory_write(&mut self, bytes: usize)
pub fn merge(&mut self, other: &OpCounter)
pub fn reset(&mut self)
pub fn total_ops(&self) -> u64
pub fn total_memory_bytes(&self) -> u64
Trait Implementations§
impl Copy for OpCounter
impl StructuralPartialEq for OpCounter
Auto Trait Implementations§
impl Freeze for OpCounter
impl RefUnwindSafe for OpCounter
impl Send for OpCounter
impl Sync for OpCounter
impl Unpin for OpCounter
impl UnsafeUnpin for OpCounter
impl UnwindSafe for OpCounter
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