Skip to content

Commit

Permalink
Fix includes
Browse files Browse the repository at this point in the history
  • Loading branch information
PikaCat-OuO committed Apr 27, 2024
1 parent cc56cab commit 12d2108
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 21 deletions.
3 changes: 0 additions & 3 deletions src/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,15 @@

#include <deque>
#include <memory>
#include <ostream>
#include <string_view>
#include <utility>
#include <vector>
#include <sstream>
#include <iosfwd>
#include <cassert>

#include "evaluate.h"
#include "misc.h"
#include "nnue/network.h"
#include "nnue/nnue_common.h"
#include "perft.h"
#include "position.h"
#include "search.h"
Expand Down
1 change: 0 additions & 1 deletion src/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <optional>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include <cstdint>

Expand Down
4 changes: 1 addition & 3 deletions src/evaluate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <memory>

Expand Down Expand Up @@ -85,8 +84,7 @@ Value Eval::evaluate(const Eval::NNUE::Network& network,
// Trace scores are from white's point of view
std::string Eval::trace(Position& pos, const Eval::NNUE::Network& network) {

auto caches = std::make_unique<Eval::NNUE::AccumulatorCaches>();
caches->clear(network);
auto caches = std::make_unique<Eval::NNUE::AccumulatorCaches>(network);

if (pos.checkers())
return "Final evaluation: none (in check)";
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
*/

#include <iostream>
#include <string>

#include "bitboard.h"
#include "misc.h"
#include "position.h"
#include "types.h"
#include "uci.h"
#include "tune.h"

Expand Down
1 change: 0 additions & 1 deletion src/nnue/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <iostream>
#include <sstream>
#include <optional>
#include <type_traits>
#include <vector>

#include "../misc.h"
Expand Down
5 changes: 5 additions & 0 deletions src/nnue/nnue_accumulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ struct alignas(CacheLineSize) Accumulator {
// is commonly referred to as "Finny Tables".
struct AccumulatorCaches {

template<typename Network>
AccumulatorCaches(const Network& network) {
clear(network);
}

struct alignas(CacheLineSize) Cache {

struct alignas(CacheLineSize) Entry {
Expand Down
2 changes: 0 additions & 2 deletions src/nnue/nnue_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iosfwd>
#include <iostream>
#include <sstream>
#include <string_view>

Expand Down
1 change: 0 additions & 1 deletion src/position.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <cstddef>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <string_view>
#include <utility>
Expand Down
4 changes: 2 additions & 2 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ Search::Worker::Worker(SharedState& sharedState,
// Unpack the SharedState struct into member variables
thread_idx(thread_id),
manager(std::move(sm)),
refreshTable(),
options(sharedState.options),
threads(sharedState.threads),
tt(sharedState.tt),
network(sharedState.network) {
network(sharedState.network),
refreshTable(network) {
clear();
}

Expand Down
7 changes: 3 additions & 4 deletions src/search.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,15 +296,14 @@ class Worker {
// The main thread has a SearchManager, the others have a NullSearchManager
std::unique_ptr<ISearchManager> manager;

// Used by NNUE

Eval::NNUE::AccumulatorCaches refreshTable;

const OptionsMap& options;
ThreadPool& threads;
TranspositionTable& tt;
const Eval::NNUE::Network& network;

// Used by NNUE
Eval::NNUE::AccumulatorCaches refreshTable;

friend class Stockfish::ThreadPool;
friend class SearchManager;
};
Expand Down
1 change: 1 addition & 0 deletions src/timeman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <cassert>
#include <cmath>
#include <cstdint>
#include <string>

#include "search.h"
#include "ucioption.h"
Expand Down
4 changes: 1 addition & 3 deletions src/uci.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@

#include <stdint.h>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdint>
#include <functional>
#include <optional>
#include <sstream>
#include <string_view>
#include <utility>
#include <vector>

#include "benchmark.h"
Expand Down

0 comments on commit 12d2108

Please sign in to comment.