make it tolerant of TBB 2020 https://github.com/Project-OSRM/osrm-backend/pull/6493 Index: src/guidance/guidance_processing.cpp --- src/guidance/guidance_processing.cpp.orig +++ src/guidance/guidance_processing.cpp @@ -9,7 +9,11 @@ #include "util/percent.hpp" #include +#if TBB_VERSION_MAJOR == 2020 +#include +#else #include +#endif #include @@ -97,8 +101,13 @@ void annotateTurns(const util::NodeBasedDynamicGraph & const constexpr unsigned GRAINSIZE = 100; // First part of the pipeline generates iterator ranges of IDs in sets of GRAINSIZE +#if TBB_VERSION_MAJOR == 2020 + tbb::filter_t> generator_stage( + tbb::filter::serial_in_order, [&](tbb::flow_control &fc) { +#else tbb::filter> generator_stage( tbb::filter_mode::serial_in_order, [&](tbb::flow_control &fc) { +#endif if (current_node < node_count) { auto next_node = std::min(current_node + GRAINSIZE, node_count); @@ -116,8 +125,13 @@ void annotateTurns(const util::NodeBasedDynamicGraph & // // Guidance stage // +#if TBB_VERSION_MAJOR == 2020 + tbb::filter_t, TurnsPipelineBufferPtr> guidance_stage( + tbb::filter::parallel, +#else tbb::filter, TurnsPipelineBufferPtr> guidance_stage( tbb::filter_mode::parallel, +#endif [&](const tbb::blocked_range &intersection_node_range) { auto buffer = std::make_shared(); buffer->nodes_processed = intersection_node_range.size(); @@ -308,8 +322,13 @@ void annotateTurns(const util::NodeBasedDynamicGraph & util::Percent guidance_progress(log, node_count); std::vector delayed_turn_data; +#if TBB_VERSION_MAJOR == 2020 + tbb::filter_t guidance_output_stage( + tbb::filter::serial_in_order, [&](auto buffer) { +#else tbb::filter guidance_output_stage( tbb::filter_mode::serial_in_order, [&](auto buffer) { +#endif guidance_progress.PrintAddition(buffer->nodes_processed); connectivity_checksum = buffer->checksum.update_checksum(connectivity_checksum);