Skip to content

Commit

Permalink
Fix integer overflow when accumulating timing values.
Browse files Browse the repository at this point in the history
  • Loading branch information
catree committed Nov 7, 2018
1 parent e75576e commit eebf0dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/dnn/src/dnn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3074,7 +3074,7 @@ void Net::setHalideScheduler(const String& scheduler)
int64 Net::getPerfProfile(std::vector<double>& timings)
{
timings = std::vector<double>(impl->layersTimings.begin() + 1, impl->layersTimings.end());
int64 total = std::accumulate(timings.begin(), timings.end(), 0);
int64 total = (int64)std::accumulate(timings.begin(), timings.end(), 0.0);
return total;
}

Expand Down

0 comments on commit eebf0dd

Please sign in to comment.