diff --git a/doc/topology/Intel_Xeon_Gold_6146_x2_UMA_linux_2_0_4.xml b/doc/topology/Intel_Xeon_Gold_6146_x2_UMA_linux_2_0_4.xml
new file mode 100644
index 00000000..fe94194c
--- /dev/null
+++ b/doc/topology/Intel_Xeon_Gold_6146_x2_UMA_linux_2_0_4.xml
@@ -0,0 +1,246 @@
+
+
+
+
+
diff --git a/src/backend/cpu/CpuBackend.cpp b/src/backend/cpu/CpuBackend.cpp
index 7f208c38..e03046dd 100644
--- a/src/backend/cpu/CpuBackend.cpp
+++ b/src/backend/cpu/CpuBackend.cpp
@@ -99,13 +99,13 @@ public:
tag,
profileName.data(),
threads.size(),
- algo.memory() / 1024
+ algo.l3() / 1024
);
workers.stop();
status.reset();
- status.memory = algo.memory();
+ status.memory = algo.l3();
status.threads = threads.size();
for (const CpuLaunchData &data : threads) {
@@ -317,7 +317,7 @@ rapidjson::Value xmrig::CpuBackend::toJSON(rapidjson::Document &doc) const
hugepages.PushBack(pages[1], allocator);
out.AddMember("hugepages", hugepages, allocator);
- out.AddMember("memory", static_cast(d_ptr->algo.isValid() ? (ways * d_ptr->algo.memory()) : 0), allocator);
+ out.AddMember("memory", static_cast(d_ptr->algo.isValid() ? (ways * d_ptr->algo.l3()) : 0), allocator);
if (d_ptr->threads.empty() || !hashrate()) {
return out;
diff --git a/src/backend/cpu/CpuLaunchData.cpp b/src/backend/cpu/CpuLaunchData.cpp
index 6fa458aa..a01f22a6 100644
--- a/src/backend/cpu/CpuLaunchData.cpp
+++ b/src/backend/cpu/CpuLaunchData.cpp
@@ -43,7 +43,7 @@ xmrig::CpuLaunchData::CpuLaunchData(const Miner *miner, const Algorithm &algorit
bool xmrig::CpuLaunchData::isEqual(const CpuLaunchData &other) const
{
- return (algorithm.memory() == other.algorithm.memory()
+ return (algorithm.l3() == other.algorithm.l3()
&& assembly == other.assembly
&& hugePages == other.hugePages
&& hwAES == other.hwAES
diff --git a/src/backend/cpu/CpuWorker.cpp b/src/backend/cpu/CpuWorker.cpp
index 000d7061..14ef1797 100644
--- a/src/backend/cpu/CpuWorker.cpp
+++ b/src/backend/cpu/CpuWorker.cpp
@@ -62,7 +62,7 @@ xmrig::CpuWorker::CpuWorker(size_t index, const CpuLaunchData &data) :
m_miner(data.miner),
m_ctx()
{
- m_memory = new VirtualMemory(m_algorithm.memory() * N, data.hugePages);
+ m_memory = new VirtualMemory(m_algorithm.l3() * N, data.hugePages);
}
@@ -184,7 +184,7 @@ void xmrig::CpuWorker::start()
const Job &job = m_job.currentJob();
- if (job.algorithm().memory() != m_algorithm.memory()) {
+ if (job.algorithm().l3() != m_algorithm.l3()) {
break;
}
@@ -283,7 +283,7 @@ template
void xmrig::CpuWorker::allocateCnCtx()
{
if (m_ctx[0] == nullptr) {
- CnCtx::create(m_ctx, m_memory->scratchpad(), m_algorithm.memory(), N);
+ CnCtx::create(m_ctx, m_memory->scratchpad(), m_algorithm.l3(), N);
}
}
diff --git a/src/backend/cpu/platform/HwlocCpuInfo.cpp b/src/backend/cpu/platform/HwlocCpuInfo.cpp
index d88b4207..047c97e8 100644
--- a/src/backend/cpu/platform/HwlocCpuInfo.cpp
+++ b/src/backend/cpu/platform/HwlocCpuInfo.cpp
@@ -249,7 +249,7 @@ 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.memory();
+ const size_t scratchpad = algorithm.l3();
int intensity = algorithm.maxIntensity() == 1 ? -1 : 1;
if (cache->attr->cache.depth == 3 && isCacheExclusive(cache)) {
diff --git a/src/crypto/common/Algorithm.cpp b/src/crypto/common/Algorithm.cpp
index f0670b26..30a7ad9c 100644
--- a/src/crypto/common/Algorithm.cpp
+++ b/src/crypto/common/Algorithm.cpp
@@ -146,7 +146,27 @@ rapidjson::Value xmrig::Algorithm::toJSON() const
}
-size_t xmrig::Algorithm::memory() const
+size_t xmrig::Algorithm::l2() const
+{
+# ifdef XMRIG_ALGO_RANDOMX
+ switch (m_id) {
+ case RX_0:
+ case RX_LOKI:
+ return 0x40000;
+
+ case RX_WOW:
+ return 0x20000;
+
+ default:
+ break;
+ }
+# endif
+
+ return 0;
+}
+
+
+size_t xmrig::Algorithm::l3() const
{
const Family f = family();
assert(f != UNKNOWN);
diff --git a/src/crypto/common/Algorithm.h b/src/crypto/common/Algorithm.h
index 0b817bde..92fcc61e 100644
--- a/src/crypto/common/Algorithm.h
+++ b/src/crypto/common/Algorithm.h
@@ -104,7 +104,8 @@ public:
int maxIntensity() const;
rapidjson::Value toJSON() const;
- size_t memory() const;
+ size_t l2() const;
+ size_t l3() const;
static Family family(Id id);
static Id parse(const char *name);