Skip to main content

calculate_occupancy

Function calculate_occupancy 

Source
pub fn calculate_occupancy(
    size: [u32; 3],
    hw: &WorkgroupHwParams,
    shared_mem_bytes: u32,
    regs_per_thread: u32,
) -> OccupancyResult
Expand description

Calculate occupancy for a given workgroup size and resource usage.

Occupancy is the ratio of active warps to maximum warps, limited by:

  • Total thread count
  • Shared memory usage
  • Register usage per thread