Skip to content

Commit

Permalink
#0: fix alloc after harvesting row
Browse files Browse the repository at this point in the history
  • Loading branch information
yugaoTT committed Jun 3, 2024
1 parent 16eae04 commit b8f5f53
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,28 @@ void get_dram_reader_core_coords_wormhole_b0(
if (std::find(harvested_rows.begin(), harvested_rows.end(), y) != harvested_rows.end() ||
std::count(group_y.begin(), group_y.end(), y) >= 2) {
auto adjust_coord = [&](int start, int end, int step) {
bool found_new_row = false;
for (int j = start; step > 0 ? j <= end : j >= end; j += step) {
if (std::find(harvested_rows.begin(), harvested_rows.end(), j) == harvested_rows.end() &&
std::count(group_y.begin(), group_y.end(), j) == 0) {
coord.y = j;
coord.x += x_step;
x_step--;
found_new_row = true;
break;
}
}
if (not found_new_row) {
for (int j = start; step > 0 ? j <= end : j >= end; j += step) {
if (std::find(harvested_rows.begin(), harvested_rows.end(), j) == harvested_rows.end()) {
coord.y = j;
coord.x += x_step;
x_step--;
found_new_row = true;
break;
}
}
}
};

if (y >= max_bank_id) {
Expand Down

0 comments on commit b8f5f53

Please sign in to comment.