Skip to content

Commit

Permalink
Address review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
sarathnandu committed Oct 28, 2024
1 parent 5067fc3 commit 3a60d1a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions examples/common/utility/utility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,7 @@ class measurements {
}
double computeRelError() {
// Accumulate the total duration in microseconds using std::accumulate with a lambda function
if (0 == _time_intervals.size()) {
std::cout << "No time samples collected \n";
return 0;
}
assert(0 != _time_intervals.size());
auto total_duration = std::accumulate(
_time_intervals.begin(),
_time_intervals.end(),
Expand All @@ -391,12 +388,12 @@ class measurements {
interval.second - interval.first)
.count();
});
long long averageTimePerFrame = total_duration / _time_intervals.size();
long long sumOfSquareDiff = 0;
unsigned long long averageTimePerFrame = total_duration / _time_intervals.size();
unsigned long long sumOfSquareDiff = 0;
std::for_each(_time_intervals.begin(),
_time_intervals.end(),
[&](const std::pair<time_point, time_point>& interval) {
long long duration =
unsigned long long duration =
std::chrono::duration_cast<std::chrono::microseconds>(
interval.second - interval.first)
.count();
Expand Down
2 changes: 1 addition & 1 deletion examples/parallel_for/seismic/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ int main(int argc, char *argv[]) {
std::cout << "Substituting 1000 for unlimited frames because not running interactively"
<< "\n";
}
// TODO : Extend utility::cli_argument_pack() toallow specifying the default value.
// TODO : Extend utility::cli_argument_pack() to allow specifying the default value.
if (options.numberofIterations == 0) {
options.numberofIterations = 10;
std::cout << "Setting the number of iterations = 10 default"
Expand Down

0 comments on commit 3a60d1a

Please sign in to comment.