Skip to content

Commit c828d8c

Browse files
committed
Tests: check divergent block barriers in a_bridged_mask_write
1 parent 569f0fc commit c828d8c

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎crates/xcl/src/gpu/recomp/lower_dxil.rs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,9 +1150,10 @@ mod tests {
11501150
return runner::skip_test("no DXC");
11511151
}
11521152
let text = crate::gpu::dxil::validate::disassemble(&dxil).unwrap();
1153-
let barriers = text.lines().filter(|l| l.contains("call void @dx.op.barrier")).count();
1154-
// the one where the halves take their console lanes, at the start (every lane is there)
1155-
assert_eq!(barriers, 1, "group barriers in the program:\n{text}");
1153+
let (_, after_entry) = text.split_once("\n br ").unwrap_or_else(|| panic!("expected branch in program:\n{text}"));
1154+
let divergent_barriers = after_entry.lines().filter(|l| l.contains("call void @dx.op.barrier")).count();
1155+
// after the entry whole-wave branch, only one half reaches the body so no group barrier may appear there
1156+
assert_eq!(divergent_barriers, 0, "group barriers after entry branch:\n{text}");
11561157
if !gpu() {
11571158
return;
11581159
}

0 commit comments

Comments
 (0)