Skip to content

Commit

Permalink
cpp nits
Browse files Browse the repository at this point in the history
  • Loading branch information
pjanevskiTT committed Oct 28, 2024
1 parent 3e84f54 commit ae25601
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions tests/test_utils/soc_desc_test_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,9 @@
namespace test_utils {

static std::size_t get_num_harvested(std::size_t harvesting_mask) {
std::size_t num_harvested = 0;
while (harvesting_mask > 0) {
if (harvesting_mask & 1) {
num_harvested++;
}
harvesting_mask >>= 1;
}
return num_harvested;
// Counts the number of 1 bits in harvesting mask, effectively representing
// the number of harvested rows (Wormhole) or columns (Blackhole).
return __builtin_popcount(harvesting_mask);
}

}

0 comments on commit ae25601

Please sign in to comment.