Skip to content

Commit af4b62a

Browse files
Disservinvondele
authored andcommitted
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 #4445 No functional change
1 parent 515b66f commit af4b62a

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

src/evaluate.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#include "timeman.h"
3737
#include "uci.h"
3838
#include "incbin/incbin.h"
39-
39+
#include "nnue/evaluate_nnue.h"
4040

4141
// Macro to embed the default efficiently updatable neural network (NNUE) file
4242
// data in the engine binary (using incbin.h, by Dale Weiler).
@@ -95,7 +95,7 @@ namespace Eval {
9595
if (directory != "<internal>")
9696
{
9797
ifstream stream(directory + eval_file, ios::binary);
98-
if (load_eval(eval_file, stream))
98+
if (NNUE::load_eval(eval_file, stream))
9999
currentEvalFileName = eval_file;
100100
}
101101

@@ -111,7 +111,7 @@ namespace Eval {
111111
(void) gEmbeddedNNUEEnd; // Silence warning on unused variable
112112

113113
istream stream(&buffer);
114-
if (load_eval(eval_file, stream))
114+
if (NNUE::load_eval(eval_file, stream))
115115
currentEvalFileName = eval_file;
116116
}
117117
}

src/evaluate.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,9 @@ namespace Eval {
4343

4444
namespace NNUE {
4545

46-
std::string trace(Position& pos);
47-
Value evaluate(const Position& pos, bool adjusted = false, int* complexity = nullptr);
48-
void hint_common_parent_position(const Position& pos);
49-
5046
void init();
5147
void verify();
5248

53-
bool load_eval(std::string name, std::istream& stream);
54-
bool save_eval(std::ostream& stream);
55-
bool save_eval(const std::optional<std::string>& filename);
56-
5749
} // namespace NNUE
5850

5951
} // namespace Eval

src/nnue/evaluate_nnue.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,14 @@ namespace Stockfish::Eval::NNUE {
5555
template <typename T>
5656
using LargePagePtr = std::unique_ptr<T, LargePageDeleter<T>>;
5757

58+
std::string trace(Position& pos);
59+
Value evaluate(const Position& pos, bool adjusted = false, int* complexity = nullptr);
60+
void hint_common_parent_position(const Position& pos);
61+
62+
bool load_eval(std::string name, std::istream& stream);
63+
bool save_eval(std::ostream& stream);
64+
bool save_eval(const std::optional<std::string>& filename);
65+
5866
} // namespace Stockfish::Eval::NNUE
5967

6068
#endif // #ifndef NNUE_EVALUATE_NNUE_H_INCLUDED

src/search.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "tt.h"
3535
#include "uci.h"
3636
#include "syzygy/tbprobe.h"
37+
#include "nnue/evaluate_nnue.h"
3738

3839
namespace Stockfish {
3940

src/uci.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "tt.h"
3333
#include "uci.h"
3434
#include "syzygy/tbprobe.h"
35+
#include "nnue/evaluate_nnue.h"
3536

3637
using namespace std;
3738

0 commit comments

Comments
 (0)