mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-27 04:26:24 +08:00
Read NNUE net faster
Load feature transformer weights in bulk on little-endian machines. This is in particular useful to test new nets with c-chess-cli, see https://github.com/lucasart/c-chess-cli/issues/44 ``` $ time ./stockfish.exe uci Before : 0m0.914s After : 0m0.483s ``` No functional change
This commit is contained in:
committed by
Stéphane Nicolet
parent
559942d64d
commit
b84fa04db6
@@ -105,9 +105,6 @@ template<> inline void swap_endian<uint8_t>(uint8_t&) {}
|
||||
|
||||
template<typename T, int LE> T number(void* addr)
|
||||
{
|
||||
static const union { uint32_t i; char c[4]; } Le = { 0x01020304 };
|
||||
static const bool IsLittleEndian = (Le.c[0] == 4);
|
||||
|
||||
T v;
|
||||
|
||||
if ((uintptr_t)addr & (alignof(T) - 1)) // Unaligned pointer (very rare)
|
||||
|
||||
Reference in New Issue
Block a user