Commit 15bf6675 by Dominic Hamon

Really drop multithreading support

parent 06c1fdbd
...@@ -345,7 +345,7 @@ class Benchmark { ...@@ -345,7 +345,7 @@ class Benchmark {
// of some piece of code. // of some piece of code.
// Run one instance of this benchmark concurrently in t threads. // Run one instance of this benchmark concurrently in t threads.
// TODO(dominic) // TODO(dominic): Allow multithreaded benchmarks
//Benchmark* Threads(int t); //Benchmark* Threads(int t);
// Pick a set of values T from [min_threads,max_threads]. // Pick a set of values T from [min_threads,max_threads].
...@@ -360,13 +360,12 @@ class Benchmark { ...@@ -360,13 +360,12 @@ class Benchmark {
// Foo in 4 threads // Foo in 4 threads
// Foo in 8 threads // Foo in 8 threads
// Foo in 16 threads // Foo in 16 threads
Benchmark* ThreadRange(int min_threads, int max_threads); // Benchmark* ThreadRange(int min_threads, int max_threads);
// Equivalent to ThreadRange(NumCPUs(), NumCPUs()) // Equivalent to ThreadRange(NumCPUs(), NumCPUs())
Benchmark* ThreadPerCpu(); //Benchmark* ThreadPerCpu();
// TODO(dominic): Control whether or not real-time is used for this benchmark // TODO(dominic): Control whether or not real-time is used for this benchmark
// TODO(dominic): Control the default number of iterations
// ------------------------------- // -------------------------------
// Following methods are not useful for clients // Following methods are not useful for clients
......
...@@ -647,7 +647,7 @@ Benchmark* Benchmark::Apply(void (*custom_arguments)(Benchmark* benchmark)) { ...@@ -647,7 +647,7 @@ Benchmark* Benchmark::Apply(void (*custom_arguments)(Benchmark* benchmark)) {
custom_arguments(this); custom_arguments(this);
return this; return this;
} }
/*
Benchmark* Benchmark::Threads(int t) { Benchmark* Benchmark::Threads(int t) {
CHECK_GT(t, 0); CHECK_GT(t, 0);
mutex_lock l(&benchmark_mutex); mutex_lock l(&benchmark_mutex);
...@@ -669,7 +669,7 @@ Benchmark* Benchmark::ThreadPerCpu() { ...@@ -669,7 +669,7 @@ Benchmark* Benchmark::ThreadPerCpu() {
thread_counts_.push_back(kNumCpuMarker); thread_counts_.push_back(kNumCpuMarker);
return this; return this;
} }
*/
void Benchmark::AddRange(std::vector<int>* dst, int lo, int hi, int mult) { void Benchmark::AddRange(std::vector<int>* dst, int lo, int hi, int mult) {
CHECK_GE(lo, 0); CHECK_GE(lo, 0);
CHECK_GE(hi, lo); CHECK_GE(hi, lo);
......
...@@ -57,7 +57,7 @@ static void BM_CalculatePiRange(benchmark::State& state) { ...@@ -57,7 +57,7 @@ static void BM_CalculatePiRange(benchmark::State& state) {
state.SetLabel(ss.str()); state.SetLabel(ss.str());
} }
BENCHMARK_RANGE(BM_CalculatePiRange, 1, 1024 * 1024); BENCHMARK_RANGE(BM_CalculatePiRange, 1, 1024 * 1024);
/*
static void BM_CalculatePi(benchmark::State& state) { static void BM_CalculatePi(benchmark::State& state) {
static const int depth = 1024; static const int depth = 1024;
double pi ATTRIBUTE_UNUSED = 0.0; double pi ATTRIBUTE_UNUSED = 0.0;
...@@ -68,7 +68,7 @@ static void BM_CalculatePi(benchmark::State& state) { ...@@ -68,7 +68,7 @@ static void BM_CalculatePi(benchmark::State& state) {
BENCHMARK(BM_CalculatePi)->Threads(8); BENCHMARK(BM_CalculatePi)->Threads(8);
BENCHMARK(BM_CalculatePi)->ThreadRange(1, 32); BENCHMARK(BM_CalculatePi)->ThreadRange(1, 32);
BENCHMARK(BM_CalculatePi)->ThreadPerCpu(); BENCHMARK(BM_CalculatePi)->ThreadPerCpu();
*/
static void BM_SetInsert(benchmark::State& state) { static void BM_SetInsert(benchmark::State& state) {
while (state.KeepRunning()) { while (state.KeepRunning()) {
state.PauseTiming(); state.PauseTiming();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment