Skip to content

Commit

Permalink
Explicitly fail if multicore is enabled for wasm32 without atomics
Browse files Browse the repository at this point in the history
`maybe-rayon` has this case fall back to not using rayon, which while
correct is potentially confusingly non-performant. Developers building
for WASM will have similar things they need to handle themselves; they
can conditionally enable `multicore` there.
  • Loading branch information
str4d committed Feb 14, 2023
1 parent 5ff0e83 commit b60e9a4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions halo2_proofs/src/multicore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
//! `halo2`. It's currently just a (very!) thin wrapper around `rayon` but may
//! be extended in the future to allow for various parallelism strategies.

#[cfg(all(
feature = "multicore",
target_arch = "wasm32",
not(target_feature = "atomics")
))]
compile_error!(
"The multicore feature flag is not supported on wasm32 architectures without atomics"
);

pub use maybe_rayon::{
iter::{IntoParallelIterator, ParallelIterator},
join, scope, Scope,
Expand Down

0 comments on commit b60e9a4

Please sign in to comment.