Skip to content

Commit

Permalink
tenstorrent#11881: Remove VLA and switch to vector for CoreRangeSet::…
Browse files Browse the repository at this point in the history
…merge
  • Loading branch information
tt-aho committed Jan 22, 2025
1 parent 244460b commit 78f2c0b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tt_metal/common/core_coord.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,12 @@ CoreRangeSet CoreRangeSet::merge(const T& other) const {
// By overallocating by one x entry, we can avoid needing to check for
// boundary conditions when iterating, since there'll always be one
// last false entry
bool grid[max_y + 1][max_x + 2];
memset(grid, 0, sizeof(grid));
std::vector<std::vector<uint8_t>> grid(max_y + 1, std::vector<uint8_t>(max_x + 2, 0));

for (const auto& cr : crs) {
for (unsigned y = cr.start_coord.y; y <= cr.end_coord.y; y++) {
for (unsigned x = cr.start_coord.x; x <= cr.end_coord.x; x++) {
grid[y][x] = true;
grid[y][x] = 1;
}
}
}
Expand Down

0 comments on commit 78f2c0b

Please sign in to comment.