mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-26 20:16:14 +08:00
Restore NPS output for Perft
Previously it was possible to also get the node counter after running a bench with perft, i.e. `./stockfish bench 1 1 5 current perft`, caused by a small regression from the uci refactoring. ``` Nodes searched: 4865609 =========================== Total time (ms) : 18 Nodes searched : 4865609 Nodes/second : 270311611 ```` closes https://github.com/official-stockfish/Stockfish/pull/5188 No functional change
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
#include "types.h"
|
||||
#include "uci.h"
|
||||
|
||||
namespace Stockfish {
|
||||
namespace Stockfish::Benchmark {
|
||||
|
||||
// Utility to verify move generation. All the leaf nodes up
|
||||
// to the given depth are generated and counted, and the sum is returned.
|
||||
@@ -56,13 +56,12 @@ uint64_t perft(Position& pos, Depth depth) {
|
||||
return nodes;
|
||||
}
|
||||
|
||||
inline void perft(const std::string& fen, Depth depth, bool isChess960) {
|
||||
inline uint64_t perft(const std::string& fen, Depth depth, bool isChess960) {
|
||||
StateListPtr states(new std::deque<StateInfo>(1));
|
||||
Position p;
|
||||
p.set(fen, isChess960, &states->back());
|
||||
|
||||
uint64_t nodes = perft<true>(p, depth);
|
||||
sync_cout << "\nNodes searched: " << nodes << "\n" << sync_endl;
|
||||
return perft<true>(p, depth);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user