#include "position.h"
#include "search.h"
+#include "thread.h"
#include "ucioption.h"
using namespace std;
void benchmark(int argc, char* argv[]) {
+ std::vector<Move> searchMoves(1, MOVE_NONE);
vector<string> fenList;
- SearchLimits limits;
+ Search::LimitsType limits;
int64_t totalNodes;
int time;
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;
}
else
{
- if (!think(pos, limits, moves))
- break;
-
- totalNodes += pos.nodes_searched();
+ Threads.start_thinking(pos, limits, searchMoves, false);
+ totalNodes += Search::RootPosition.nodes_searched();
}
}