From 1887d42e3d880414a8e9c6746810a42521b0ee90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Sun, 10 Dec 2023 21:18:23 +0100 Subject: [PATCH] Use our PCG32 RNG instead of mt19937 in Benchmark::analyse_samples --- src/catch2/benchmark/detail/catch_stats.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/catch2/benchmark/detail/catch_stats.cpp b/src/catch2/benchmark/detail/catch_stats.cpp index 6030e55c..5867f1e1 100644 --- a/src/catch2/benchmark/detail/catch_stats.cpp +++ b/src/catch2/benchmark/detail/catch_stats.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include @@ -368,7 +369,7 @@ namespace Catch { auto Estimate = [=](double(*f)(double const*, double const*)) { auto seed = entropy(); return std::async(std::launch::async, [=] { - std::mt19937 rng(seed); + SimplePcg32 rng( seed ); auto resampled = resample(rng, n_resamples, first, last, f); return bootstrap(confidence_level, first, last, resampled, f); }); @@ -382,7 +383,7 @@ namespace Catch { #else auto Estimate = [=](double(*f)(double const* , double const*)) { auto seed = entropy(); - std::mt19937 rng(seed); + SimplePcg32 rng( seed ); auto resampled = resample(rng, n_resamples, first, last, f); return bootstrap(confidence_level, first, last, resampled, f); };