]> git.sesse.net Git - stockfish/commitdiff
NNUE namespace cleanup
authordisservin <disservin.social@gmail.com>
Mon, 13 Mar 2023 18:35:27 +0000 (19:35 +0100)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Sun, 19 Mar 2023 10:27:15 +0000 (11:27 +0100)
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

src/evaluate.cpp
src/evaluate.h
src/nnue/evaluate_nnue.h
src/search.cpp
src/uci.cpp

index cf6f23eac55641fd782b905c5b772a2e49e7ab29..99b873004edfd6043b3f9c62add579ca422b2897 100644 (file)
@@ -36,7 +36,7 @@
 #include "timeman.h"
 #include "uci.h"
 #include "incbin/incbin.h"
-
+#include "nnue/evaluate_nnue.h"
 
 // Macro to embed the default efficiently updatable neural network (NNUE) file
 // data in the engine binary (using incbin.h, by Dale Weiler).
@@ -95,7 +95,7 @@ namespace Eval {
             if (directory != "<internal>")
             {
                 ifstream stream(directory + eval_file, ios::binary);
-                if (load_eval(eval_file, stream))
+                if (NNUE::load_eval(eval_file, stream))
                     currentEvalFileName = eval_file;
             }
 
@@ -111,7 +111,7 @@ namespace Eval {
                 (void) gEmbeddedNNUEEnd; // Silence warning on unused variable
 
                 istream stream(&buffer);
-                if (load_eval(eval_file, stream))
+                if (NNUE::load_eval(eval_file, stream))
                     currentEvalFileName = eval_file;
             }
         }
index 5238cb81c5440fbc80820f14bf524dee405d491f..3615fe6d7e6b112946e055db8f2e89a86c217ec1 100644 (file)
@@ -43,17 +43,9 @@ namespace Eval {
 
   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 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 Eval
index 15638caeeafe4a214d315e4298365d84519d3aa0..b84bed8b90d9d3a9c93eb4c78f44d315faee0ecd 100644 (file)
@@ -55,6 +55,14 @@ namespace Stockfish::Eval::NNUE {
   template <typename 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
 
 #endif // #ifndef NNUE_EVALUATE_NNUE_H_INCLUDED
index 466e0d6f935dd7f79b3076ce9f97ced4c409b853..17c1c28b2646eadd6ec565892f7f0a39620a92a4 100644 (file)
@@ -34,6 +34,7 @@
 #include "tt.h"
 #include "uci.h"
 #include "syzygy/tbprobe.h"
+#include "nnue/evaluate_nnue.h"
 
 namespace Stockfish {
 
index d3d99243b0937deb39cb8fae5fee5e3e75e9e160..8f9684ee26566ea9a00e5278803b32b8eca1d44b 100644 (file)
@@ -32,6 +32,7 @@
 #include "tt.h"
 #include "uci.h"
 #include "syzygy/tbprobe.h"
+#include "nnue/evaluate_nnue.h"
 
 using namespace std;