mirror of
https://github.com/xmrig/xmrig.git
synced 2026-01-29 00:42:47 -05:00
Implemented OclLaunchData creation.
This commit is contained in:
@@ -263,7 +263,7 @@ void xmrig::CpuBackend::setJob(const Job &job)
|
||||
const CpuConfig &cpu = d_ptr->controller->config()->cpu();
|
||||
|
||||
std::vector<CpuLaunchData> threads = cpu.get(d_ptr->controller->miner(), job.algorithm());
|
||||
if (d_ptr->threads.size() == threads.size() && std::equal(d_ptr->threads.begin(), d_ptr->threads.end(), threads.begin())) {
|
||||
if (!d_ptr->threads.empty() && d_ptr->threads.size() == threads.size() && std::equal(d_ptr->threads.begin(), d_ptr->threads.end(), threads.begin())) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -271,11 +271,9 @@ void xmrig::CpuBackend::setJob(const Job &job)
|
||||
d_ptr->profileName = cpu.threads().profileName(job.algorithm());
|
||||
|
||||
if (d_ptr->profileName.isNull() || threads.empty()) {
|
||||
d_ptr->workers.stop();
|
||||
LOG_WARN("%s " RED_BOLD("disabled") YELLOW(" (no suitable configuration found)"), tag);
|
||||
|
||||
LOG_WARN(YELLOW_BOLD_S "CPU disabled, no suitable configuration for algo %s", job.algorithm().shortName());
|
||||
|
||||
return;
|
||||
return stop();
|
||||
}
|
||||
|
||||
d_ptr->threads = std::move(threads);
|
||||
@@ -314,6 +312,10 @@ void xmrig::CpuBackend::start(IWorker *worker)
|
||||
|
||||
void xmrig::CpuBackend::stop()
|
||||
{
|
||||
if (d_ptr->threads.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
const uint64_t ts = Chrono::steadyMSecs();
|
||||
|
||||
d_ptr->workers.stop();
|
||||
|
||||
@@ -121,7 +121,7 @@ std::vector<xmrig::CpuLaunchData> xmrig::CpuConfig::get(const Miner *miner, cons
|
||||
out.reserve(threads.count());
|
||||
|
||||
for (const CpuThread &thread : threads.data()) {
|
||||
out.push_back(CpuLaunchData(miner, algorithm, *this, thread));
|
||||
out.emplace_back(miner, algorithm, *this, thread);
|
||||
}
|
||||
|
||||
return out;
|
||||
|
||||
Reference in New Issue
Block a user