Advertisement
acomodi

Untitled

May 6th, 2019
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. 760 t_type_ptr find_most_common_block_type(const DeviceGrid& grid) {
  2. 761     auto& device_ctx = g_vpr_ctx.device();
  3. 762
  4. 763     t_type_ptr max_type = nullptr;
  5. 764     size_t max_count = 0;
  6. 765     for (int itype = 0; itype < device_ctx.num_block_types; ++itype) {
  7. 766         t_type_ptr type = &device_ctx.block_types[itype];
  8. 767
  9. 768         size_t inst_cnt = grid.num_instances(type);
  10. 769         if (max_count < inst_cnt) {
  11. 770             max_count = inst_cnt;
  12. 771             max_type = type;
  13. 772         }
  14. 773     }
  15. 774
  16. 775     VTR_ASSERT(max_type);
  17. 776     return max_type;
  18. 777 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement