Merge pull request #7 from astron-rd/use-google-benchmark

Refactor benchmarks using Google Benchmark
This commit is contained in:
Bram Veenboer
2025-08-12 15:24:58 +02:00
committed by GitHub
8 changed files with 198 additions and 81 deletions

View File

@@ -2,12 +2,29 @@
#include "benchmark_utils.hpp"
int main() {
benchmark_sinf<LookupXSIMDBackend<16384>>();
benchmark_cosf<LookupXSIMDBackend<16384>>();
benchmark_sincosf<LookupXSIMDBackend<16384>>();
benchmark_sinf<LookupXSIMDBackend<32768>>();
benchmark_cosf<LookupXSIMDBackend<32768>>();
benchmark_sincosf<LookupXSIMDBackend<32768>>();
template <typename Backend> void register_benchmarks() {
BENCHMARK_TEMPLATE(benchmark_sinf, Backend)
->Unit(benchmark::kMillisecond)
->Arg(1e5)
->Arg(1e6)
->Arg(1e7);
BENCHMARK_TEMPLATE(benchmark_cosf, Backend)
->Unit(benchmark::kMillisecond)
->Arg(1e5)
->Arg(1e6)
->Arg(1e7);
BENCHMARK_TEMPLATE(benchmark_sincosf, Backend)
->Unit(benchmark::kMillisecond)
->Arg(1e5)
->Arg(1e6)
->Arg(1e7);
}
int main(int argc, char **argv) {
::benchmark::Initialize(&argc, argv);
register_benchmarks<LookupXSIMDBackend<16384>>();
register_benchmarks<LookupXSIMDBackend<32768>>();
return ::benchmark::RunSpecifiedBenchmarks();
}