From 7daff331dc787a8f974128e25a5afb6b6f1052c2 Mon Sep 17 00:00:00 2001 From: SChernykh Date: Sun, 26 Sep 2021 12:22:58 +0200 Subject: [PATCH] Fix: AstroBWT auto-config ignored max-threads-hint --- src/backend/cpu/platform/HwlocCpuInfo.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/backend/cpu/platform/HwlocCpuInfo.cpp b/src/backend/cpu/platform/HwlocCpuInfo.cpp index 004f182f1..1c38f4c77 100644 --- a/src/backend/cpu/platform/HwlocCpuInfo.cpp +++ b/src/backend/cpu/platform/HwlocCpuInfo.cpp @@ -216,12 +216,6 @@ bool xmrig::HwlocCpuInfo::membind(hwloc_const_bitmap_t nodeset) xmrig::CpuThreads xmrig::HwlocCpuInfo::threads(const Algorithm &algorithm, uint32_t limit) const { -# ifdef XMRIG_ALGO_ASTROBWT - if (algorithm == Algorithm::ASTROBWT_DERO) { - return allThreads(algorithm, limit); - } -# endif - # ifndef XMRIG_ARM if (L2() == 0 && L3() == 0) { return BasicCpuInfo::threads(algorithm, limit); @@ -307,9 +301,16 @@ void xmrig::HwlocCpuInfo::processTopLevelCache(hwloc_obj_t cache, const Algorith size_t L2 = 0; int L2_associativity = 0; size_t extra = 0; - const size_t scratchpad = algorithm.l3(); + size_t scratchpad = algorithm.l3(); uint32_t intensity = algorithm.maxIntensity() == 1 ? 0 : 1; +# ifdef XMRIG_ALGO_ASTROBWT + if (algorithm == Algorithm::ASTROBWT_DERO) { + // Use fake low value to force usage of all available cores for AstroBWT (taking 'limit' into account) + scratchpad = 16 * 1024; + } +# endif + if (cache->attr->cache.depth == 3) { for (size_t i = 0; i < cache->arity; ++i) { hwloc_obj_t l2 = cache->children[i];