Extended "numa" option for RandomX.
This commit is contained in:
parent
f34031a984
commit
7508411faf
8 changed files with 189 additions and 55 deletions
|
@ -25,51 +25,6 @@
|
|||
|
||||
#include "crypto/rx/RxConfig.h"
|
||||
#include "backend/cpu/Cpu.h"
|
||||
#include "base/io/json/Json.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
static const char *kInit = "init";
|
||||
static const char *kNUMA = "numa";
|
||||
|
||||
}
|
||||
|
||||
|
||||
rapidjson::Value xmrig::RxConfig::toJSON(rapidjson::Document &doc) const
|
||||
{
|
||||
using namespace rapidjson;
|
||||
auto &allocator = doc.GetAllocator();
|
||||
|
||||
Value obj(kObjectType);
|
||||
|
||||
obj.AddMember(StringRef(kInit), m_threads, allocator);
|
||||
obj.AddMember(StringRef(kNUMA), m_numa, allocator);
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::RxConfig::read(const rapidjson::Value &value)
|
||||
{
|
||||
if (value.IsObject()) {
|
||||
m_numa = Json::getBool(value, kNUMA, m_numa);
|
||||
m_threads = Json::getInt(value, kInit, m_threads);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
#ifdef XMRIG_FEATURE_HWLOC
|
||||
bool xmrig::RxConfig::isNUMA() const
|
||||
{
|
||||
return m_numa && Cpu::info()->nodes() > 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
uint32_t xmrig::RxConfig::threads() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue