Added CudaWorker and CudaLaunchData.
This commit is contained in:
parent
d4a3024996
commit
bb2cc0deb7
14 changed files with 567 additions and 28 deletions
|
@ -285,7 +285,7 @@ void xmrig::OclBackend::printHashrate(bool details)
|
|||
Log::print(WHITE_BOLD_S "| OPENCL # | AFFINITY | 10s H/s | 60s H/s | 15m H/s |");
|
||||
|
||||
size_t i = 0;
|
||||
for (const OclLaunchData &data : d_ptr->threads) {
|
||||
for (const auto &data : d_ptr->threads) {
|
||||
Log::print("| %8zu | %8" PRId64 " | %7s | %7s | %7s |" CYAN_BOLD(" #%u") YELLOW(" %s") " %s",
|
||||
i,
|
||||
data.affinity,
|
||||
|
@ -310,7 +310,7 @@ void xmrig::OclBackend::printHashrate(bool details)
|
|||
|
||||
void xmrig::OclBackend::setJob(const Job &job)
|
||||
{
|
||||
const OclConfig &cl = d_ptr->controller->config()->cl();
|
||||
const auto &cl = d_ptr->controller->config()->cl();
|
||||
if (cl.isEnabled()) {
|
||||
d_ptr->init(cl);
|
||||
}
|
||||
|
@ -319,7 +319,7 @@ void xmrig::OclBackend::setJob(const Job &job)
|
|||
return stop();
|
||||
}
|
||||
|
||||
std::vector<OclLaunchData> threads = cl.get(d_ptr->controller->miner(), job.algorithm(), d_ptr->platform, d_ptr->devices);
|
||||
auto threads = cl.get(d_ptr->controller->miner(), job.algorithm(), d_ptr->platform, d_ptr->devices);
|
||||
if (!d_ptr->threads.empty() && d_ptr->threads.size() == threads.size() && std::equal(d_ptr->threads.begin(), d_ptr->threads.end(), threads.begin())) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -117,7 +117,7 @@ rapidjson::Value xmrig::OclConfig::toJSON(rapidjson::Document &doc) const
|
|||
std::vector<xmrig::OclLaunchData> xmrig::OclConfig::get(const Miner *miner, const Algorithm &algorithm, const OclPlatform &platform, const std::vector<OclDevice> &devices) const
|
||||
{
|
||||
std::vector<OclLaunchData> out;
|
||||
const OclThreads &threads = m_threads.get(algorithm);
|
||||
const auto &threads = m_threads.get(algorithm);
|
||||
|
||||
if (threads.isEmpty()) {
|
||||
return out;
|
||||
|
@ -125,7 +125,7 @@ std::vector<xmrig::OclLaunchData> xmrig::OclConfig::get(const Miner *miner, cons
|
|||
|
||||
out.reserve(threads.count() * 2);
|
||||
|
||||
for (const OclThread &thread : threads.data()) {
|
||||
for (const auto &thread : threads.data()) {
|
||||
if (thread.index() >= devices.size()) {
|
||||
LOG_INFO("%s" YELLOW(" skip non-existing device with index ") YELLOW_BOLD("%u"), ocl_tag(), thread.index());
|
||||
continue;
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include "backend/common/Worker.h"
|
||||
#include "backend/common/WorkerJob.h"
|
||||
#include "backend/opencl/OclLaunchData.h"
|
||||
#include "base/tools/Object.h"
|
||||
#include "net/JobResult.h"
|
||||
|
||||
|
||||
|
@ -42,16 +43,12 @@ class IOclRunner;
|
|||
class OclWorker : public Worker
|
||||
{
|
||||
public:
|
||||
OclWorker() = delete;
|
||||
OclWorker(const OclWorker &other) = delete;
|
||||
OclWorker(OclWorker &&other) = delete;
|
||||
XMRIG_DISABLE_COPY_MOVE_DEFAULT(OclWorker)
|
||||
|
||||
OclWorker(size_t id, const OclLaunchData &data);
|
||||
|
||||
~OclWorker() override;
|
||||
|
||||
OclWorker &operator=(const OclWorker &other) = delete;
|
||||
OclWorker &operator=(OclWorker &&other) = delete;
|
||||
|
||||
static std::atomic<bool> ready;
|
||||
|
||||
protected:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue