Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grt: parallel getOverflow3D #5215

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

eder-matheus
Copy link
Collaborator

Completing PR #4636

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

src/grt/src/fastroute/src/maze.cpp Show resolved Hide resolved
Comment on lines +2461 to +2464
for (int iter = 0; iter < num_layers_ * y_grid_ * x_grid_; iter++) {
int k = iter / kstep;
int i = (iter % kstep) / istep;
int j = (iter % kstep) % istep;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It think it would be simpler to keep the original loop structure and apply collapse(2) to the prama. The original loop was over h_used_ggrid_ rather than all points.

Comment on lines +2465 to +2466
int overflow = h_edges_3D_[k][i][j].usage - h_edges_3D_[k][i][j].cap;
H_overflow += overflow > 0 ? overflow : 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find

      const auto& h_edge = h_edges_3D_[k][i][j];
      H_overflow += std::max(h_edge.usage - h_edge.cap, 0);

clearer. Likewise V

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants