Merged v4.5.0-beta
This commit is contained in:
commit
c208f8eb8f
79 changed files with 3704 additions and 161 deletions
|
@ -48,6 +48,11 @@
|
|||
#endif
|
||||
|
||||
|
||||
#ifdef XMRIG_FEATURE_CUDA
|
||||
# include "backend/cuda/CudaConfig.h"
|
||||
#endif
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
static const char *kCPU = "cpu";
|
||||
|
@ -60,6 +65,15 @@ static const char *kRandomX = "randomx";
|
|||
static const char *kOcl = "opencl";
|
||||
#endif
|
||||
|
||||
#ifdef XMRIG_FEATURE_CUDA
|
||||
static const char *kCuda = "cuda";
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(XMRIG_FEATURE_NVML)
|
||||
static const char *kHealthPrintTime = "health-print-time";
|
||||
#endif
|
||||
|
||||
|
||||
class ConfigPrivate
|
||||
{
|
||||
|
@ -73,6 +87,14 @@ public:
|
|||
# ifdef XMRIG_FEATURE_OPENCL
|
||||
OclConfig cl;
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_FEATURE_CUDA
|
||||
CudaConfig cuda;
|
||||
# endif
|
||||
|
||||
# if defined(XMRIG_FEATURE_NVML)
|
||||
uint32_t healthPrintTime = 60;
|
||||
# endif
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -104,6 +126,14 @@ const xmrig::OclConfig &xmrig::Config::cl() const
|
|||
#endif
|
||||
|
||||
|
||||
#ifdef XMRIG_FEATURE_CUDA
|
||||
const xmrig::CudaConfig &xmrig::Config::cuda() const
|
||||
{
|
||||
return d_ptr->cuda;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef XMRIG_ALGO_RANDOMX
|
||||
const xmrig::RxConfig &xmrig::Config::rx() const
|
||||
{
|
||||
|
@ -112,6 +142,14 @@ const xmrig::RxConfig &xmrig::Config::rx() const
|
|||
#endif
|
||||
|
||||
|
||||
#if defined(XMRIG_FEATURE_NVML)
|
||||
uint32_t xmrig::Config::healthPrintTime() const
|
||||
{
|
||||
return d_ptr->healthPrintTime;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
bool xmrig::Config::isShouldSave() const
|
||||
{
|
||||
if (!isAutoSave()) {
|
||||
|
@ -124,6 +162,12 @@ bool xmrig::Config::isShouldSave() const
|
|||
}
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_FEATURE_CUDA
|
||||
if (cuda().isShouldSave()) {
|
||||
return true;
|
||||
}
|
||||
# endif
|
||||
|
||||
return (m_upgrade || cpu().isShouldSave() || m_benchmark.isNewBenchRun());
|
||||
}
|
||||
|
||||
|
@ -147,6 +191,14 @@ bool xmrig::Config::read(const IJsonReader &reader, const char *fileName)
|
|||
d_ptr->cl.read(reader.getValue(kOcl));
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_FEATURE_CUDA
|
||||
d_ptr->cuda.read(reader.getValue(kCuda));
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_FEATURE_NVML
|
||||
d_ptr->healthPrintTime = reader.getUint(kHealthPrintTime, d_ptr->healthPrintTime);
|
||||
# endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -179,18 +231,25 @@ void xmrig::Config::getJSON(rapidjson::Document &doc) const
|
|||
doc.AddMember(StringRef(kOcl), cl().toJSON(doc), allocator);
|
||||
# endif
|
||||
|
||||
doc.AddMember("algo-perf", m_benchmark.toJSON(doc), allocator);
|
||||
doc.AddMember("donate-level", m_pools.donateLevel(), allocator);
|
||||
doc.AddMember("donate-over-proxy", m_pools.proxyDonate(), allocator);
|
||||
doc.AddMember("log-file", m_logFile.toJSON(), allocator);
|
||||
doc.AddMember("pools", m_pools.toJSON(doc), allocator);
|
||||
doc.AddMember("print-time", printTime(), allocator);
|
||||
doc.AddMember("retries", m_pools.retries(), allocator);
|
||||
doc.AddMember("retry-pause", m_pools.retryPause(), allocator);
|
||||
doc.AddMember("syslog", isSyslog(), allocator);
|
||||
doc.AddMember("user-agent", m_userAgent.toJSON(), allocator);
|
||||
doc.AddMember("watch", m_watch, allocator);
|
||||
# ifdef XMRIG_FEATURE_CUDA
|
||||
doc.AddMember(StringRef(kCuda), cuda().toJSON(doc), allocator);
|
||||
# endif
|
||||
|
||||
doc.AddMember("rebench-algo", isRebenchAlgo(), allocator);
|
||||
doc.AddMember("bench-algo-time", benchAlgoTime(), allocator);
|
||||
doc.AddMember("donate-level", m_pools.donateLevel(), allocator);
|
||||
doc.AddMember("donate-over-proxy", m_pools.proxyDonate(), allocator);
|
||||
doc.AddMember("log-file", m_logFile.toJSON(), allocator);
|
||||
doc.AddMember("pools", m_pools.toJSON(doc), allocator);
|
||||
doc.AddMember("print-time", printTime(), allocator);
|
||||
# if defined(XMRIG_FEATURE_NVML)
|
||||
doc.AddMember(StringRef(kHealthPrintTime), healthPrintTime(), allocator);
|
||||
# endif
|
||||
doc.AddMember("retries", m_pools.retries(), allocator);
|
||||
doc.AddMember("retry-pause", m_pools.retryPause(), allocator);
|
||||
doc.AddMember("syslog", isSyslog(), allocator);
|
||||
doc.AddMember("user-agent", m_userAgent.toJSON(), allocator);
|
||||
doc.AddMember("watch", m_watch, allocator);
|
||||
|
||||
doc.AddMember("algo-perf", m_benchmark.toJSON(doc), allocator);
|
||||
doc.AddMember("rebench-algo", isRebenchAlgo(), allocator);
|
||||
doc.AddMember("bench-algo-time", benchAlgoTime(), allocator);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue