mirror of
https://github.com/opencv/opencv.git
synced 2025-08-02 03:06:29 +08:00
Fix integer overflow when accumulating timing values.
This commit is contained in:
parent
e75576e1ab
commit
eebf0dd7c9
@ -3074,7 +3074,7 @@ void Net::setHalideScheduler(const String& scheduler)
|
|||||||
int64 Net::getPerfProfile(std::vector<double>& timings)
|
int64 Net::getPerfProfile(std::vector<double>& timings)
|
||||||
{
|
{
|
||||||
timings = std::vector<double>(impl->layersTimings.begin() + 1, impl->layersTimings.end());
|
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;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user