mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 01:03:09 +00:00
NNUE namespace cleanup
This patch moves the nnue namespace in the appropiate header that correspondes with the definition. It also makes navigation a bit easier. closes https://github.com/official-stockfish/Stockfish/pull/4445 No functional change
This commit is contained in:
parent
515b66f188
commit
af4b62a593
5 changed files with 13 additions and 11 deletions
|
@ -36,7 +36,7 @@
|
||||||
#include "timeman.h"
|
#include "timeman.h"
|
||||||
#include "uci.h"
|
#include "uci.h"
|
||||||
#include "incbin/incbin.h"
|
#include "incbin/incbin.h"
|
||||||
|
#include "nnue/evaluate_nnue.h"
|
||||||
|
|
||||||
// Macro to embed the default efficiently updatable neural network (NNUE) file
|
// Macro to embed the default efficiently updatable neural network (NNUE) file
|
||||||
// data in the engine binary (using incbin.h, by Dale Weiler).
|
// data in the engine binary (using incbin.h, by Dale Weiler).
|
||||||
|
@ -95,7 +95,7 @@ namespace Eval {
|
||||||
if (directory != "<internal>")
|
if (directory != "<internal>")
|
||||||
{
|
{
|
||||||
ifstream stream(directory + eval_file, ios::binary);
|
ifstream stream(directory + eval_file, ios::binary);
|
||||||
if (load_eval(eval_file, stream))
|
if (NNUE::load_eval(eval_file, stream))
|
||||||
currentEvalFileName = eval_file;
|
currentEvalFileName = eval_file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ namespace Eval {
|
||||||
(void) gEmbeddedNNUEEnd; // Silence warning on unused variable
|
(void) gEmbeddedNNUEEnd; // Silence warning on unused variable
|
||||||
|
|
||||||
istream stream(&buffer);
|
istream stream(&buffer);
|
||||||
if (load_eval(eval_file, stream))
|
if (NNUE::load_eval(eval_file, stream))
|
||||||
currentEvalFileName = eval_file;
|
currentEvalFileName = eval_file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,17 +43,9 @@ namespace Eval {
|
||||||
|
|
||||||
namespace NNUE {
|
namespace NNUE {
|
||||||
|
|
||||||
std::string trace(Position& pos);
|
|
||||||
Value evaluate(const Position& pos, bool adjusted = false, int* complexity = nullptr);
|
|
||||||
void hint_common_parent_position(const Position& pos);
|
|
||||||
|
|
||||||
void init();
|
void init();
|
||||||
void verify();
|
void verify();
|
||||||
|
|
||||||
bool load_eval(std::string name, std::istream& stream);
|
|
||||||
bool save_eval(std::ostream& stream);
|
|
||||||
bool save_eval(const std::optional<std::string>& filename);
|
|
||||||
|
|
||||||
} // namespace NNUE
|
} // namespace NNUE
|
||||||
|
|
||||||
} // namespace Eval
|
} // namespace Eval
|
||||||
|
|
|
@ -55,6 +55,14 @@ namespace Stockfish::Eval::NNUE {
|
||||||
template <typename T>
|
template <typename T>
|
||||||
using LargePagePtr = std::unique_ptr<T, LargePageDeleter<T>>;
|
using LargePagePtr = std::unique_ptr<T, LargePageDeleter<T>>;
|
||||||
|
|
||||||
|
std::string trace(Position& pos);
|
||||||
|
Value evaluate(const Position& pos, bool adjusted = false, int* complexity = nullptr);
|
||||||
|
void hint_common_parent_position(const Position& pos);
|
||||||
|
|
||||||
|
bool load_eval(std::string name, std::istream& stream);
|
||||||
|
bool save_eval(std::ostream& stream);
|
||||||
|
bool save_eval(const std::optional<std::string>& filename);
|
||||||
|
|
||||||
} // namespace Stockfish::Eval::NNUE
|
} // namespace Stockfish::Eval::NNUE
|
||||||
|
|
||||||
#endif // #ifndef NNUE_EVALUATE_NNUE_H_INCLUDED
|
#endif // #ifndef NNUE_EVALUATE_NNUE_H_INCLUDED
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
#include "tt.h"
|
#include "tt.h"
|
||||||
#include "uci.h"
|
#include "uci.h"
|
||||||
#include "syzygy/tbprobe.h"
|
#include "syzygy/tbprobe.h"
|
||||||
|
#include "nnue/evaluate_nnue.h"
|
||||||
|
|
||||||
namespace Stockfish {
|
namespace Stockfish {
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#include "tt.h"
|
#include "tt.h"
|
||||||
#include "uci.h"
|
#include "uci.h"
|
||||||
#include "syzygy/tbprobe.h"
|
#include "syzygy/tbprobe.h"
|
||||||
|
#include "nnue/evaluate_nnue.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue