Skip to main content

estimate_occupancy

Function estimate_occupancy 

Source
pub fn estimate_occupancy(
    wg_size: usize,
    regs_per_thread: usize,
    shared_mem_bytes: usize,
    max_wgs_per_sm: usize,
    max_threads_per_sm: usize,
    max_regs_per_sm: usize,
    max_smem_per_sm: usize,
) -> f64
Expand description

Compute the theoretical SM occupancy given resource usage.

Returns a value in [0.0, 1.0] where 1.0 = 100% occupancy.

ยงParameters

  • wg_size - threads per work-group.
  • regs_per_thread - registers used per thread.
  • shared_mem_bytes- shared memory used per work-group.
  • max_wgs_per_sm - hardware limit (work-groups per SM).
  • max_threads_per_sm - hardware limit (threads per SM).
  • max_regs_per_sm - hardware limit (total registers per SM).
  • max_smem_per_sm - hardware limit (shared memory bytes per SM).