X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbenchmark.cpp;h=5c4c4e362368b121e0fb32d44e36fb0e1b1bc559;hp=cf0a315c1090a95236029977e845ca5d6d4c1199;hb=3e2591d83c285597a7400c79b61ab9dc38875163;hpb=8d16111ffde1689d48d47ec379ba91613213183c diff --git a/src/benchmark.cpp b/src/benchmark.cpp index cf0a315c..5c4c4e36 100644 --- a/src/benchmark.cpp +++ b/src/benchmark.cpp @@ -26,7 +26,6 @@ #include "position.h" #include "search.h" #include "thread.h" -#include "tt.h" #include "uci.h" using namespace std; @@ -104,7 +103,7 @@ void benchmark(const Position& current, istream& is) { Options["Hash"] = ttSize; Options["Threads"] = threads; - TT.clear(); + Search::reset(); if (limitType == "time") limits.movetime = stoi(limit); // movetime is in ms @@ -143,8 +142,7 @@ void benchmark(const Position& current, istream& is) { } uint64_t nodes = 0; - Search::StateStackPtr st; - Time::point elapsed = Time::now(); + TimePoint elapsed = now(); for (size_t i = 0; i < fens.size(); ++i) { @@ -157,13 +155,14 @@ void benchmark(const Position& current, istream& is) { else { + Search::StateStackPtr st; Threads.start_thinking(pos, limits, st); - Threads.wait_for_think_finished(); + Threads.main()->join(); nodes += Search::RootPos.nodes_searched(); } } - elapsed = Time::now() - elapsed + 1; // Ensure positivity to avoid a 'divide by zero' + elapsed = now() - elapsed + 1; // Ensure positivity to avoid a 'divide by zero' dbg_print(); // Just before to exit