Skip to content

Commit

Permalink
Merge pull request #2714 from heshpdx/master
Browse files Browse the repository at this point in the history
optimize computation in librrgraph utils
  • Loading branch information
vaughnbetz authored Sep 17, 2024
2 parents 7844044 + 734d54a commit f43e070
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libs/librrgraph/src/utils/alloc_and_load_rr_indexed_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,9 +678,10 @@ static void calculate_average_switch(const RRGraphView& rr_graph, int inode, dou
}

if (num_switches > 0) {
avg_switch_R /= num_switches;
avg_switch_T /= num_switches;
avg_switch_Cinternal /= num_switches;
double inv_num_switches = 1.0 / num_switches;
avg_switch_R *= inv_num_switches;
avg_switch_T *= inv_num_switches;
avg_switch_Cinternal *= inv_num_switches;
}

VTR_ASSERT(std::isfinite(avg_switch_R));
Expand Down

0 comments on commit f43e070

Please sign in to comment.