PASSED = 12, UNSTOPPABLE = 13, SPACE = 14, TOTAL = 15
};
- // Pawn and material hash tables, indexed by the current thread id.
- // Note that they will be initialized at 0 being global variables.
- MaterialInfoTable* MaterialTable[MAX_THREADS];
- PawnInfoTable* PawnTable[MAX_THREADS];
-
// Function prototypes
template<bool HasPopCnt, bool Trace>
Value do_evaluate(const Position& pos, Value& margin);
}
-/// prefetchTables() is called in do_move() to prefetch pawn and material
-/// hash tables data that will be needed shortly after in evaluation.
-
-void prefetchTables(Key pKey, Key mKey, int threadID) {
-
- PawnTable[threadID]->prefetch(pKey);
- MaterialTable[threadID]->prefetch(mKey);
-}
-
-
/// evaluate() is the main evaluation function. It always computes two
/// values, an endgame score and a middle game score, and interpolates
/// between them based on the remaining material.
margins[WHITE] = margins[BLACK] = VALUE_ZERO;
// Probe the material hash table
- MaterialInfo* mi = MaterialTable[pos.thread()]->get_material_info(pos);
+ MaterialInfo* mi = Threads[pos.thread()].materialTable.get_material_info(pos);
bonus += mi->material_value();
// If we have a specialized evaluation function for the current material
}
// Probe the pawn hash table
- ei.pi = PawnTable[pos.thread()]->get_pawn_info(pos);
+ ei.pi = Threads[pos.thread()].pawnTable.get_pawn_info(pos);
bonus += apply_weight(ei.pi->pawns_value(), Weights[PawnStructure]);
// Initialize attack and king safety bitboards
} // namespace
-/// init_eval() initializes various tables used by the evaluation function
-
-void init_eval(int threads) {
-
- assert(threads <= MAX_THREADS);
-
- for (int i = 0; i < MAX_THREADS; i++)
- {
- if (i >= threads)
- {
- delete PawnTable[i];
- delete MaterialTable[i];
- PawnTable[i] = NULL;
- MaterialTable[i] = NULL;
- continue;
- }
- if (!PawnTable[i])
- PawnTable[i] = new PawnInfoTable();
-
- if (!MaterialTable[i])
- MaterialTable[i] = new MaterialInfoTable();
- }
-}
-
-
-/// quit_eval() releases heap-allocated memory at program termination
-
-void quit_eval() {
-
- init_eval(0);
-}
-
-
/// read_weights() reads evaluation weights from the corresponding UCI parameters
void read_evaluation_uci_options(Color us) {