diff --git a/src/db/db/db.pro b/src/db/db/db.pro index d316c1c60..1c1285342 100644 --- a/src/db/db/db.pro +++ b/src/db/db/db.pro @@ -454,3 +454,7 @@ INCLUDEPATH += $$TL_INC $$GSI_INC DEPENDPATH += $$TL_INC $$GSI_INC LIBS += -L$$DESTDIR -lklayout_tl -lklayout_gsi +packagesExist(tbb) { + LIBS += -ltbb +} + diff --git a/src/db/db/dbEdgeProcessor.cc b/src/db/db/dbEdgeProcessor.cc index b50f83cf4..a9f73666b 100644 --- a/src/db/db/dbEdgeProcessor.cc +++ b/src/db/db/dbEdgeProcessor.cc @@ -1,3 +1,14 @@ +#if __cplusplus >= 201703L + #if __has_include() + #include + #endif +#endif + +#if defined(__cpp_lib_execution) +#define PARALLEL_EXEC_POLICY std::execution::par, +#else +#define PARALLEL_EXEC_POLICY +#endif /* @@ -29,6 +40,7 @@ #include "tlProgress.h" #include "gsi.h" + #include #include #include @@ -2237,7 +2249,7 @@ EdgeProcessor::redo_or_process (const std::vectorbegin (), mp_work_edges->end (), edge_ymin_compare ()); + std::sort (PARALLEL_EXEC_POLICY mp_work_edges->begin (), mp_work_edges->end (), edge_ymin_compare ()); y = edge_ymin ((*mp_work_edges) [0]); future = mp_work_edges->begin (); @@ -2422,7 +2434,7 @@ EdgeProcessor::redo_or_process (const std::vectorbegin (), mp_work_edges->end (), edge_ymin_compare ()); + std::sort (PARALLEL_EXEC_POLICY mp_work_edges->begin (), mp_work_edges->end (), edge_ymin_compare ()); y = edge_ymin ((*mp_work_edges) [0]); diff --git a/src/db/db/dbPolygonTools.cc b/src/db/db/dbPolygonTools.cc index a5a63cd6c..849e0a154 100644 --- a/src/db/db/dbPolygonTools.cc +++ b/src/db/db/dbPolygonTools.cc @@ -1,3 +1,14 @@ +#if __cplusplus >= 201703L + #if __has_include() + #include + #endif +#endif + +#if defined(__cpp_lib_execution) +#define PARALLEL_EXEC_POLICY std::execution::par, +#else +#define PARALLEL_EXEC_POLICY +#endif /* @@ -28,6 +39,7 @@ #include "tlLog.h" #include "tlInt128Support.h" + #include #include #include @@ -1838,7 +1850,7 @@ rasterize_impl (const db::polygon &polygon, db::area_map &am) } // sort edges - std::sort (edges.begin (), edges.end (), db::edge_ymin_compare ()); + std::sort (PARALLEL_EXEC_POLICY edges.begin (), edges.end (), db::edge_ymin_compare ()); typename std::vector ::iterator c = edges.begin (); @@ -2761,7 +2773,7 @@ decompose_convex_to_trapezoids (const db::SimplePolygon &sp, bool horizontal, db } } - std::sort (edges.begin (), edges.end (), db::edge_ymin_compare ()); + std::sort (PARALLEL_EXEC_POLICY edges.begin (), edges.end (), db::edge_ymin_compare ()); db::Coord y = db::edge_ymin (edges.front ());