Skip to content

Commit

Permalink
consider 1690 multi-core cycle calc
Browse files Browse the repository at this point in the history
Change-Id: Id513b9f8392e537ff622b8465e9dd9eac5a197ae
  • Loading branch information
haozhe.yang committed May 27, 2024
1 parent ddf61b1 commit be3c8c6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Dialect/Tpu/Transforms/LayerGroup/CycleCalculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,10 @@ int64_t CycleCalculator::getGroupCycle(BasicTimeStepPtr &time_step,
std::vector<layer_cycle_info_t> layer_cycle;
std::vector<gdma_cycle_info_t> gdma_cycle;
bool enable_multi_core = false;
if (module::getCoreNum() == 2 && loop_num > 1) {
auto num_core = module::getCoreNum();
if (num_core > 1 && (loop_num / shape_secs.wsecs) > 1) {
enable_multi_core = true;
loop_num = loop_num / 2 + loop_num % 2;
loop_num = loop_num / num_core + loop_num % num_core;
}

int64_t filling_cycle = 0, kernel_cycle = 0, draining_cycle = 0;
Expand Down

0 comments on commit be3c8c6

Please sign in to comment.