Skip to content

Commit bb674f3

Browse files
feat: parallelize C and Rust building step
1 parent 1fc1197 commit bb674f3

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

crates/intrinsic-test/src/arm/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ pub struct ArmArchitectureTest {
1818
cli_options: ProcessedCli,
1919
}
2020

21+
unsafe impl Send for ArmArchitectureTest {}
22+
unsafe impl Sync for ArmArchitectureTest {}
23+
2124
impl SupportedArchitectureTest for ArmArchitectureTest {
2225
type IntrinsicImpl = ArmIntrinsicType;
2326

crates/intrinsic-test/src/main.rs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,22 @@ fn main() {
2525
}
2626
}
2727

28-
fn run(test_environment: impl SupportedArchitectureTest) {
29-
info!("building C binaries");
30-
if !test_environment.build_c_file() {
28+
fn run(test_environment: impl SupportedArchitectureTest + Sync) {
29+
let (c_output, rust_output) = rayon::join(
30+
|| {
31+
info!("building C binaries");
32+
test_environment.build_c_file()
33+
},
34+
|| {
35+
info!("building Rust binaries");
36+
test_environment.build_rust_file()
37+
},
38+
);
39+
40+
if !c_output {
3141
std::process::exit(2);
3242
}
33-
info!("building Rust binaries");
34-
if !test_environment.build_rust_file() {
43+
if !rust_output {
3544
std::process::exit(3);
3645
}
3746
info!("Running binaries");

crates/intrinsic-test/src/x86/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ pub struct X86ArchitectureTest {
1818
cli_options: ProcessedCli,
1919
}
2020

21+
unsafe impl Send for X86ArchitectureTest {}
22+
unsafe impl Sync for X86ArchitectureTest {}
23+
2124
impl SupportedArchitectureTest for X86ArchitectureTest {
2225
type IntrinsicImpl = X86IntrinsicType;
2326

0 commit comments

Comments
 (0)