Skip to content

Commit

Permalink
#0: Add grid_size() to CoreRange
Browse files Browse the repository at this point in the history
  • Loading branch information
TT-BrianLiu committed Jan 25, 2024
1 parent 66d2a9b commit cff69f7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tt_metal/common/core_coord.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ struct CoreRange {
std::string str() const { return "[" + start.str() + " - " + end.str() + "]"; }

size_t size() const { return (this->end.x - this->start.x + 1) * (this->end.y - this->start.y + 1); }

CoreCoord grid_size() const { return {this->end.x - this->start.x + 1, this->end.y - this->start.y + 1}; }
};

constexpr inline bool operator==(const CoreRange &a, const CoreRange &b) { return a.start == b.start && a.end == b.end; }
Expand Down

0 comments on commit cff69f7

Please sign in to comment.