Skip to content

Commit

Permalink
Allow disabling of mutlithreading in simd op check (halide#8096)
Browse files Browse the repository at this point in the history
simd_op_check_xtensa is not threadsafe at present
  • Loading branch information
steven-johnson authored and ardier committed Mar 3, 2024
1 parent 90fb5f8 commit a205550
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/correctness/simd_op_check.h
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,10 @@ class SimdOpCheckTest {
return 16;
}

virtual bool use_multiple_threads() const {
return true;
}

virtual bool test_all() {
/* First add some tests based on the target */
add_tests();
Expand All @@ -460,7 +464,10 @@ class SimdOpCheckTest {

Sharder sharder;

Halide::Tools::ThreadPool<TestResult> pool;
Halide::Tools::ThreadPool<TestResult> pool(
use_multiple_threads() ?
Halide::Tools::ThreadPool<TestResult>::num_processors_online() :
1);
std::vector<std::future<TestResult>> futures;

for (size_t t = 0; t < tasks.size(); t++) {
Expand Down

0 comments on commit a205550

Please sign in to comment.