1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-07 16:05:05 -05:00

Compare commits

...

4 Commits

Author SHA1 Message Date
Tony Butler
3b57c88cfc Merge 5ac6d438fa into 36fdfa2694 2025-03-26 08:27:02 +00:00
xmrig
36fdfa2694 Merge pull request #3646 from SChernykh/dev
Optimized autoconfig for AMD CPUs with < 2 MB L3 cache per thread
2025-03-22 18:36:09 +07:00
SChernykh
6cfc02d24f Optimized autoconfig for AMD CPUs with < 2 MB L3 cache per thread 2025-03-22 11:34:23 +01:00
Tony Butler
5ac6d438fa pause-on-battery: Support macsmc-battery driver and sysfs node 2023-07-12 02:06:54 -06:00
2 changed files with 13 additions and 2 deletions

View File

@@ -320,11 +320,16 @@ void xmrig::HwlocCpuInfo::processTopLevelCache(hwloc_obj_t cache, const Algorith
L2 += l2->attr->cache.size; L2 += l2->attr->cache.size;
L2_associativity = l2->attr->cache.associativity; L2_associativity = l2->attr->cache.associativity;
if (L3_exclusive && l2->attr->cache.size >= scratchpad) { if (L3_exclusive) {
if (vendor() == VENDOR_AMD) {
extra += std::min<size_t>(l2->attr->cache.size, scratchpad);
}
else if (l2->attr->cache.size >= scratchpad) {
extra += scratchpad; extra += scratchpad;
} }
} }
} }
}
// This code is supposed to run only on Intel CPUs // This code is supposed to run only on Intel CPUs
if ((vendor() == VENDOR_INTEL) && (scratchpad == 2 * oneMiB)) { if ((vendor() == VENDOR_INTEL) && (scratchpad == 2 * oneMiB)) {

View File

@@ -169,6 +169,12 @@ bool xmrig::Platform::isOnBatteryPower()
return (status == "Discharging"); return (status == "Discharging");
} }
} }
std::ifstream f("/sys/class/power_supply/macsmc-battery/status");
if (f.is_open()) {
std::string status;
f >> status;
return (status == "Discharging");
}
return false; return false;
} }