Rework perft implementation

Unify various perft functions and move all the code
to search.cpp.

Avoid perft implementation to be splitted between
benchmark.cpp (where it has no reason to be) and
search.cpp

No functional and no speed change (tested).
This commit is contained in:
Marco Costalba
2014-08-08 10:59:28 +02:00
committed by lucasart
parent 2efeded6e3
commit a67c22611a
3 changed files with 20 additions and 20 deletions

View File

@@ -139,15 +139,8 @@ void benchmark(const Position& current, istream& is) {
cerr << "\nPosition: " << i + 1 << '/' << fens.size() << endl;
if (limitType == "perft")
for (MoveList<LEGAL> it(pos); *it; ++it)
{
StateInfo si;
pos.do_move(*it, si);
uint64_t cnt = limits.depth > 1 ? Search::perft(pos, (limits.depth - 1) * ONE_PLY) : 1;
pos.undo_move(*it);
cout << move_to_uci(*it, pos.is_chess960()) << ": " << cnt << endl;
nodes += cnt;
}
nodes += Search::perft<true>(pos, limits.depth * ONE_PLY);
else
{
Threads.start_thinking(pos, limits, st);