- Move moves[1] = {MOVE_NONE};
- int dummy[2] = {0, 0};
- Position pos(*it);
- std::cout << "\nProcessing position " << cnt << '/' << positions.size() << std::endl << std::endl;
- think(pos, true, false, 0, dummy, dummy, 0, maxDepth, maxNodes, secsPerPos, moves);
- totalNodes += nodes_searched();
+ Move moves[1] = { MOVE_NONE };
+ int dummy[2] = { 0, 0 };
+ Position pos(*it, 0);
+ cerr << "\nBench position: " << cnt << '/' << positions.size() << endl << endl;
+ if (valType == "perft")
+ {
+ int64_t perftCnt = perft(pos, maxDepth * ONE_PLY);
+ cerr << "\nPerft " << maxDepth << " result (nodes searched): " << perftCnt << endl << endl;
+ totalNodes += perftCnt;
+ } else {
+ if (!think(pos, false, false, dummy, dummy, 0, maxDepth, maxNodes, secsPerPos, moves))
+ break;
+ totalNodes += pos.nodes_searched();
+ }