mirror of https://github.com/CGAL/cgal
fix mutex version
This commit is contained in:
parent
b8b7f6354e
commit
bd0e60e950
|
|
@ -1490,11 +1490,13 @@ bool autorefine_triangle_soup(PointRange& soup_points,
|
|||
[&](const tbb::blocked_range<size_t>& r) {
|
||||
for (size_t ti = r.begin(); ti != r.end(); ++ti) {
|
||||
const std::array<EK::Point_3, 3>& t = new_triangles[ti].first;
|
||||
visitor.new_subtriangle(offset+ti, tri_inter_ids_inverse[new_triangles[ti].second]);
|
||||
triangle_buffer[ti] = CGAL::make_array(concurrent_get_point_id(t[0]), concurrent_get_point_id(t[1]), concurrent_get_point_id(t[2]));
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// The constexpr was initially inside the lambda, but that did not compile with VC 2017
|
||||
if constexpr(std::is_same_v<Visitor, Wrap_snap_visitor>){
|
||||
tbb::parallel_for(tbb::blocked_range<size_t>(0, new_triangles.size()),
|
||||
[&](const tbb::blocked_range<size_t>& r) {
|
||||
for (size_t ti = r.begin(); ti != r.end(); ++ti)
|
||||
|
|
@ -1503,10 +1505,26 @@ bool autorefine_triangle_soup(PointRange& soup_points,
|
|||
{ triangle_buffer[ti][0]->second,
|
||||
triangle_buffer[ti][1]->second,
|
||||
triangle_buffer[ti][2]->second };
|
||||
visitor.new_subtriangle(soup_triangles_out[offset + ti], soup_triangle[tri_inter_ids_inverse[new_triangles[ti].second]]);
|
||||
visitor.new_subdivision(soup_triangles_out[offset + ti], soup_triangles[tri_inter_ids_inverse[new_triangles[ti].second]]);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
tbb::parallel_for(tbb::blocked_range<size_t>(0, new_triangles.size()),
|
||||
[&](const tbb::blocked_range<size_t>& r) {
|
||||
for (size_t ti = r.begin(); ti != r.end(); ++ti)
|
||||
{
|
||||
soup_triangles_out[offset + ti] =
|
||||
{ triangle_buffer[ti][0]->second,
|
||||
triangle_buffer[ti][1]->second,
|
||||
triangle_buffer[ti][2]->second };
|
||||
visitor.new_subtriangle(offset+ti, tri_inter_ids_inverse[new_triangles[ti].second]);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
#else
|
||||
//option 2 (without mutex)
|
||||
/// Lambda concurrent_get_point_id()
|
||||
|
|
|
|||
Loading…
Reference in New Issue