Skip to main content

split_on_grid_sync

Function split_on_grid_sync 

Source
pub fn split_on_grid_sync(program: &Program) -> Vec<Program>
Expand description

Split program at every top-level Node::Barrier { GridSync }.

Returns a vector of segments in execution order. The barrier nodes themselves are dropped from the segments - the kernel-launch boundary between segments takes their place.

Each returned segment is a complete Program that shares the original’s buffer table, workgroup size, and metadata; only the entry sequence changes. Segments without any executable nodes are preserved (an empty segment between two adjacent barriers becomes a no-op kernel that completes with byte-identical inputs and outputs).