Skip to content

Fix mt benchmark compilation on windows #318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion benchmark/multithread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static void mt_alloc_free(poolCreateExtParams params,
std::cout << "mean: " << umf_bench::mean(values)
<< " [ms] std_dev: " << umf_bench::std_dev(values) << " [ms]"
<< " (total alloc failures: "
<< std::accumulate(numFailures.begin(), numFailures.end(), 0)
<< std::accumulate(numFailures.begin(), numFailures.end(), 0ULL)
<< " out of "
<< bench.n_iterations * bench.n_repeats * bench.n_threads << ")"
<< std::endl;
Expand Down
4 changes: 2 additions & 2 deletions benchmark/multithread.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ template <typename T> double mean(const std::vector<T> &values) {

template <typename T> double std_dev(const std::vector<T> &values) {
auto m = mean(values);
std::vector<T> diff_squares;
std::vector<double> diff_squares;
diff_squares.reserve(values.size());

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

return std::sqrt(mean(diff_squares));
Expand Down