Add logf and log2f benchmark
Similar to expf/exp2f, this patch add two benchmarks for logf and log2f: one which measures thoughput and one which measures latency. The input data is based on a reduced trace based on 2.8 billion samples extracted from specpu2017 521.wrf_r benchmark. Test: ran 32-bit and 64-bit x86 tests on host Change-Id: If4fbd7eb3d40f8e155935149a82f162b222d5506
This commit is contained in:
parent
872c8b5133
commit
ff5a353112
2 changed files with 2962 additions and 0 deletions
2916
benchmarks/logf_input.cpp
Normal file
2916
benchmarks/logf_input.cpp
Normal file
File diff suppressed because it is too large
Load diff
|
@ -302,3 +302,49 @@ static void BM_math_powf_speccpu2017_latency(benchmark::State& state) {
|
|||
}
|
||||
}
|
||||
BIONIC_BENCHMARK(BM_math_powf_speccpu2017_latency);
|
||||
|
||||
#include "logf_input.cpp"
|
||||
|
||||
static void BM_math_logf_speccpu2017(benchmark::State& state) {
|
||||
f = 0.0;
|
||||
auto cin = logf_input.cbegin();
|
||||
for (auto _ : state) {
|
||||
f = logf(*cin);
|
||||
if (++cin == logf_input.cend())
|
||||
cin = logf_input.cbegin();
|
||||
}
|
||||
}
|
||||
BIONIC_BENCHMARK(BM_math_logf_speccpu2017);
|
||||
|
||||
static void BM_math_logf_speccpu2017_latency(benchmark::State& state) {
|
||||
f = 0.0;
|
||||
auto cin = logf_input.cbegin();
|
||||
for (auto _ : state) {
|
||||
f = logf(f * zero + *cin);
|
||||
if (++cin == logf_input.cend())
|
||||
cin = logf_input.cbegin();
|
||||
}
|
||||
}
|
||||
BIONIC_BENCHMARK(BM_math_logf_speccpu2017_latency);
|
||||
|
||||
static void BM_math_log2f_speccpu2017(benchmark::State& state) {
|
||||
f = 0.0;
|
||||
auto cin = logf_input.cbegin();
|
||||
for (auto _ : state) {
|
||||
f = log2f(*cin);
|
||||
if (++cin == logf_input.cend())
|
||||
cin = logf_input.cbegin();
|
||||
}
|
||||
}
|
||||
BIONIC_BENCHMARK(BM_math_log2f_speccpu2017);
|
||||
|
||||
static void BM_math_log2f_speccpu2017_latency(benchmark::State& state) {
|
||||
f = 0.0;
|
||||
auto cin = logf_input.cbegin();
|
||||
for (auto _ : state) {
|
||||
f = log2f(f * zero + *cin);
|
||||
if (++cin == logf_input.cend())
|
||||
cin = logf_input.cbegin();
|
||||
}
|
||||
}
|
||||
BIONIC_BENCHMARK(BM_math_log2f_speccpu2017_latency);
|
||||
|
|
Loading…
Reference in a new issue