Skip to content

Commit 5133df6

Browse files
authored
Merge pull request #214 from r-devulap/hwy-bench
Benchmarks: switch RegisterBenchmarkInternal to std::unique_ptr
2 parents fe2b5bf + d80e779 commit 5133df6

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ Once installed, you can use `pkg-config --cflags --libs x86simdsortcpp` to
7878
populate the right cflags and ldflags to compile and link your C++ program.
7979
This repository also contains a test suite and benchmarking suite which are
8080
written using [googletest](https://github.com/google/googletest) and [google
81-
benchmark](https://github.com/google/benchmark) frameworks respectively. You
82-
can configure meson to build them both by using `-Dbuild_tests=true` and
83-
`-Dbuild_benchmarks=true`.
81+
benchmark](https://github.com/google/benchmark) (>= v1.9.2) frameworks
82+
respectively. You can configure meson to build them both by using
83+
`-Dbuild_tests=true` and `-Dbuild_benchmarks=true`.
8484

8585
## Build using OpenMP
8686

benchmarks/bench-vqsort.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,7 @@ BENCH_SORT(vqsort, uint64_t)
2626
BENCH_SORT(vqsort, int64_t)
2727
BENCH_SORT(vqsort, uint32_t)
2828
BENCH_SORT(vqsort, int32_t)
29+
BENCH_SORT(vqsort, uint16_t)
30+
BENCH_SORT(vqsort, int16_t)
2931
BENCH_SORT(vqsort, float)
3032
BENCH_SORT(vqsort, double)

benchmarks/bench.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
#define MY_BENCHMARK_CAPTURE(func, T, test_case_name, ...) \
66
BENCHMARK_PRIVATE_DECLARE(func) \
77
= (::benchmark::internal::RegisterBenchmarkInternal( \
8+
std::unique_ptr<benchmark::internal::Benchmark>( \
89
new ::benchmark::internal::FunctionBenchmark( \
910
#func "/" #test_case_name "/" #T, \
1011
[](::benchmark::State &st) { \
1112
func<T>(st, __VA_ARGS__); \
12-
})))
13+
}))))
1314

1415
#define BENCH_SORT(func, type) \
1516
MY_BENCHMARK_CAPTURE(func, type, random_128, 128, std::string("random")); \

scripts/bench-compare.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if [ ! -d .bench/google-benchmark ]; then
1111
fi
1212
compare=$(realpath .bench/google-benchmark/tools/compare.py)
1313

14-
meson setup -Dbuild_benchmarks=true -Dbuild_ippbench=true --warnlevel 0 --buildtype release builddir-${branch}
14+
meson setup -Dbuild_benchmarks=true -Dbuild_vqsortbench=true --warnlevel 0 --buildtype release builddir-${branch}
1515
cd builddir-${branch}
1616
ninja
1717
$compare filters ./benchexe $1 $2 --benchmark_repetitions=$3

0 commit comments

Comments
 (0)