X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbenchmark.cpp;h=ee1128043f32f9b94f20f1722f2df55bc074ae5b;hp=95dd88ac01fad7b525eb65a90d3e0cce1ab40e54;hb=bb3427ca85bdb20b4c8af12b63f635d03c5e9146;hpb=ff1ecb5d6c58b665efc9df6779c05b9e7a61d603 diff --git a/src/benchmark.cpp b/src/benchmark.cpp index 95dd88ac..ee112804 100644 --- a/src/benchmark.cpp +++ b/src/benchmark.cpp @@ -23,6 +23,7 @@ #include "position.h" #include "search.h" +#include "thread.h" #include "ucioption.h" using namespace std; @@ -58,8 +59,9 @@ static const string Defaults[] = { void benchmark(int argc, char* argv[]) { + std::vector searchMoves(1, MOVE_NONE); vector fenList; - SearchLimits limits; + Search::LimitsType limits; int64_t totalNodes; int time; @@ -110,14 +112,13 @@ void benchmark(int argc, char* argv[]) { for (size_t i = 0; i < fenList.size(); i++) { - Move moves[] = { MOVE_NONE }; Position pos(fenList[i], false, 0); cerr << "\nBench position: " << i + 1 << '/' << fenList.size() << endl; if (valType == "perft") { - int64_t cnt = perft(pos, limits.maxDepth * ONE_PLY); + int64_t cnt = Search::perft(pos, limits.maxDepth * ONE_PLY); cerr << "\nPerft " << limits.maxDepth << " nodes counted: " << cnt << endl; @@ -126,10 +127,8 @@ void benchmark(int argc, char* argv[]) { } else { - if (!think(pos, limits, moves)) - break; - - totalNodes += pos.nodes_searched(); + Threads.start_thinking(pos, limits, searchMoves, false); + totalNodes += Search::RootPosition.nodes_searched(); } }