Skip to content

Commit 6c892fd

Browse files
committed
difftest runner: append multiple output buffers instead of just using the first one
1 parent 73ab877 commit 6c892fd

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

tests/difftests/tests/lib/src/scaffold/compute/wgpu_runner.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -225,15 +225,16 @@ where
225225

226226
pub fn run_test(self, config: &Config) -> anyhow::Result<()> {
227227
let outputs = self.run()?;
228-
// Write the first storage buffer output to the file.
229-
for output in &outputs {
230-
if let Some(output) = output {
231-
if !output.is_empty() {
232-
config.write_result(output)?;
233-
return Ok(());
234-
}
235-
}
228+
let output = outputs
229+
.iter()
230+
.filter_map(Option::as_ref)
231+
.flatten()
232+
.copied()
233+
.collect::<Vec<_>>();
234+
if output.is_empty() {
235+
anyhow::bail!("No storage buffer output found")
236236
}
237-
anyhow::bail!("No storage buffer output found")
237+
config.write_result(&output)?;
238+
Ok(())
238239
}
239240
}

0 commit comments

Comments
 (0)