Added L2 information to Algorithm.
This commit is contained in:
parent
9a842a593b
commit
5896b27bf3
7 changed files with 277 additions and 10 deletions
|
@ -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<uint64_t>(d_ptr->algo.isValid() ? (ways * d_ptr->algo.memory()) : 0), allocator);
|
||||
out.AddMember("memory", static_cast<uint64_t>(d_ptr->algo.isValid() ? (ways * d_ptr->algo.l3()) : 0), allocator);
|
||||
|
||||
if (d_ptr->threads.empty() || !hashrate()) {
|
||||
return out;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -62,7 +62,7 @@ xmrig::CpuWorker<N>::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<N>::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<size_t N>
|
|||
void xmrig::CpuWorker<N>::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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue