Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/intrinsic-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ case "${TARGET}" in
;;
esac

cargo test --manifest-path=rust_programs/Cargo.toml --target "${TARGET}" --profile "${PROFILE}"
Copy link
Copy Markdown
Contributor

@sayantn sayantn May 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this just remnant from local trials?

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, adding --tests avoids attempting to run doc tests on each mod_n crate

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ok I see. Thanks

cargo test --manifest-path=rust_programs/Cargo.toml --target "${TARGET}" --profile "${PROFILE}" --tests
12 changes: 7 additions & 5 deletions crates/intrinsic-test/src/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ pub trait SupportedArchitectureTest {
fn arch_flags(&self) -> Vec<&str>;

fn generate_c_file(&self) {
let (chunk_size, _chunk_count) = manual_chunk(self.intrinsics().len());
let (max_chunk_size, _chunk_count) = manual_chunk(self.intrinsics().len());

std::fs::create_dir_all("c_programs").unwrap();
self.intrinsics()
.par_chunks(chunk_size)
.par_chunks(max_chunk_size)
.enumerate()
.map(|(i, chunk)| {
let c_filename = format!("c_programs/wrapper_{i}.c");
Expand All @@ -62,13 +62,13 @@ pub trait SupportedArchitectureTest {

std::fs::create_dir_all("rust_programs").unwrap();

let (chunk_size, chunk_count) = manual_chunk(self.intrinsics().len());
let (max_chunk_size, chunk_count) = manual_chunk(self.intrinsics().len());

let mut cargo = File::create("rust_programs/Cargo.toml").unwrap();
write_bin_cargo_toml(&mut cargo, chunk_count).unwrap();

self.intrinsics()
.chunks(chunk_size)
.chunks(max_chunk_size)
.enumerate()
.map(|(i, chunk)| {
std::fs::create_dir_all(format!("rust_programs/mod_{i}/src"))?;
Expand Down Expand Up @@ -109,5 +109,7 @@ pub trait SupportedArchitectureTest {

pub fn manual_chunk(intrinsic_count: usize) -> (usize, usize) {
let ncores = std::thread::available_parallelism().unwrap().into();
(intrinsic_count.div_ceil(ncores), ncores)
let max_intrinsics_per_chunk = intrinsic_count.div_ceil(ncores);
let number_of_chunks = intrinsic_count.div_ceil(max_intrinsics_per_chunk);
(max_intrinsics_per_chunk, number_of_chunks)
}
Loading