Skip to content

Commit

Permalink
oops
Browse files Browse the repository at this point in the history
  • Loading branch information
jdolence committed Nov 2, 2023
1 parent 908d666 commit bbef708
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/block_timer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ class BlockTimerHost {
BlockTimerHost(const std::vector<double> &cost, const int bs, const int be)
: cost_(cost), bs_(bs), be_(be), start_(Kokkos::Impl::clock_tic()) {}
void Stop() const {
auto stop = Kokkos::Impl::clock_tick();
auto stop = Kokkos::Impl::clock_tic();
// deal with overflow of clock
auto diff =
(stop < start_
? static_cast<double>(std::numeric_limits<uint64_t>::max() - start_) +
static_cast<double>(stop)
: static_cast<double>(stop - start_));
auto cost_per_block = diff / (be - bs + 1);
for (int b = bs; b <= be; b++)
auto cost_per_block = diff / (be_ - bs_ + 1);
for (int b = bs_; b <= be_; b++)
cost_[b] += cost_per_block;
}

Expand Down

0 comments on commit bbef708

Please sign in to comment.