ports/geo/osrm-backend/patches/patch-src_partitioner_recursive_bisection_cpp

27 lines
1.1 KiB
Text

make it tolerant of TBB 2020
https://github.com/Project-OSRM/osrm-backend/pull/6493
Index: src/partitioner/recursive_bisection.cpp
--- src/partitioner/recursive_bisection.cpp.orig
+++ src/partitioner/recursive_bisection.cpp
@@ -64,12 +64,20 @@ RecursiveBisection::RecursiveBisection(BisectionGraph
return TreeNode{std::move(graph), internal_state.SCCDepth()};
});
+#if TBB_VERSION_MAJOR == 2020
+ using Feeder = tbb::parallel_do_feeder<TreeNode>;
+#else
using Feeder = tbb::feeder<TreeNode>;
+#endif
TIMER_START(bisection);
// Bisect graph into two parts. Get partition point and recurse left and right in parallel.
+#if TBB_VERSION_MAJOR == 2020
+ tbb::parallel_do(begin(forest), end(forest), [&](const TreeNode &node, Feeder &feeder) {
+#else
tbb::parallel_for_each(begin(forest), end(forest), [&](const TreeNode &node, Feeder &feeder) {
+#endif
const auto cut =
computeInertialFlowCut(node.graph, num_optimizing_cuts, balance, boundary_factor);
const auto center = internal_state.ApplyBisection(