pub struct CudaTile {
pub bm: usize,
pub bn: usize,
pub bk: usize,
pub tm: usize,
pub tn: usize,
}Expand description
A point in the GEMM tiling lattice.
Fields§
§bm: usizeBlock (output) tile height — rows of C computed per block.
bn: usizeBlock (output) tile width — cols of C computed per block.
bk: usizeK-stage depth — contraction tiles staged through shared memory per iteration (bigger ⇒ more reuse per global load, up to the shared-memory budget).
tm: usizePer-thread register-tile height.
tn: usizePer-thread register-tile width.
Implementations§
Source§impl CudaTile
impl CudaTile
Sourcepub fn threads(&self) -> usize
pub fn threads(&self) -> usize
Threads per block: one thread per tm×tn register sub-tile, so (bm/tm)·(bn/tn).
Sourcepub fn smem_bytes(&self) -> usize
pub fn smem_bytes(&self) -> usize
Shared-memory footprint in bytes: the A stage (bm×bk) + the B stage (bk×bn), int8 = 1 byte per
element, double-buffered (×2) so the next K-stage streams in while the current one computes.
Source§impl CudaTile
impl CudaTile
Sourcepub fn regs_per_thread(&self) -> usize
pub fn regs_per_thread(&self) -> usize
Registers per thread ≈ the tm·tn int32 accumulator tile plus ~24 for indices/fragments/loop state.
Sourcepub fn is_feasible(&self, gpu: &GpuLimits) -> bool
pub fn is_feasible(&self, gpu: &GpuLimits) -> bool
Feasible-for-construction: legal on the block budget AND at least one block fits the SM register file.
Sourcepub fn blocks_per_sm(&self) -> usize
pub fn blocks_per_sm(&self) -> usize
Estimated resident blocks per SM (Ampere sm_86: 100 KiB smem, 65,536 regs, 1536 threads, ≤16 blocks) — the min over the four limiters. Bigger tiles (more regs/smem) → fewer blocks → less latency hiding.
Sourcepub fn occupancy(&self) -> f64
pub fn occupancy(&self) -> f64
Occupancy fraction: resident warps / 48 (Ampere’s max warps per SM).
Sourcepub fn dram_traffic(&self) -> f64
pub fn dram_traffic(&self) -> f64
DRAM traffic per unit of work (lower = better): global→shared reuse from the block tile. Each A
element is read N/BN times, each B element M/BM times, so operand bytes ∝ 1/BM + 1/BN. EXACT byte
count — no fitted constant.
Sourcepub fn smem_traffic(&self) -> f64
pub fn smem_traffic(&self) -> f64
Shared-memory traffic per unit of work (lower = better): shared→register reuse from the thread tile.
Each thread does TM·TN MACs per TM + TN shared loads, so shared bytes ∝ 1/TM + 1/TN. EXACT byte
count — no fitted constant.
Sourcepub fn dominates(&self, other: &CudaTile) -> bool
pub fn dominates(&self, other: &CudaTile) -> bool
Pareto dominance over the THREE physical axes — DRAM traffic ↓, SMEM traffic ↓, occupancy ↑ — with NO
weights, NO fitted constants, no assumption about which matters more. self dominates other iff it is
weakly better on all three and strictly better on at least one. A dominated tile cannot be the optimum
(under the monotonicity assumption: less traffic and more occupancy never hurt), so it need not be
measured. This is the assumption-free pruning that shrinks the space WITHOUT telling it the answer.
Trait Implementations§
impl Copy for CudaTile
impl Eq for CudaTile
impl StructuralPartialEq for CudaTile
Auto Trait Implementations§
impl Freeze for CudaTile
impl RefUnwindSafe for CudaTile
impl Send for CudaTile
impl Sync for CudaTile
impl Unpin for CudaTile
impl UnsafeUnpin for CudaTile
impl UnwindSafe for CudaTile
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.