Formatting woes

This commit is contained in:
Connor Fitzgerald
2021-07-02 00:11:58 -04:00
parent a336c9e160
commit 2bdc54ad32
2 changed files with 79 additions and 52 deletions

View File

@@ -8,75 +8,102 @@ use common::{initialize_test, TestParameters};
#[test]
fn test_compute_1() {
initialize_test(TestParameters::default().specific_failure(Some(wgpu::Backends::GL), None, Some("V3D"), false), |ctx| {
let input = &[1, 2, 3, 4];
initialize_test(
TestParameters::default().specific_failure(
Some(wgpu::Backends::GL),
None,
Some("V3D"),
false,
),
|ctx| {
let input = &[1, 2, 3, 4];
pollster::block_on(assert_execute_gpu(
&ctx.device,
&ctx.queue,
input,
&[0, 1, 7, 2],
));
});
pollster::block_on(assert_execute_gpu(
&ctx.device,
&ctx.queue,
input,
&[0, 1, 7, 2],
));
},
);
}
#[test]
fn test_compute_2() {
initialize_test(TestParameters::default().specific_failure(Some(wgpu::Backends::GL), None, Some("V3D"), false), |ctx| {
let input = &[5, 23, 10, 9];
initialize_test(
TestParameters::default().specific_failure(
Some(wgpu::Backends::GL),
None,
Some("V3D"),
false,
),
|ctx| {
let input = &[5, 23, 10, 9];
pollster::block_on(assert_execute_gpu(
&ctx.device,
&ctx.queue,
input,
&[5, 15, 6, 19],
));
});
pollster::block_on(assert_execute_gpu(
&ctx.device,
&ctx.queue,
input,
&[5, 15, 6, 19],
));
},
);
}
#[test]
fn test_compute_overflow() {
initialize_test(TestParameters::default().specific_failure(Some(wgpu::Backends::GL), None, Some("V3D"), false), |ctx| {
let input = &[77031, 837799, 8400511, 63728127];
pollster::block_on(assert_execute_gpu(
&ctx.device,
&ctx.queue,
input,
&[350, 524, OVERFLOW, OVERFLOW],
));
});
initialize_test(
TestParameters::default().specific_failure(
Some(wgpu::Backends::GL),
None,
Some("V3D"),
false,
),
|ctx| {
let input = &[77031, 837799, 8400511, 63728127];
pollster::block_on(assert_execute_gpu(
&ctx.device,
&ctx.queue,
input,
&[350, 524, OVERFLOW, OVERFLOW],
));
},
);
}
#[test]
fn test_multithreaded_compute() {
initialize_test(TestParameters::default().backend_failures(wgpu::Backends::GL), |ctx| {
use std::{sync::mpsc, thread, time::Duration};
initialize_test(
TestParameters::default().backend_failures(wgpu::Backends::GL),
|ctx| {
use std::{sync::mpsc, thread, time::Duration};
let ctx = Arc::new(ctx);
let ctx = Arc::new(ctx);
let thread_count = 8;
let thread_count = 8;
let (tx, rx) = mpsc::channel();
for _ in 0..thread_count {
let tx = tx.clone();
let ctx = Arc::clone(&ctx);
thread::spawn(move || {
let input = &[100, 100, 100];
pollster::block_on(assert_execute_gpu(
&ctx.device,
&ctx.queue,
input,
&[25, 25, 25],
));
tx.send(true).unwrap();
});
}
let (tx, rx) = mpsc::channel();
for _ in 0..thread_count {
let tx = tx.clone();
let ctx = Arc::clone(&ctx);
thread::spawn(move || {
let input = &[100, 100, 100];
pollster::block_on(assert_execute_gpu(
&ctx.device,
&ctx.queue,
input,
&[25, 25, 25],
));
tx.send(true).unwrap();
});
}
for _ in 0..thread_count {
rx.recv_timeout(Duration::from_secs(10))
.expect("A thread never completed.");
}
});
for _ in 0..thread_count {
rx.recv_timeout(Duration::from_secs(10))
.expect("A thread never completed.");
}
},
);
}
async fn assert_execute_gpu(

View File

@@ -512,7 +512,7 @@ fn skybox_astc() {
height: 768,
optional_features: wgpu::Features::TEXTURE_COMPRESSION_ASTC_LDR,
base_test_parameters: framework::test_common::TestParameters::default(),
tolerance: 5, // TODO
tolerance: 5, // TODO
max_outliers: 10, // TODO
});
}