This commit is contained in:
Niko Savola 2026-06-08 21:22:39 +02:00 committed by GitHub
commit 4cb06aa755
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 32 additions and 4 deletions

View File

@ -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
}

View File

@ -1,3 +1,14 @@
#if __cplusplus >= 201703L
#if __has_include(<execution>)
#include <execution>
#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 <vector>
#include <deque>
#include <memory>
@ -2237,7 +2249,7 @@ EdgeProcessor::redo_or_process (const std::vector<std::pair<db::EdgeSink *, db::
} else {
// step 2: find intersections
std::sort (mp_work_edges->begin (), mp_work_edges->end (), edge_ymin_compare<db::Coord> ());
std::sort (PARALLEL_EXEC_POLICY mp_work_edges->begin (), mp_work_edges->end (), edge_ymin_compare<db::Coord> ());
y = edge_ymin ((*mp_work_edges) [0]);
future = mp_work_edges->begin ();
@ -2422,7 +2434,7 @@ EdgeProcessor::redo_or_process (const std::vector<std::pair<db::EdgeSink *, db::
gs.reset ();
gs.reserve (n_props);
std::sort (mp_work_edges->begin (), mp_work_edges->end (), edge_ymin_compare<db::Coord> ());
std::sort (PARALLEL_EXEC_POLICY mp_work_edges->begin (), mp_work_edges->end (), edge_ymin_compare<db::Coord> ());
y = edge_ymin ((*mp_work_edges) [0]);

View File

@ -1,3 +1,14 @@
#if __cplusplus >= 201703L
#if __has_include(<execution>)
#include <execution>
#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 <algorithm>
#include <cmath>
#include <limits>
@ -1838,7 +1850,7 @@ rasterize_impl (const db::polygon<C> &polygon, db::area_map<C> &am)
}
// sort edges
std::sort (edges.begin (), edges.end (), db::edge_ymin_compare<C> ());
std::sort (PARALLEL_EXEC_POLICY edges.begin (), edges.end (), db::edge_ymin_compare<C> ());
typename std::vector <edge_type>::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<db::Coord> ());
std::sort (PARALLEL_EXEC_POLICY edges.begin (), edges.end (), db::edge_ymin_compare<db::Coord> ());
db::Coord y = db::edge_ymin (edges.front ());