mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-25 19:46:55 +08:00
Move the observed feature collection to the threaded part now that it can be done safely.
This commit is contained in:
@@ -400,7 +400,7 @@ inline uint64_t mul_hi64(uint64_t a, uint64_t b) {
|
||||
// This bitset can be accessed concurrently, provided
|
||||
// the concurrent accesses are performed on distinct
|
||||
// instances of underlying type. That means the cuncurrent
|
||||
// accesses need to be spaced by at least
|
||||
// accesses need to be spaced by at least
|
||||
// bits_per_bucket bits.
|
||||
// But at least best_concurrent_access_stride bits
|
||||
// is recommended to prevent false sharing.
|
||||
@@ -418,6 +418,11 @@ public:
|
||||
constexpr static uint64_t num_buckets = (num_bits + bits_per_bucket - 1) / bits_per_bucket;
|
||||
constexpr static uint64_t best_concurrent_access_stride = 8 * cache_line_size;
|
||||
|
||||
LargeBitset()
|
||||
{
|
||||
std::fill(std::begin(bits), std::end(bits), 0);
|
||||
}
|
||||
|
||||
void set(uint64_t idx)
|
||||
{
|
||||
const uint64_t bucket = idx / bits_per_bucket;
|
||||
|
||||
Reference in New Issue
Block a user