X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Fboost%2Flibs%2Fmath%2Freporting%2Fperformance%2Fcolor_tables_performance.cpp;fp=ceph%2Fsrc%2Fboost%2Flibs%2Fmath%2Freporting%2Fperformance%2Fcolor_tables_performance.cpp;h=e57d438a4564b2bf7278850b346905184ede5976;hb=1e59de90020f1d8d374046ef9cca56ccd4e806e2;hp=0000000000000000000000000000000000000000;hpb=bd41e436e25044e8e83156060a37c23cb661c364;p=ceph.git diff --git a/ceph/src/boost/libs/math/reporting/performance/color_tables_performance.cpp b/ceph/src/boost/libs/math/reporting/performance/color_tables_performance.cpp new file mode 100644 index 000000000..e57d438a4 --- /dev/null +++ b/ceph/src/boost/libs/math/reporting/performance/color_tables_performance.cpp @@ -0,0 +1,30 @@ +// (C) Copyright Matt Borland 2022. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include + +template +void viridis_bm(benchmark::State& state) +{ + std::random_device rd; + std::mt19937_64 gen(rd()); + std::uniform_real_distribution dist(0, 0.125); + Real x = dist(gen); + for (auto _ : state) + { + benchmark::DoNotOptimize(boost::math::tools::viridis(x)); + x += std::numeric_limits::epsilon(); + } +} + +BENCHMARK_TEMPLATE(viridis_bm, float); +BENCHMARK_TEMPLATE(viridis_bm, double); + + +BENCHMARK_MAIN();