pub struct EuOccupancyAdvisor { /* private fields */ }Expand description
Recommends a workgroup size from an EU-utilisation fraction.
When EUs are already busy (high utilisation) a smaller workgroup reduces
per-launch pressure and improves overlap; when EUs are idle a larger
workgroup maximises throughput. The advisor clamps recommendations to the
device’s [min, max] workgroup-size envelope and to powers of two (Intel
sub-group sizes are 8/16/32, so workgroup sizes are typically power-of-two
multiples).
Implementations§
Source§impl EuOccupancyAdvisor
impl EuOccupancyAdvisor
Sourcepub fn new(eu_count: u32, min_wg: u32, max_wg: u32) -> LevelZeroResult<Self>
pub fn new(eu_count: u32, min_wg: u32, max_wg: u32) -> LevelZeroResult<Self>
Create an advisor for a device with eu_count execution units and a
workgroup-size envelope of [min_wg, max_wg] (both powers of two).
Sourcepub fn recommend_workgroup_size(&self, utilisation: f64) -> u32
pub fn recommend_workgroup_size(&self, utilisation: f64) -> u32
Recommend a workgroup size given the current EU-utilisation fraction.
utilisation is clamped to [0, 1]. At full idle (0.0) the advisor
returns max_wg; at full saturation (1.0) it returns min_wg;
intermediate utilisations interpolate geometrically (halving per
quartile of busy-ness) and snap down to the nearest power of two within
the envelope.
Sourcepub fn estimated_resident_workgroups(
&self,
workgroup_size: u32,
subgroup_size: u32,
) -> u32
pub fn estimated_resident_workgroups( &self, workgroup_size: u32, subgroup_size: u32, ) -> u32
Estimate the number of concurrent workgroups the device can host for a
given workgroup size, assuming one sub-group of subgroup_size per EU
thread. This feeds the dispatch grid sizing.
Trait Implementations§
Source§impl Clone for EuOccupancyAdvisor
impl Clone for EuOccupancyAdvisor
Source§fn clone(&self) -> EuOccupancyAdvisor
fn clone(&self) -> EuOccupancyAdvisor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more