Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup outdated Tile naming #4833

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/nnue/nnue_feature_transformer.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,9 @@ namespace Stockfish::Eval::NNUE {
{
assert(states_to_update[0]);

auto accTileIn = reinterpret_cast<const vec_t*>(
auto accIn = reinterpret_cast<const vec_t*>(
&st->accumulator.accumulation[Perspective][0]);
auto accTileOut = reinterpret_cast<vec_t*>(
auto accOut = reinterpret_cast<vec_t*>(
&states_to_update[0]->accumulator.accumulation[Perspective][0]);

const IndexType offsetR0 = HalfDimensions * removed[0][0];
Expand All @@ -408,22 +408,22 @@ namespace Stockfish::Eval::NNUE {
if (removed[0].size() == 1)
{
for (IndexType k = 0; k < HalfDimensions * sizeof(std::int16_t) / sizeof(vec_t); ++k)
accTileOut[k] = vec_add_16(vec_sub_16(accTileIn[k], columnR0[k]), columnA[k]);
accOut[k] = vec_add_16(vec_sub_16(accIn[k], columnR0[k]), columnA[k]);
}
else
{
const IndexType offsetR1 = HalfDimensions * removed[0][1];
auto columnR1 = reinterpret_cast<const vec_t*>(&weights[offsetR1]);

for (IndexType k = 0; k < HalfDimensions * sizeof(std::int16_t) / sizeof(vec_t); ++k)
accTileOut[k] = vec_sub_16(
vec_add_16(accTileIn[k], columnA[k]),
vec_add_16(columnR0[k], columnR1[k]));
accOut[k] = vec_sub_16(
vec_add_16(accIn[k], columnA[k]),
vec_add_16(columnR0[k], columnR1[k]));
}

auto accTilePsqtIn = reinterpret_cast<const psqt_vec_t*>(
auto accPsqtIn = reinterpret_cast<const psqt_vec_t*>(
&st->accumulator.psqtAccumulation[Perspective][0]);
auto accTilePsqtOut = reinterpret_cast<psqt_vec_t*>(
auto accPsqtOut = reinterpret_cast<psqt_vec_t*>(
&states_to_update[0]->accumulator.psqtAccumulation[Perspective][0]);

const IndexType offsetPsqtR0 = PSQTBuckets * removed[0][0];
Expand All @@ -434,18 +434,18 @@ namespace Stockfish::Eval::NNUE {
if (removed[0].size() == 1)
{
for (std::size_t k = 0; k < PSQTBuckets * sizeof(std::int32_t) / sizeof(psqt_vec_t); ++k)
accTilePsqtOut[k] = vec_add_psqt_32(vec_sub_psqt_32(
accTilePsqtIn[k], columnPsqtR0[k]), columnPsqtA[k]);
accPsqtOut[k] = vec_add_psqt_32(vec_sub_psqt_32(
accPsqtIn[k], columnPsqtR0[k]), columnPsqtA[k]);
}
else
{
const IndexType offsetPsqtR1 = PSQTBuckets * removed[0][1];
auto columnPsqtR1 = reinterpret_cast<const psqt_vec_t*>(&psqtWeights[offsetPsqtR1]);

for (std::size_t k = 0; k < PSQTBuckets * sizeof(std::int32_t) / sizeof(psqt_vec_t); ++k)
accTilePsqtOut[k] = vec_sub_psqt_32(
vec_add_psqt_32(accTilePsqtIn[k], columnPsqtA[k]),
vec_add_psqt_32(columnPsqtR0[k], columnPsqtR1[k]));
accPsqtOut[k] = vec_sub_psqt_32(
vec_add_psqt_32(accPsqtIn[k], columnPsqtA[k]),
vec_add_psqt_32(columnPsqtR0[k], columnPsqtR1[k]));
}
}
else
Expand Down