Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
version: 1.0.{build}
image:
- Visual Studio 2019
- Visual Studio 2017
configuration: Release
platform: x64
before_build:
Expand Down
12 changes: 1 addition & 11 deletions src/cpucounters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7425,19 +7425,9 @@ int32 PCM::mapNUMANodeToSocket(uint32 numa_node_id) const

if (mask != 0)
{
auto BitScanForward64 = [](unsigned long* Index, uint64_t Mask)
{
if (Mask == 0) return 0;

// Magic numbers for LSB (chess engine style)
static const uint64_t magic = 0x03f79d71b4cb0a89ULL;
uint64_t isolated = Mask & -Mask; // Rightmost set bit
*Index = (unsigned long)(((isolated * magic) >> 58));
};

// Find first set bit (first processor in this NUMA node within this group)
DWORD bitPosition = 0;
BitScanForward64(&bitPosition, mask);
_BitScanForward64(&bitPosition, mask);

// On Windows, we need to find the logical processor ID that corresponds to
// this bit position in this group. We iterate through topology to find a match.
Expand Down
Loading