Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions bench/get-current.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,40 @@

#include <cpuinfo.h>

static void cpuinfo_get_current_processor(benchmark::State& state) {
static void cpuinfo_get_current_processor_bench(benchmark::State& state) {
cpuinfo_initialize();
while (state.KeepRunning()) {
const cpuinfo_processor* current_processor = cpuinfo_get_current_processor();
benchmark::DoNotOptimize(current_processor);
}
}
BENCHMARK(cpuinfo_get_current_processor)->Unit(benchmark::kNanosecond);
BENCHMARK(cpuinfo_get_current_processor_bench)->Unit(benchmark::kNanosecond);

static void cpuinfo_get_current_core(benchmark::State& state) {
static void cpuinfo_get_current_core_bench(benchmark::State& state) {
cpuinfo_initialize();
while (state.KeepRunning()) {
const cpuinfo_core* current_core = cpuinfo_get_current_core();
benchmark::DoNotOptimize(current_core);
}
}
BENCHMARK(cpuinfo_get_current_core)->Unit(benchmark::kNanosecond);
BENCHMARK(cpuinfo_get_current_core_bench)->Unit(benchmark::kNanosecond);

static void cpuinfo_get_current_uarch_index(benchmark::State& state) {
static void cpuinfo_get_current_uarch_index_bench(benchmark::State& state) {
cpuinfo_initialize();
while (state.KeepRunning()) {
const uint32_t uarch_index = cpuinfo_get_current_uarch_index();
benchmark::DoNotOptimize(uarch_index);
}
}
BENCHMARK(cpuinfo_get_current_uarch_index)->Unit(benchmark::kNanosecond);
BENCHMARK(cpuinfo_get_current_uarch_index_bench)->Unit(benchmark::kNanosecond);

static void cpuinfo_get_current_uarch_index_with_default(benchmark::State& state) {
static void cpuinfo_get_current_uarch_index_with_default_bench(benchmark::State& state) {
cpuinfo_initialize();
while (state.KeepRunning()) {
const uint32_t uarch_index = cpuinfo_get_current_uarch_index_with_default(0);
benchmark::DoNotOptimize(uarch_index);
}
}
BENCHMARK(cpuinfo_get_current_uarch_index_with_default)->Unit(benchmark::kNanosecond);
BENCHMARK(cpuinfo_get_current_uarch_index_with_default_bench)->Unit(benchmark::kNanosecond);

BENCHMARK_MAIN();
4 changes: 2 additions & 2 deletions bench/init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

#include <cpuinfo.h>

static void cpuinfo_initialize(benchmark::State& state) {
static void cpuinfo_initialize_bench(benchmark::State& state) {
while (state.KeepRunning()) {
cpuinfo_initialize();
}
}
BENCHMARK(cpuinfo_initialize)->Iterations(1)->Unit(benchmark::kMillisecond);
BENCHMARK(cpuinfo_initialize_bench)->Iterations(1)->Unit(benchmark::kMillisecond);

BENCHMARK_MAIN();
6 changes: 3 additions & 3 deletions cmake/DownloadGoogleBenchmark.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12 FATAL_ERROR)
CMAKE_MINIMUM_REQUIRED(VERSION 3.18 FATAL_ERROR)

PROJECT(googlebenchmark-download NONE)

INCLUDE(ExternalProject)
ExternalProject_Add(googlebenchmark
URL https://github.com/google/benchmark/archive/v1.6.1.zip
URL_HASH SHA256=367e963b8620080aff8c831e24751852cffd1f74ea40f25d9cc1b667a9dd5e45
URL https://github.com/google/benchmark/archive/refs/tags/v1.9.4.tar.gz
URL_HASH SHA256=b334658edd35efcf06a99d9be21e4e93e092bd5f95074c1673d5c8705d95c104
SOURCE_DIR "${CONFU_DEPENDENCIES_SOURCE_DIR}/googlebenchmark"
BINARY_DIR "${CONFU_DEPENDENCIES_BINARY_DIR}/googlebenchmark"
CONFIGURE_COMMAND ""
Expand Down
6 changes: 3 additions & 3 deletions cmake/DownloadGoogleTest.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12 FATAL_ERROR)
CMAKE_MINIMUM_REQUIRED(VERSION 3.18 FATAL_ERROR)

PROJECT(googletest-download NONE)

INCLUDE(ExternalProject)
ExternalProject_Add(googletest
URL https://github.com/google/googletest/archive/release-1.11.0.zip
URL_HASH SHA256=353571c2440176ded91c2de6d6cd88ddd41401d14692ec1f99e35d013feda55a
URL https://github.com/google/googletest/archive/refs/tags/v1.17.0.zip
URL_HASH SHA256=40d4ec942217dcc84a9ebe2a68584ada7d4a33a8ee958755763278ea1c5e18ff
SOURCE_DIR "${CONFU_DEPENDENCIES_SOURCE_DIR}/googletest"
BINARY_DIR "${CONFU_DEPENDENCIES_BINARY_DIR}/googletest"
CONFIGURE_COMMAND ""
Expand Down
Loading