Skip to content

Commit

Permalink
Fix for Intel Arrow Lake CPUs on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
kimwalisch committed Nov 5, 2024
1 parent 22f4d80 commit 9468d23
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/CpuInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,14 @@ void CpuInfo::init()

if (cacheInfo.size() <= cpuCoreId)
cacheInfo.resize((cpuCoreId + 1) * 2);

// Intel Arrow Lake CPUs have two L1 data caches. These
// caches are ordered from fastest to slowest. Since we are
// interested in the fastest L1 data cache, we only store
// the information about the first L1 data cache we find.
if (cacheInfo[cpuCoreId].cacheSizes[level] != 0)
continue;

cacheInfo[cpuCoreId].cacheSizes[level] = cacheSize;
cacheInfo[cpuCoreId].cacheSharing[level] = cacheSharing;

Expand Down Expand Up @@ -291,6 +299,14 @@ void CpuInfo::init()
info[i].Cache.Type == CacheUnified))
{
auto level = info[i].Cache.Level;

// Intel Arrow Lake CPUs have two L1 data caches. These
// caches are ordered from fastest to slowest. Since we are
// interested in the fastest L1 data cache, we only store
// the information about the first L1 data cache we find.
if (cacheSizes_[level] != 0)
continue;

cacheSizes_[level] = info[i].Cache.Size;

// We assume the L1 and L2 caches are private
Expand Down

0 comments on commit 9468d23

Please sign in to comment.