Skip to content

Commit 442026a

Browse files
Merge pull request #318 from igchor/fix_mt
Fix mt benchmark compilation on windows
2 parents d6d0291 + f523da5 commit 442026a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

benchmark/multithread.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static void mt_alloc_free(poolCreateExtParams params,
8484
std::cout << "mean: " << umf_bench::mean(values)
8585
<< " [ms] std_dev: " << umf_bench::std_dev(values) << " [ms]"
8686
<< " (total alloc failures: "
87-
<< std::accumulate(numFailures.begin(), numFailures.end(), 0)
87+
<< std::accumulate(numFailures.begin(), numFailures.end(), 0ULL)
8888
<< " out of "
8989
<< bench.n_iterations * bench.n_repeats * bench.n_threads << ")"
9090
<< std::endl;

benchmark/multithread.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,11 @@ template <typename T> double mean(const std::vector<T> &values) {
144144

145145
template <typename T> double std_dev(const std::vector<T> &values) {
146146
auto m = mean(values);
147-
std::vector<T> diff_squares;
147+
std::vector<double> diff_squares;
148148
diff_squares.reserve(values.size());
149149

150150
for (auto &v : values) {
151-
diff_squares.push_back(std::pow((v - m), 2.0));
151+
diff_squares.push_back((v - m) * (v - m));
152152
}
153153

154154
return std::sqrt(mean(diff_squares));

0 commit comments

Comments
 (0)