Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/db/db/db.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

16 changes: 14 additions & 2 deletions src/db/db/dbEdgeProcessor.cc
Original file line number Diff line number Diff line change
@@ -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

/*

Expand Down Expand Up @@ -29,6 +40,7 @@
#include "tlProgress.h"
#include "gsi.h"


#include <vector>
#include <deque>
#include <memory>
Expand Down Expand Up @@ -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 ();
Expand Down Expand Up @@ -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]);

Expand Down
16 changes: 14 additions & 2 deletions src/db/db/dbPolygonTools.cc
Original file line number Diff line number Diff line change
@@ -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

/*

Expand Down Expand Up @@ -28,6 +39,7 @@
#include "tlLog.h"
#include "tlInt128Support.h"


#include <algorithm>
#include <cmath>
#include <limits>
Expand Down Expand Up @@ -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 ();

Expand Down Expand Up @@ -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 ());

Expand Down
Loading