diff --git a/src/backend/cpu/platform/HwlocCpuInfo.cpp b/src/backend/cpu/platform/HwlocCpuInfo.cpp index 40e05a17..01b86e22 100644 --- a/src/backend/cpu/platform/HwlocCpuInfo.cpp +++ b/src/backend/cpu/platform/HwlocCpuInfo.cpp @@ -311,10 +311,9 @@ void xmrig::HwlocCpuInfo::processTopLevelCache(hwloc_obj_t cache, const Algorith uint32_t intensity = algorithm.maxIntensity() == 1 ? 0 : 1; if (cache->attr->cache.depth == 3) { - for (size_t i = 0; i < cache->arity; ++i) { - hwloc_obj_t l2 = cache->children[i]; + auto process_L2 = [&L2, &L2_associativity, L3_exclusive, this, &extra, scratchpad](hwloc_obj_t l2) { if (!hwloc_obj_type_is_cache(l2->type) || l2->attr == nullptr) { - continue; + return; } L2 += l2->attr->cache.size; @@ -329,6 +328,18 @@ void xmrig::HwlocCpuInfo::processTopLevelCache(hwloc_obj_t cache, const Algorith extra += scratchpad; } } + }; + + for (size_t i = 0; i < cache->arity; ++i) { + hwloc_obj_t ch = cache->children[i]; + if (ch->type == HWLOC_OBJ_GROUP) { + for (size_t j = 0; j < ch->arity; ++j) { + process_L2(ch->children[j]); + } + } + else { + process_L2(ch); + } } }