X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fbenchmark.cpp;h=ee1128043f32f9b94f20f1722f2df55bc074ae5b;hb=efd21679980dfd59320a5e238f44952873353829;hp=551c341b1043df21dfc56d0a0c0cdecdae42a589;hpb=ed04c010eb4a569532f322f5030d468380b3ab57;p=stockfish diff --git a/src/benchmark.cpp b/src/benchmark.cpp index 551c341b..ee112804 100644 --- a/src/benchmark.cpp +++ b/src/benchmark.cpp @@ -59,7 +59,9 @@ static const string Defaults[] = { void benchmark(int argc, char* argv[]) { + std::vector searchMoves(1, MOVE_NONE); vector fenList; + Search::LimitsType limits; int64_t totalNodes; int time; @@ -76,11 +78,11 @@ void benchmark(int argc, char* argv[]) { // Search should be limited by nodes, time or depth ? if (valType == "nodes") - Limits.maxNodes = atoi(valStr.c_str()); + limits.maxNodes = atoi(valStr.c_str()); else if (valType == "time") - Limits.maxTime = 1000 * atoi(valStr.c_str()); // maxTime is in ms + limits.maxTime = 1000 * atoi(valStr.c_str()); // maxTime is in ms else - Limits.maxDepth = atoi(valStr.c_str()); + limits.maxDepth = atoi(valStr.c_str()); // Do we need to load positions from a given FEN file? if (fenFile != "default") @@ -107,28 +109,26 @@ void benchmark(int argc, char* argv[]) { // Ok, let's start the benchmark ! totalNodes = 0; time = get_system_time(); - SearchMoves.push_back(MOVE_NONE); for (size_t i = 0; i < fenList.size(); i++) { Position pos(fenList[i], false, 0); - RootPosition = &pos; 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 + cerr << "\nPerft " << limits.maxDepth << " nodes counted: " << cnt << endl; totalNodes += cnt; } else { - Threads.start_thinking(false); - totalNodes += pos.nodes_searched(); + Threads.start_thinking(pos, limits, searchMoves, false); + totalNodes += Search::RootPosition.nodes_searched(); } }