Calculate sum from first elements
authorMaximMolchanov <maksym.n.molchanov@gmail.com>
Sat, 14 Nov 2020 00:55:29 +0000 (02:55 +0200)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Wed, 25 Nov 2020 20:10:13 +0000 (21:10 +0100)
commit7615e3485e75c2f1715d372f7bb1f546738a5c76
treec81f99846eff0416171e68aa2d56887a7f72406f
parent9fb6383ed804d0bc86d52b07def14352f44eb5b4
Calculate sum from first elements

in affine transform for AVX512/AVX2/SSSE3

The idea is to initialize sum with the first element instead of zero.
Reduce one add_epi32 and one set_zero SIMD instructions for each output dimension.

sum = 0; for i = 1 to n sum += a[i] ->
sum = a[1]; for i = 2 to n sum += a[i]

STC:
LLR: 2.95 (-2.94,2.94) {-0.25,1.25}
Total: 69048 W: 7024 L: 6799 D: 55225
Ptnml(0-2): 260, 5175, 23458, 5342, 289
https://tests.stockfishchess.org/tests/view/5faf2cf467cbf42301d6aa06

closes https://github.com/official-stockfish/Stockfish/pull/3227

No functional change.
AUTHORS
src/nnue/layers/affine_transform.h