X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fnnue%2Fnnue_common.h;h=f9ff2bc81ee8f919903fef0f37217379a1304262;hp=a9664262a47f0232643d17f1f59b77c3971c6a03;hb=9b7983a4521b66bf8d3c37ee58963d39deb2695c;hpb=190dd26b9f1bc6442acf7b2ae4750eb4ab8b90bd diff --git a/src/nnue/nnue_common.h b/src/nnue/nnue_common.h index a9664262..f9ff2bc8 100644 --- a/src/nnue/nnue_common.h +++ b/src/nnue/nnue_common.h @@ -90,7 +90,14 @@ namespace Eval::NNUE { PS_END2 = 12 * SQUARE_NB + 1 }; - extern const uint32_t kpp_board_index[PIECE_NB][COLOR_NB]; + constexpr uint32_t kpp_board_index[COLOR_NB][PIECE_NB] = { + // convention: W - us, B - them + // viewed from other side, W and B are reversed + { PS_NONE, PS_W_PAWN, PS_W_KNIGHT, PS_W_BISHOP, PS_W_ROOK, PS_W_QUEEN, PS_W_KING, PS_NONE, + PS_NONE, PS_B_PAWN, PS_B_KNIGHT, PS_B_BISHOP, PS_B_ROOK, PS_B_QUEEN, PS_B_KING, PS_NONE }, + { PS_NONE, PS_B_PAWN, PS_B_KNIGHT, PS_B_BISHOP, PS_B_ROOK, PS_B_QUEEN, PS_B_KING, PS_NONE, + PS_NONE, PS_W_PAWN, PS_W_KNIGHT, PS_W_BISHOP, PS_W_ROOK, PS_W_QUEEN, PS_W_KING, PS_NONE } + }; // Type of input feature after conversion using TransformedFeatureType = std::uint8_t;