Revisit NNUE initialization

this revisits the initialization of NNUE, basically only changing
the state on the UCI options 'Use NNUE' and 'EvalFile' calling init_NNUE(),
which sets the Eval::useNNUE variable, and loads the network if needed
(i.e. useNNUE is true and the same network is not yet loaded)

init_NNUE is silent (i.e. no info strings), so that it can be called at startup
without confusing certain GUIs.

An error message on wrong setting when asking for (i.e. the net failed to load),
is delayed to the point where everything must be consistent (start of search or eval).
The engine will stop if the settings are wrong at that point.

Also works if the default value of Use NNUE would become true.
This commit is contained in:
Joost VandeVondele
2020-08-02 15:31:51 +02:00
parent e45d4f1b65
commit 18686e29c7
8 changed files with 55 additions and 68 deletions

View File

@@ -76,10 +76,6 @@ std::string pv(const Position& pos, Depth depth, Value alpha, Value beta);
std::string wdl(Value v, int ply);
Move to_move(const Position& pos, std::string& str);
void init_nnue(const std::string& evalFile);
extern bool load_eval_finished;
} // namespace UCI
extern UCI::OptionsMap Options;