Implemented "enabled" field for CPU backend;
This commit is contained in:
parent
d9164c0b7b
commit
fa2c9df075
3 changed files with 14 additions and 0 deletions
|
@ -133,6 +133,12 @@ xmrig::CpuBackend::~CpuBackend()
|
|||
}
|
||||
|
||||
|
||||
bool xmrig::CpuBackend::isEnabled() const
|
||||
{
|
||||
return d_ptr->controller->config()->cpu().isEnabled();
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::CpuBackend::isEnabled(const Algorithm &algorithm) const
|
||||
{
|
||||
return !d_ptr->controller->config()->cpu().threads().get(algorithm).empty();
|
||||
|
@ -178,6 +184,12 @@ void xmrig::CpuBackend::printHashrate(bool details)
|
|||
|
||||
void xmrig::CpuBackend::setJob(const Job &job)
|
||||
{
|
||||
if (!isEnabled()) {
|
||||
d_ptr->workers.stop();
|
||||
d_ptr->threads.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
const CpuConfig &cpu = d_ptr->controller->config()->cpu();
|
||||
|
||||
std::vector<CpuLaunchData> threads = cpu.get(d_ptr->controller->miner(), job.algorithm());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue