Merge "Fix deprecated range_x() calls."
This commit is contained in:
commit
7afafce831
4 changed files with 24 additions and 24 deletions
|
@ -25,7 +25,7 @@ static const char* names[] = { "1234.0", "nan", "HUGE_VAL", "0.0" };
|
|||
#define BENCHMARK_COMMON_VALS(name) BENCHMARK(name)->Arg(0)->Arg(1)->Arg(2)->Arg(3)
|
||||
|
||||
static void SetLabel(benchmark::State& state) {
|
||||
state.SetLabel(names[state.range_x()]);
|
||||
state.SetLabel(names[state.range(0)]);
|
||||
}
|
||||
|
||||
// Avoid optimization.
|
||||
|
@ -61,7 +61,7 @@ BENCHMARK(BM_math_logb);
|
|||
|
||||
static void BM_math_isfinite_macro(benchmark::State& state) {
|
||||
d = 0.0;
|
||||
v = values[state.range_x()];
|
||||
v = values[state.range(0)];
|
||||
while (state.KeepRunning()) {
|
||||
d += isfinite(v);
|
||||
}
|
||||
|
@ -76,7 +76,7 @@ BENCHMARK_COMMON_VALS(BM_math_isfinite_macro);
|
|||
#endif
|
||||
static void BM_math_isfinite(benchmark::State& state) {
|
||||
d = 0.0;
|
||||
v = values[state.range_x()];
|
||||
v = values[state.range(0)];
|
||||
while (state.KeepRunning()) {
|
||||
d += test_isfinite(v);
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ BENCHMARK_COMMON_VALS(BM_math_isfinite);
|
|||
|
||||
static void BM_math_isinf_macro(benchmark::State& state) {
|
||||
d = 0.0;
|
||||
v = values[state.range_x()];
|
||||
v = values[state.range(0)];
|
||||
while (state.KeepRunning()) {
|
||||
d += isinf(v);
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ BENCHMARK_COMMON_VALS(BM_math_isinf_macro);
|
|||
|
||||
static void BM_math_isinf(benchmark::State& state) {
|
||||
d = 0.0;
|
||||
v = values[state.range_x()];
|
||||
v = values[state.range(0)];
|
||||
while (state.KeepRunning()) {
|
||||
d += (isinf)(v);
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ BENCHMARK_COMMON_VALS(BM_math_isinf);
|
|||
|
||||
static void BM_math_isnan_macro(benchmark::State& state) {
|
||||
d = 0.0;
|
||||
v = values[state.range_x()];
|
||||
v = values[state.range(0)];
|
||||
while (state.KeepRunning()) {
|
||||
d += isnan(v);
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ BENCHMARK_COMMON_VALS(BM_math_isnan_macro);
|
|||
|
||||
static void BM_math_isnan(benchmark::State& state) {
|
||||
d = 0.0;
|
||||
v = values[state.range_x()];
|
||||
v = values[state.range(0)];
|
||||
while (state.KeepRunning()) {
|
||||
d += (isnan)(v);
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ BENCHMARK_COMMON_VALS(BM_math_isnan);
|
|||
|
||||
static void BM_math_isnormal_macro(benchmark::State& state) {
|
||||
d = 0.0;
|
||||
v = values[state.range_x()];
|
||||
v = values[state.range(0)];
|
||||
while (state.KeepRunning()) {
|
||||
d += isnormal(v);
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ BENCHMARK_COMMON_VALS(BM_math_isnormal_macro);
|
|||
#if defined(__BIONIC__)
|
||||
static void BM_math_isnormal(benchmark::State& state) {
|
||||
d = 0.0;
|
||||
v = values[state.range_x()];
|
||||
v = values[state.range(0)];
|
||||
while (state.KeepRunning()) {
|
||||
d += (__isnormal)(v);
|
||||
}
|
||||
|
@ -180,7 +180,7 @@ BENCHMARK(BM_math_sin_fesetenv);
|
|||
|
||||
static void BM_math_fpclassify(benchmark::State& state) {
|
||||
d = 0.0;
|
||||
v = values[state.range_x()];
|
||||
v = values[state.range(0)];
|
||||
while (state.KeepRunning()) {
|
||||
d += fpclassify(v);
|
||||
}
|
||||
|
@ -190,7 +190,7 @@ BENCHMARK_COMMON_VALS(BM_math_fpclassify);
|
|||
|
||||
static void BM_math_signbit_macro(benchmark::State& state) {
|
||||
d = 0.0;
|
||||
v = values[state.range_x()];
|
||||
v = values[state.range(0)];
|
||||
while (state.KeepRunning()) {
|
||||
d += signbit(v);
|
||||
}
|
||||
|
@ -200,7 +200,7 @@ BENCHMARK_COMMON_VALS(BM_math_signbit_macro);
|
|||
|
||||
static void BM_math_signbit(benchmark::State& state) {
|
||||
d = 0.0;
|
||||
v = values[state.range_x()];
|
||||
v = values[state.range(0)];
|
||||
while (state.KeepRunning()) {
|
||||
d += (__signbit)(v);
|
||||
}
|
||||
|
@ -210,7 +210,7 @@ BENCHMARK_COMMON_VALS(BM_math_signbit);
|
|||
|
||||
static void BM_math_fabs_macro(benchmark::State& state) {
|
||||
d = 0.0;
|
||||
v = values[state.range_x()];
|
||||
v = values[state.range(0)];
|
||||
while (state.KeepRunning()) {
|
||||
d += fabs(v);
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ BENCHMARK_COMMON_VALS(BM_math_fabs_macro);
|
|||
|
||||
static void BM_math_fabs(benchmark::State& state) {
|
||||
d = 0.0;
|
||||
v = values[state.range_x()];
|
||||
v = values[state.range(0)];
|
||||
while (state.KeepRunning()) {
|
||||
d += (fabs)(v);
|
||||
}
|
||||
|
|
|
@ -142,7 +142,7 @@ struct LocalPropertyTestState {
|
|||
};
|
||||
|
||||
static void BM_property_get(benchmark::State& state) {
|
||||
const size_t nprops = state.range_x();
|
||||
const size_t nprops = state.range(0);
|
||||
|
||||
LocalPropertyTestState pa(nprops);
|
||||
if (!pa.valid) return;
|
||||
|
@ -155,7 +155,7 @@ static void BM_property_get(benchmark::State& state) {
|
|||
BENCHMARK(BM_property_get)->TEST_NUM_PROPS;
|
||||
|
||||
static void BM_property_find(benchmark::State& state) {
|
||||
const size_t nprops = state.range_x();
|
||||
const size_t nprops = state.range(0);
|
||||
|
||||
LocalPropertyTestState pa(nprops);
|
||||
if (!pa.valid) return;
|
||||
|
@ -167,7 +167,7 @@ static void BM_property_find(benchmark::State& state) {
|
|||
BENCHMARK(BM_property_find)->TEST_NUM_PROPS;
|
||||
|
||||
static void BM_property_read(benchmark::State& state) {
|
||||
const size_t nprops = state.range_x();
|
||||
const size_t nprops = state.range(0);
|
||||
|
||||
LocalPropertyTestState pa(nprops);
|
||||
if (!pa.valid) return;
|
||||
|
@ -190,7 +190,7 @@ static void BM_property_read(benchmark::State& state) {
|
|||
BENCHMARK(BM_property_read)->TEST_NUM_PROPS;
|
||||
|
||||
static void BM_property_serial(benchmark::State& state) {
|
||||
const size_t nprops = state.range_x();
|
||||
const size_t nprops = state.range(0);
|
||||
|
||||
LocalPropertyTestState pa(nprops);
|
||||
if (!pa.valid) return;
|
||||
|
|
|
@ -28,7 +28,7 @@ constexpr auto KB = 1024;
|
|||
|
||||
template <typename Fn>
|
||||
void ReadWriteTest(benchmark::State& state, Fn f, bool buffered) {
|
||||
size_t chunk_size = state.range_x();
|
||||
size_t chunk_size = state.range(0);
|
||||
|
||||
FILE* fp = fopen("/dev/zero", "rw");
|
||||
__fsetlocking(fp, FSETLOCKING_BYCALLER);
|
||||
|
|
|
@ -27,7 +27,7 @@ constexpr auto KB = 1024;
|
|||
// TODO: test unaligned operation too? (currently everything will be 8-byte aligned by malloc.)
|
||||
|
||||
static void BM_string_memcmp(benchmark::State& state) {
|
||||
const size_t nbytes = state.range_x();
|
||||
const size_t nbytes = state.range(0);
|
||||
char* src = new char[nbytes]; char* dst = new char[nbytes];
|
||||
memset(src, 'x', nbytes);
|
||||
memset(dst, 'x', nbytes);
|
||||
|
@ -44,7 +44,7 @@ static void BM_string_memcmp(benchmark::State& state) {
|
|||
BENCHMARK(BM_string_memcmp)->AT_COMMON_SIZES;
|
||||
|
||||
static void BM_string_memcpy(benchmark::State& state) {
|
||||
const size_t nbytes = state.range_x();
|
||||
const size_t nbytes = state.range(0);
|
||||
char* src = new char[nbytes]; char* dst = new char[nbytes];
|
||||
memset(src, 'x', nbytes);
|
||||
|
||||
|
@ -59,7 +59,7 @@ static void BM_string_memcpy(benchmark::State& state) {
|
|||
BENCHMARK(BM_string_memcpy)->AT_COMMON_SIZES;
|
||||
|
||||
static void BM_string_memmove(benchmark::State& state) {
|
||||
const size_t nbytes = state.range_x();
|
||||
const size_t nbytes = state.range(0);
|
||||
char* buf = new char[nbytes + 64];
|
||||
memset(buf, 'x', nbytes + 64);
|
||||
|
||||
|
@ -73,7 +73,7 @@ static void BM_string_memmove(benchmark::State& state) {
|
|||
BENCHMARK(BM_string_memmove)->AT_COMMON_SIZES;
|
||||
|
||||
static void BM_string_memset(benchmark::State& state) {
|
||||
const size_t nbytes = state.range_x();
|
||||
const size_t nbytes = state.range(0);
|
||||
char* dst = new char[nbytes];
|
||||
|
||||
while (state.KeepRunning()) {
|
||||
|
@ -86,7 +86,7 @@ static void BM_string_memset(benchmark::State& state) {
|
|||
BENCHMARK(BM_string_memset)->AT_COMMON_SIZES;
|
||||
|
||||
static void BM_string_strlen(benchmark::State& state) {
|
||||
const size_t nbytes = state.range_x();
|
||||
const size_t nbytes = state.range(0);
|
||||
char* s = new char[nbytes];
|
||||
memset(s, 'x', nbytes);
|
||||
s[nbytes - 1] = 0;
|
||||
|
|
Loading…
Reference in a new issue