mirror of
https://github.com/xmrig/xmrig.git
synced 2025-03-23 23:58:53 +00:00
Add support for initialize OpenCL in runtime.
This commit is contained in:
parent
bdb72684b0
commit
d9dc6a396f
1 changed files with 9 additions and 2 deletions
|
@ -135,6 +135,10 @@ public:
|
||||||
return printDisabled(RED_S " (failed to load OpenCL runtime)");
|
return printDisabled(RED_S " (failed to load OpenCL runtime)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (platform.isValid()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
platform = cl.platform();
|
platform = cl.platform();
|
||||||
if (!platform.isValid()) {
|
if (!platform.isValid()) {
|
||||||
return printDisabled(RED_S " (selected OpenCL platform NOT found)");
|
return printDisabled(RED_S " (selected OpenCL platform NOT found)");
|
||||||
|
@ -302,12 +306,15 @@ void xmrig::OclBackend::printHashrate(bool details)
|
||||||
|
|
||||||
void xmrig::OclBackend::setJob(const Job &job)
|
void xmrig::OclBackend::setJob(const Job &job)
|
||||||
{
|
{
|
||||||
|
const OclConfig &cl = d_ptr->controller->config()->cl();
|
||||||
|
if (cl.isEnabled()) {
|
||||||
|
d_ptr->init(cl);
|
||||||
|
}
|
||||||
|
|
||||||
if (!isEnabled()) {
|
if (!isEnabled()) {
|
||||||
return stop();
|
return stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
const OclConfig &cl = d_ptr->controller->config()->cl();
|
|
||||||
|
|
||||||
std::vector<OclLaunchData> threads = cl.get(d_ptr->controller->miner(), job.algorithm(), d_ptr->platform, d_ptr->devices, tag);
|
std::vector<OclLaunchData> threads = cl.get(d_ptr->controller->miner(), job.algorithm(), d_ptr->platform, d_ptr->devices, tag);
|
||||||
if (!d_ptr->threads.empty() && 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;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue