c++20, 23 compatibility

Signed-off-by: James Cherry <cherry@parallaxsw.com>
This commit is contained in:
James Cherry 2024-11-14 10:53:20 -08:00
parent 3f526873a3
commit 7ef084e4c6
2 changed files with 4 additions and 3 deletions

View File

@ -1516,7 +1516,7 @@ DmpCeffDelayCalc::gateDelay(const Pin *drvr_pin,
dcalc_result.setGateDelay(gate_delay);
dcalc_result.setDrvrSlew(drvr_slew);
for (const auto [load_pin, load_idx] : load_pin_index_map) {
for (const auto &[load_pin, load_idx] : load_pin_index_map) {
ArcDelay wire_delay;
Slew load_slew;
loadDelaySlew(load_pin, drvr_slew, rf, drvr_library, parasitic,

View File

@ -190,14 +190,15 @@ BfsIterator::visitParallel(Level to_level,
else {
size_t from = 0;
size_t chunk_size = vertex_count / thread_count;
BfsIndex bfs_index = bfs_index_;
for (size_t k = 0; k < thread_count; k++) {
// Last thread gets the left overs.
size_t to = (k == thread_count - 1) ? vertex_count : from + chunk_size;
dispatch_queue_->dispatch( [&](int) {
dispatch_queue_->dispatch( [=](int) {
for (size_t i = from; i < to; i++) {
Vertex *vertex = level_vertices[i];
if (vertex) {
vertex->setBfsInQueue(bfs_index_, false);
vertex->setBfsInQueue(bfs_index, false);
visitors[k]->visit(vertex);
}
}