From 4573050c3b087b7584e936fced154ade64aaa4d4 Mon Sep 17 00:00:00 2001 From: "Corey J. Nolet" Date: Mon, 23 Oct 2023 11:39:33 -0400 Subject: [PATCH] Removing all cuda includes from benchmark.hpp --- cpp/bench/ann/src/common/benchmark.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cpp/bench/ann/src/common/benchmark.hpp b/cpp/bench/ann/src/common/benchmark.hpp index 4059e723bf..a83adffdef 100644 --- a/cpp/bench/ann/src/common/benchmark.hpp +++ b/cpp/bench/ann/src/common/benchmark.hpp @@ -22,9 +22,6 @@ #include -#include - -#include "thread_pool.hpp" #include #include #include @@ -382,11 +379,14 @@ void register_search(std::shared_ptr> dataset, auto suf = static_cast(index.search_params[i]["override_suffix"]); index.search_params[i].erase("override_suffix"); + int max_threads = + metric_objective == Objective::THROUGHPUT ? std::thread::hardware_concurrency() : 1; + auto* b = ::benchmark::RegisterBenchmark( index.name + suf, bench_search, index, i, dataset, metric_objective) ->Unit(benchmark::kMillisecond) - ->ThreadRange(1, 32) - ->UseManualTime(); + ->UseManualTime() + ->ThreadRange(1, max_threads); } } }