]> git.sesse.net Git - stockfish/commitdiff
Teach 'bench' to run current position
authorMarco Costalba <mcostalba@gmail.com>
Sat, 7 Apr 2012 11:04:03 +0000 (12:04 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 7 Apr 2012 11:08:34 +0000 (12:08 +0100)
Now that we can call bench from command prompt
has a sense to teach bench to run the current
set position. To do this is enough to call bench
with 'current' as fen source parameter.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/benchmark.cpp
src/uci.cpp

index 67902062f6cfa9b6e206cf91fe97885583fa76cd..0417313cbb6bf3ac22ba5733cd77bda68fc3212f 100644 (file)
@@ -83,7 +83,12 @@ void benchmark(istringstream& is) {
   else
       limits.depth = atoi(limit.c_str());
 
-  if (fenFile != "default")
+  if (fenFile == "current")
+  {
+      fens.clear();
+      fens.push_back(Search::RootPosition.to_fen());
+  }
+  else if (fenFile != "default")
   {
       fens.clear();
       string fen;
index 126cd5c4c1e8a027e40a29573b3794495b4695af..96aae854311245558d678b163ce25107ccce6aa9 100644 (file)
@@ -59,6 +59,8 @@ void uci_loop(const string& args) {
   Position pos(StartFEN, false, Threads.main_thread()); // The root position
   string cmd, token;
 
+  Search::RootPosition = pos;
+
   while (token != "quit")
   {
       if (!args.empty())