+#include "uci.h"
+
+namespace Eval {
+
+ bool useNNUE;
+ std::string eval_file_loaded="None";
+
+ void init_NNUE() {
+
+ useNNUE = Options["Use NNUE"];
+ std::string eval_file = std::string(Options["EvalFile"]);
+ if (useNNUE && eval_file_loaded != eval_file)
+ if (Eval::NNUE::load_eval_file(eval_file))
+ eval_file_loaded = eval_file;
+ }
+
+ void verify_NNUE() {
+
+ std::string eval_file = std::string(Options["EvalFile"]);
+ if (useNNUE && eval_file_loaded != eval_file)
+ {
+ UCI::OptionsMap defaults;
+ UCI::init(defaults);
+
+ sync_cout << "info string ERROR: NNUE evaluation used, but the network file " << eval_file << " was not loaded successfully." << sync_endl;
+ sync_cout << "info string ERROR: The UCI option EvalFile might need to specify the full path, including the directory/folder name, to the file." << sync_endl;
+ sync_cout << "info string ERROR: The default net can be downloaded from: https://tests.stockfishchess.org/api/nn/"+std::string(defaults["EvalFile"]) << sync_endl;
+ sync_cout << "info string ERROR: If the UCI option Use NNUE is set to true, network evaluation parameters compatible with the program must be available." << sync_endl;
+ sync_cout << "info string ERROR: The engine will be terminated now." << sync_endl;
+ std::exit(EXIT_FAILURE);
+ }
+
+ if (useNNUE)
+ sync_cout << "info string NNUE evaluation using " << eval_file << " enabled." << sync_endl;
+ else
+ sync_cout << "info string classical evaluation enabled." << sync_endl;
+ }
+}