Add powf benchmark
As for expf/exp2f benchmark, this patch add two benchmark for powf: one which measures thoughput and one which measures latency. The input data is based on a reduced trace from 2.3 billion samples extracted from specpu2017 521.wrf_r benchmark. Test: ran 32-bit and 64-bit x86 tests on host Change-Id: Id8943d90dd5452146e55fb75708daaf7bf0e25fa
This commit is contained in:
parent
357f6c1b47
commit
872c8b5133
|
@ -278,3 +278,27 @@ static void BM_math_exp2f_speccpu2017_latency(benchmark::State& state) {
|
|||
}
|
||||
}
|
||||
BIONIC_BENCHMARK(BM_math_exp2f_speccpu2017_latency);
|
||||
|
||||
#include "powf_input.cpp"
|
||||
|
||||
static void BM_math_powf_speccpu2006(benchmark::State& state) {
|
||||
f = 0.0;
|
||||
auto cin = powf_input.cbegin();
|
||||
for (auto _ : state) {
|
||||
f = powf(cin->first, cin->second);
|
||||
if (++cin == powf_input.cend())
|
||||
cin = powf_input.cbegin();
|
||||
}
|
||||
}
|
||||
BIONIC_BENCHMARK(BM_math_powf_speccpu2006);
|
||||
|
||||
static void BM_math_powf_speccpu2017_latency(benchmark::State& state) {
|
||||
f = 0.0;
|
||||
auto cin = powf_input.cbegin();
|
||||
for (auto _ : state) {
|
||||
f = powf(f * zero + cin->first, cin->second);
|
||||
if (++cin == powf_input.cend())
|
||||
cin = powf_input.cbegin();
|
||||
}
|
||||
}
|
||||
BIONIC_BENCHMARK(BM_math_powf_speccpu2017_latency);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue