Skip to content

Commit

Permalink
affine_transform_non_ssse3()を使うように修正した。
Browse files Browse the repository at this point in the history
  • Loading branch information
KazApps committed Dec 4, 2024
1 parent 009678a commit da3edbe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 28 deletions.
16 changes: 2 additions & 14 deletions source/eval/nnue/layers/affine_transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,20 +310,8 @@ class AffineTransform {
else
#endif

{
std::memcpy(output, biases_, sizeof(std::int32_t) * kOutputDimensions);

for (IndexType i = 0; i < kInputDimensions; ++i)
{
if (input[i])
{
const std::int8_t* w = &weights_[i];
const int in = input[i];
for (IndexType j = 0; j < kOutputDimensions; ++j)
output[j] += w[j * kPaddedInputDimensions] * in;
}
}
}
affine_transform_non_ssse3<kInputDimensions, kPaddedInputDimensions, kOutputDimensions>(
output, weights_, biases_, input);
}
else if constexpr (kOutputDimensions == 1)
{
Expand Down
16 changes: 2 additions & 14 deletions source/eval/nnue/layers/affine_transform_sparse_input.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,20 +363,8 @@ class AffineTransformSparseInput {
}
else
#endif
{
std::memcpy(output, biases_, sizeof(std::int32_t) * kOutputDimensions);

for (IndexType i = 0; i < kInputDimensions; ++i)
{
if (input[i])
{
const std::int8_t* w = &weights_[i];
const int in = input[i];
for (IndexType j = 0; j < kOutputDimensions; ++j)
output[j] += w[j * kPaddedInputDimensions] * in;
}
}
}
affine_transform_non_ssse3<kInputDimensions, kPaddedInputDimensions, kOutputDimensions>(
output, weights_, biases_, input);

#undef vec_set_32
#undef vec_add_dpbusd_32
Expand Down

0 comments on commit da3edbe

Please sign in to comment.