Clear Workers after changing the network

ensures internal state (e.g. accumulator cache) is consistent with network

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

No functional change
This commit is contained in:
Disservin
2024-05-01 15:10:23 +02:00
committed by Joost VandeVondele
parent be142337d8
commit be026bdcb2
2 changed files with 10 additions and 3 deletions

View File

@@ -141,14 +141,18 @@ void Engine::verify_networks() const {
}
void Engine::load_networks() {
networks.big.load(binaryDirectory, options["EvalFile"]);
networks.small.load(binaryDirectory, options["EvalFileSmall"]);
load_big_network(options["EvalFile"]);
load_small_network(options["EvalFileSmall"]);
}
void Engine::load_big_network(const std::string& file) { networks.big.load(binaryDirectory, file); }
void Engine::load_big_network(const std::string& file) {
networks.big.load(binaryDirectory, file);
threads.clear();
}
void Engine::load_small_network(const std::string& file) {
networks.small.load(binaryDirectory, file);
threads.clear();
}
void Engine::save_network(const std::pair<std::optional<std::string>, std::string> files[2]) {