1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-02 09:39:36 +00:00

Fix a crash on Use NNUE default true

This was because the UCI::use_nnue variable was never updated to true.

closes https://github.com/official-stockfish/Stockfish/pull/2843

bench: 4578298
NNUE: 3377227
This commit is contained in:
mstembera 2020-07-26 17:22:49 -07:00 committed by Joost VandeVondele
parent a8bdf69c71
commit 60497a85d6
3 changed files with 2 additions and 5 deletions

View file

@ -215,7 +215,7 @@ namespace {
void UCI::init_nnue(const std::string& evalFile) void UCI::init_nnue(const std::string& evalFile)
{ {
if (UCI::use_nnue && !UCI::load_eval_finished) if (Options["Use NNUE"] && !UCI::load_eval_finished)
{ {
// Load evaluation function from a file // Load evaluation function from a file
Eval::NNUE::load_eval(evalFile); Eval::NNUE::load_eval(evalFile);

View file

@ -79,7 +79,6 @@ Move to_move(const Position& pos, std::string& str);
void init_nnue(const std::string& evalFile); void init_nnue(const std::string& evalFile);
extern bool load_eval_finished; extern bool load_eval_finished;
extern bool use_nnue;
} // namespace UCI } // namespace UCI

View file

@ -44,9 +44,8 @@ void on_threads(const Option& o) { Threads.set(size_t(o)); }
void on_tb_path(const Option& o) { Tablebases::init(o); } void on_tb_path(const Option& o) { Tablebases::init(o); }
void on_use_nnue(const Option& o) { void on_use_nnue(const Option& o) {
use_nnue = o;
if (use_nnue) if (o)
std::cout << "info string NNUE eval used" << std::endl; std::cout << "info string NNUE eval used" << std::endl;
else else
std::cout << "info string Standard eval used" << std::endl; std::cout << "info string Standard eval used" << std::endl;
@ -204,6 +203,5 @@ Option& Option::operator=(const string& v) {
return *this; return *this;
} }
bool use_nnue = false;
bool load_eval_finished = false; bool load_eval_finished = false;
} // namespace UCI } // namespace UCI