pub struct MultiTileDispatcher {
pub sub_devices: Vec<SubDeviceInfo>,
pub config: MultiTileConfig,
}Expand description
Enumerates Level Zero sub-devices and partitions matrix work across tiles.
On devices without sub-devices (single-tile GPUs), the dispatcher degrades gracefully to single-device behaviour — callers do not need to special-case this.
Fields§
§sub_devices: Vec<SubDeviceInfo>Discovered sub-devices. Empty means single-device fallback.
config: MultiTileConfigActive configuration.
Implementations§
Source§impl MultiTileDispatcher
impl MultiTileDispatcher
Sourcepub fn new(sub_devices: Vec<SubDeviceInfo>, config: MultiTileConfig) -> Self
pub fn new(sub_devices: Vec<SubDeviceInfo>, config: MultiTileConfig) -> Self
Construct a dispatcher with pre-discovered sub-device information.
Typically called by the backend after enumerating the Level Zero
device tree. Pass an empty sub_devices vec for single-tile GPUs.
Sourcepub fn single_device() -> Self
pub fn single_device() -> Self
Construct a single-device dispatcher (no sub-device enumeration).
Sourcepub fn tile_count(&self) -> usize
pub fn tile_count(&self) -> usize
Return how many tiles are available for dispatch.
Returns 1 when no sub-devices were discovered (single-tile path).
Sourcepub fn should_use_multi_tile(&self, m: usize) -> bool
pub fn should_use_multi_tile(&self, m: usize) -> bool
Return true when multi-tile dispatch should be used for a problem of
size m (number of output matrix rows).
Sourcepub fn partition(&self, m: usize) -> Vec<TileWorkSlice>
pub fn partition(&self, m: usize) -> Vec<TileWorkSlice>
Partition m rows across available tiles according to the configured
WorkDistribution strategy.
Returns a Vec<TileWorkSlice> with one entry per active tile. The
slices are non-overlapping and together cover the full [0, m) range.
If there are no sub-devices or m == 0, returns a single slice for
tile 0 covering the entire row range.
Sourcepub fn from_synthetic(names: &[&str]) -> Self
pub fn from_synthetic(names: &[&str]) -> Self
Simulate sub-device enumeration from a list of synthetic device names.
This is useful for unit tests that cannot call into Level Zero hardware.