Skip to content

Commit

Permalink
Make Determinism Truly Deterministic
Browse files Browse the repository at this point in the history
  • Loading branch information
zalo committed Dec 22, 2023
1 parent d615ecf commit 2bfe002
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/manifold/src/csg_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,12 @@ Manifold::Impl CsgLeafNode::Compose(

// if we are already parallelizing for each node, do not perform multithreaded
// copying as it will slightly hurt performance
if (nodes.size() > 1 && policy == ExecutionPolicy::Par)
if ((nodes.size() > 1 && policy == ExecutionPolicy::Par) ||
ManifoldParams().deterministic)
policy = ExecutionPolicy::Seq;

for_each_n(
nodes.size() > 1 ? ExecutionPolicy::Par : ExecutionPolicy::Seq,
!ManifoldParams().deterministic && nodes.size() > 1 ? ExecutionPolicy::Par : ExecutionPolicy::Seq,
countAt(0), nodes.size(),
[&nodes, &vertIndices, &edgeIndices, &triIndices, &propVertIndices,
numPropOut, &combined, policy](int i) {
Expand Down

0 comments on commit 2bfe002

Please sign in to comment.