Skip to content

Commit 701f839

Browse files
committed
keep compatibility with old tbb
1 parent 0e5a4a8 commit 701f839

File tree

4 files changed

+21
-17
lines changed

4 files changed

+21
-17
lines changed

vpr/src/base/ShowSetup.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,9 @@ static void ShowRouterOpts(const t_router_opts& RouterOpts) {
432432

433433
VTR_LOG("RouterOpts.router_algorithm: ");
434434
switch (RouterOpts.router_algorithm) {
435+
case PARALLEL:
436+
VTR_LOG("PARALLEL\n");
437+
break;
435438
case TIMING_DRIVEN:
436439
VTR_LOG("TIMING_DRIVEN\n");
437440
break;

vpr/src/route/partition_tree.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ std::unique_ptr<PartitionTreeNode> PartitionTree::build_x(const Netlist<>& netli
2424
int score;
2525
/* TODO: maybe put all of this into a tuple or struct? */
2626
int best_score = std::numeric_limits<int>::max();
27-
int best_pos, best_left, best_right;
27+
int best_pos = -1, best_left = -1, best_right = -1;
2828
enum { X,
29-
Y } best_axis;
29+
Y } best_axis
30+
= X;
3031

3132
for (int x = x1 + 1; x < x2; x++) {
3233
left = right = mine = 0;

vpr/src/route/route_parallel.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
#include <iostream>
77
#include <tuple>
88

9-
#include "oneapi/tbb/enumerable_thread_specific.h"
10-
#include "oneapi/tbb/task_group.h"
11-
#include "oneapi/tbb/global_control.h"
9+
#include "tbb/enumerable_thread_specific.h"
10+
#include "tbb/task_group.h"
11+
#include "tbb/global_control.h"
1212

1313
#include "binary_heap.h"
1414
#include "bucket.h"
@@ -33,14 +33,14 @@
3333
template<typename ConnectionRouter>
3434
class RouteIterCtx {
3535
public:
36-
oneapi::tbb::enumerable_thread_specific<ConnectionRouter> routers;
36+
tbb::enumerable_thread_specific<ConnectionRouter> routers;
3737
const Netlist<>& net_list;
3838
int itry;
3939
float pres_fac;
4040
const t_router_opts& router_opts;
4141
CBRR& connections_inf;
42-
oneapi::tbb::enumerable_thread_specific<RouterStats> router_stats;
43-
oneapi::tbb::enumerable_thread_specific<timing_driven_route_structs> route_structs;
42+
tbb::enumerable_thread_specific<RouterStats> router_stats;
43+
tbb::enumerable_thread_specific<timing_driven_route_structs> route_structs;
4444
NetPinsMatrix<float>& net_delay;
4545
const ClusteredPinAtomPinsLookup& netlist_pin_lookup;
4646
std::shared_ptr<SetupHoldTimingInfo> timing_info;
@@ -307,13 +307,13 @@ bool try_parallel_route_tmpl(const Netlist<>& net_list,
307307
float total_prep_time = t.elapsed_sec();
308308
VTR_LOG("# Built partition tree in %f seconds\n", total_prep_time);
309309

310-
oneapi::tbb::global_control c(oneapi::tbb::global_control::max_allowed_parallelism, max_workers);
311-
oneapi::tbb::task_group tbb_task_group;
310+
tbb::global_control c(tbb::global_control::max_allowed_parallelism, max_workers);
311+
tbb::task_group tbb_task_group;
312312

313313
/* Set up thread local storage.
314314
* tbb::enumerable_thread_specific will construct the elements as needed.
315315
* see https://spec.oneapi.io/versions/1.0-rev-3/elements/oneTBB/source/thread_local_storage/enumerable_thread_specific_cls/construct_destroy_copy.html */
316-
auto routers = oneapi::tbb::enumerable_thread_specific<ConnectionRouter>(ConnectionRouter(
316+
auto routers = tbb::enumerable_thread_specific<ConnectionRouter>(ConnectionRouter(
317317
device_ctx.grid,
318318
*router_lookahead,
319319
device_ctx.rr_graph.rr_nodes(),
@@ -322,8 +322,8 @@ bool try_parallel_route_tmpl(const Netlist<>& net_list,
322322
device_ctx.rr_graph.rr_switch(),
323323
route_ctx.rr_node_route_inf,
324324
is_flat)); /* Here we provide an "exemplar" to copy for each thread */
325-
auto router_stats_thread = oneapi::tbb::enumerable_thread_specific<RouterStats>();
326-
auto route_structs = oneapi::tbb::enumerable_thread_specific<timing_driven_route_structs>(net_list);
325+
auto router_stats_thread = tbb::enumerable_thread_specific<RouterStats>();
326+
auto route_structs = tbb::enumerable_thread_specific<timing_driven_route_structs>(net_list);
327327

328328
RouterStats router_stats;
329329
float prev_iter_cumm_time = 0;
@@ -857,7 +857,7 @@ NetResultFlags try_parallel_route_net(ConnectionRouter& router,
857857
}
858858

859859
template<typename ConnectionRouter>
860-
void route_partition_tree_x(oneapi::tbb::task_group& g,
860+
void route_partition_tree_x(tbb::task_group& g,
861861
PartitionTreeNode& node,
862862
RouteIterCtx<ConnectionRouter>& ctx,
863863
vtr::linear_map<ParentNetId, int>& nets_to_retry) {
@@ -938,7 +938,7 @@ static void reduce_partition_tree_x(const PartitionTreeNode& node, RouteIterResu
938938

939939
/** Route all nets in parallel using the partitioning information in the PartitionTree. */
940940
template<typename ConnectionRouter>
941-
RouteIterResults route_partition_tree(oneapi::tbb::task_group& g,
941+
RouteIterResults route_partition_tree(tbb::task_group& g,
942942
PartitionTree& tree,
943943
RouteIterCtx<ConnectionRouter>& ctx) {
944944
auto& device_ctx = g_vpr_ctx.device();

vpr/src/timing/timing_util.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ float calc_relaxed_criticality(const std::map<DomainPair, float>& domains_max_re
800800
VTR_ASSERT_SAFE_MSG(!std::isnan(crit), "Criticality not be nan");
801801
VTR_ASSERT_SAFE_MSG(std::isfinite(crit), "Criticality should not be infinite");
802802
VTR_ASSERT_MSG(crit >= 0. - CRITICALITY_ROUND_OFF_TOLERANCE, "Criticality should never be negative");
803-
VTR_ASSERT_MSG(crit <= 1. + CRITICALITY_ROUND_OFF_TOLERANCE, "Criticality should never be greather than one");
803+
VTR_ASSERT_MSG(crit <= 1. + CRITICALITY_ROUND_OFF_TOLERANCE, "Criticality should never be greater than one");
804804

805805
//Clamp criticality to [0., 1.] to correct round-off
806806
crit = std::max(0.f, crit);
@@ -809,7 +809,7 @@ float calc_relaxed_criticality(const std::map<DomainPair, float>& domains_max_re
809809
max_crit = std::max(max_crit, crit);
810810
}
811811
VTR_ASSERT_MSG(max_crit >= 0., "Criticality should never be negative");
812-
VTR_ASSERT_MSG(max_crit <= 1., "Criticality should never be greather than one");
812+
VTR_ASSERT_MSG(max_crit <= 1., "Criticality should never be greater than one");
813813

814814
return max_crit;
815815
}

0 commit comments

Comments
 (0)