mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-23 02:27:00 +08: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:
committed by
Joost VandeVondele
parent
a8bdf69c71
commit
60497a85d6
@@ -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);
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user