Added support for multi-algorithm CPU threads settings.

This commit is contained in:
XMRig 2019-07-02 22:56:28 +07:00
parent 83fdbbf29c
commit b92807e8d8
24 changed files with 595 additions and 109 deletions

View file

@ -30,6 +30,7 @@
#include <stdio.h>
#include "crypto/cn/CnAlgo.h"
#include "crypto/common/Algorithm.h"
#include "rapidjson/document.h"
@ -123,6 +124,20 @@ rapidjson::Value xmrig::Algorithm::toJSON() const
}
size_t xmrig::Algorithm::memory() const
{
if (family() < RANDOM_X) {
return CnAlgo<>::memory(m_id);
}
if (m_id == RX_WOW) {
return 0x100000;
}
return 0;
}
xmrig::Algorithm::Family xmrig::Algorithm::family(Id id)
{
switch (id) {

View file

@ -94,11 +94,14 @@ public:
inline Family family() const { return family(m_id); }
inline Id id() const { return m_id; }
inline bool operator!=(Algorithm::Id id) const { return m_id != id; }
inline bool operator!=(const Algorithm &other) const { return !isEqual(other); }
inline bool operator==(Algorithm::Id id) const { return m_id == id; }
inline bool operator==(const Algorithm &other) const { return isEqual(other); }
inline operator Algorithm::Id() const { return m_id; }
rapidjson::Value toJSON() const;
size_t memory() const;
static Family family(Id id);
static Id parse(const char *name);

View file

@ -59,10 +59,10 @@ public:
inline bool isEqual(const Assembly &other) const { return m_id == other.m_id; }
inline bool operator!=(Assembly::Id id) const { return m_id != id; }
inline bool operator!=(const Assembly &other) const { return !isEqual(other); }
inline bool operator!=(const Assembly::Id &id) const { return m_id != id; }
inline bool operator==(Assembly::Id id) const { return m_id == id; }
inline bool operator==(const Assembly &other) const { return isEqual(other); }
inline bool operator==(const Assembly::Id &id) const { return m_id == id; }
inline operator Assembly::Id() const { return m_id; }
private: