Skip to content

Commit

Permalink
change stats output destination coord format
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrady-tt committed Feb 7, 2025
1 parent edd504d commit 81b736b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tt_npe/cpp/src/npeStats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,17 @@ void npeStats::emitSimStatsToFile(
nlohmann::json transfer;
transfer["id"] = tr.params.getID();
transfer["src"] = {tr.params.src.row, tr.params.src.col};
transfer["dst"] = nlohmann::json::array();
if (std::holds_alternative<Coord>(tr.params.dst)) {
auto dst = std::get<Coord>(tr.params.dst);
transfer["dst"] = {dst.row, dst.col};
transfer["dst"].push_back({dst.row, dst.col});
} else {
auto [start_coord, end_coord] = std::get<MCastCoordPair>(tr.params.dst);
transfer["dst"] = {{start_coord.row, start_coord.col}, {end_coord.row, end_coord.col}};
auto mcast_pair = std::get<MCastCoordPair>(tr.params.dst);
for (const auto &c : mcast_pair) {
if (model.getCoreType(c) == CoreType::WORKER) {
transfer["dst"].push_back({c.row, c.col});
}
}
}
transfer["total_bytes"] = tr.params.total_bytes;
transfer["noc_type"] = magic_enum::enum_name(tr.params.noc_type);
Expand Down

0 comments on commit 81b736b

Please sign in to comment.