aboutsummaryrefslogtreecommitdiff
path: root/bench
diff options
context:
space:
mode:
authorMarat Dukhan <maratek@gmail.com>2017-03-05 17:59:07 -0500
committerMarat Dukhan <maratek@gmail.com>2017-03-05 17:59:07 -0500
commiteef99d488f3750b2bff3caa27aad6277ace002ba (patch)
tree2bf9b1d3fd60ad4f8f7490e64449bd07509e781d /bench
parent630dfb6638927df1f3181eee339662a86b3cea0b (diff)
downloadpthreadpool-eef99d488f3750b2bff3caa27aad6277ace002ba.tar.gz
Allow NULL threadpool in pthreadpool_destroy
Diffstat (limited to 'bench')
-rw-r--r--bench/latency.cc16
1 files changed, 4 insertions, 12 deletions
diff --git a/bench/latency.cc b/bench/latency.cc
index 55d20ec..f20a794 100644
--- a/bench/latency.cc
+++ b/bench/latency.cc
@@ -22,9 +22,7 @@ static void pthreadpool_compute_1d(benchmark::State& state) {
while (state.KeepRunning()) {
pthreadpool_compute_1d(threadpool, compute_1d, NULL, threads);
}
- if (threads != 0) {
- pthreadpool_destroy(threadpool);
- }
+ pthreadpool_destroy(threadpool);
}
BENCHMARK(pthreadpool_compute_1d)->UseRealTime()->Apply(SetNumberOfThreads);
@@ -38,9 +36,7 @@ static void pthreadpool_compute_1d_tiled(benchmark::State& state) {
while (state.KeepRunning()) {
pthreadpool_compute_1d_tiled(threadpool, compute_1d_tiled, NULL, threads, 1);
}
- if (threads != 0) {
- pthreadpool_destroy(threadpool);
- }
+ pthreadpool_destroy(threadpool);
}
BENCHMARK(pthreadpool_compute_1d_tiled)->UseRealTime()->Apply(SetNumberOfThreads);
@@ -54,9 +50,7 @@ static void pthreadpool_compute_2d(benchmark::State& state) {
while (state.KeepRunning()) {
pthreadpool_compute_2d(threadpool, compute_2d, NULL, 1, threads);
}
- if (threads != 0) {
- pthreadpool_destroy(threadpool);
- }
+ pthreadpool_destroy(threadpool);
}
BENCHMARK(pthreadpool_compute_2d)->UseRealTime()->Apply(SetNumberOfThreads);
@@ -70,9 +64,7 @@ static void pthreadpool_compute_2d_tiled(benchmark::State& state) {
while (state.KeepRunning()) {
pthreadpool_compute_2d_tiled(threadpool, compute_2d_tiled, NULL, 1, threads, 1, 1);
}
- if (threads != 0) {
- pthreadpool_destroy(threadpool);
- }
+ pthreadpool_destroy(threadpool);
}
BENCHMARK(pthreadpool_compute_2d_tiled)->UseRealTime()->Apply(SetNumberOfThreads);