Use a global instead of a variable in pos

This commit is contained in:
Joost VandeVondele
2020-07-28 15:41:35 +02:00
parent e42258db5a
commit 8e28c99f79
7 changed files with 26 additions and 26 deletions

View File

@@ -30,6 +30,10 @@
#include "pawns.h"
#include "thread.h"
namespace Eval {
bool useNNUE;
}
namespace Trace {
enum Tracing { NO_TRACE, TRACE };
@@ -900,7 +904,7 @@ make_v:
/// evaluation of the position from the point of view of the side to move.
Value Eval::evaluate(const Position& pos) {
if (pos.use_nnue())
if (Eval::useNNUE)
return NNUE::evaluate(pos);
else
return Evaluation<NO_TRACE>(pos).value();
@@ -921,7 +925,7 @@ std::string Eval::trace(const Position& pos) {
Value v;
if (pos.use_nnue())
if (Eval::useNNUE)
{
v = NNUE::evaluate(pos);
}