chromium/third_party/google_benchmark/src/src/benchmark_register.cc

// Copyright 2015 Google Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include "benchmark_register.h"

#ifndef BENCHMARK_OS_WINDOWS
#if !defined(BENCHMARK_OS_FUCHSIA) && !defined(BENCHMARK_OS_QURT)
#include <sys/resource.h>
#endif
#include <sys/time.h>
#include <unistd.h>
#endif

#include <algorithm>
#include <atomic>
#include <cinttypes>
#include <condition_variable>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <memory>
#include <numeric>
#include <sstream>
#include <thread>

#include "benchmark/benchmark.h"
#include "benchmark_api_internal.h"
#include "check.h"
#include "commandlineflags.h"
#include "complexity.h"
#include "internal_macros.h"
#include "log.h"
#include "mutex.h"
#include "re.h"
#include "statistics.h"
#include "string_util.h"
#include "timers.h"

namespace benchmark {

namespace {
// For non-dense Range, intermediate values are powers of kRangeMultiplier.
static constexpr int kRangeMultiplier =;

// The size of a benchmark family determines is the number of inputs to repeat
// the benchmark on. If this is "large" then warn the user during configuration.
static constexpr size_t kMaxFamilySize =;

static constexpr char kDisabledPrefix[] =;
}  // end namespace

namespace internal {

//=============================================================================//
//                         BenchmarkFamilies
//=============================================================================//

// Class for managing registered benchmarks.  Note that each registered
// benchmark identifies a family of related benchmarks to run.
class BenchmarkFamilies {};

BenchmarkFamilies* BenchmarkFamilies::GetInstance() {}

size_t BenchmarkFamilies::AddBenchmark(std::unique_ptr<Benchmark> family) {}

void BenchmarkFamilies::ClearBenchmarks() {}

bool BenchmarkFamilies::FindBenchmarks(
    std::string spec, std::vector<BenchmarkInstance>* benchmarks,
    std::ostream* ErrStream) {}

Benchmark* RegisterBenchmarkInternal(Benchmark* bench) {}

// FIXME: This function is a hack so that benchmark.cc can access
// `BenchmarkFamilies`
bool FindBenchmarksInternal(const std::string& re,
                            std::vector<BenchmarkInstance>* benchmarks,
                            std::ostream* Err) {}

//=============================================================================//
//                               Benchmark
//=============================================================================//

Benchmark::Benchmark(const std::string& name)
    :{}

Benchmark::~Benchmark() {}

Benchmark* Benchmark::Name(const std::string& name) {}

Benchmark* Benchmark::Arg(int64_t x) {}

Benchmark* Benchmark::Unit(TimeUnit unit) {}

Benchmark* Benchmark::Range(int64_t start, int64_t limit) {}

Benchmark* Benchmark::Ranges(
    const std::vector<std::pair<int64_t, int64_t>>& ranges) {}

Benchmark* Benchmark::ArgsProduct(
    const std::vector<std::vector<int64_t>>& arglists) {}

Benchmark* Benchmark::ArgName(const std::string& name) {}

Benchmark* Benchmark::ArgNames(const std::vector<std::string>& names) {}

Benchmark* Benchmark::DenseRange(int64_t start, int64_t limit, int step) {}

Benchmark* Benchmark::Args(const std::vector<int64_t>& args) {}

Benchmark* Benchmark::Apply(void (*custom_arguments)(Benchmark* benchmark)) {}

Benchmark* Benchmark::Setup(void (*setup)(const benchmark::State&)) {}

Benchmark* Benchmark::Teardown(void (*teardown)(const benchmark::State&)) {}

Benchmark* Benchmark::RangeMultiplier(int multiplier) {}

Benchmark* Benchmark::MinTime(double t) {}

Benchmark* Benchmark::MinWarmUpTime(double t) {}

Benchmark* Benchmark::Iterations(IterationCount n) {}

Benchmark* Benchmark::Repetitions(int n) {}

Benchmark* Benchmark::ReportAggregatesOnly(bool value) {}

Benchmark* Benchmark::DisplayAggregatesOnly(bool value) {}

Benchmark* Benchmark::MeasureProcessCPUTime() {}

Benchmark* Benchmark::UseRealTime() {}

Benchmark* Benchmark::UseManualTime() {}

Benchmark* Benchmark::Complexity(BigO complexity) {}

Benchmark* Benchmark::Complexity(BigOFunc* complexity) {}

Benchmark* Benchmark::ComputeStatistics(const std::string& name,
                                        StatisticsFunc* statistics,
                                        StatisticUnit unit) {}

Benchmark* Benchmark::Threads(int t) {}

Benchmark* Benchmark::ThreadRange(int min_threads, int max_threads) {}

Benchmark* Benchmark::DenseThreadRange(int min_threads, int max_threads,
                                       int stride) {}

Benchmark* Benchmark::ThreadPerCpu() {}

void Benchmark::SetName(const std::string& name) {}

const char* Benchmark::GetName() const {}

int Benchmark::ArgsCnt() const {}

const char* Benchmark::GetArgName(int arg) const {}

TimeUnit Benchmark::GetTimeUnit() const {}

//=============================================================================//
//                            FunctionBenchmark
//=============================================================================//

void FunctionBenchmark::Run(State& st) {}

}  // end namespace internal

void ClearRegisteredBenchmarks() {}

std::vector<int64_t> CreateRange(int64_t lo, int64_t hi, int multi) {}

std::vector<int64_t> CreateDenseRange(int64_t start, int64_t limit, int step) {}

}  // end namespace benchmark