This commit is contained in:
XMRig 2019-09-12 01:09:30 +07:00
parent 95daab4bc0
commit 82595ee256
7 changed files with 16 additions and 26 deletions

View file

@ -39,28 +39,25 @@
xmrig::OclRxBaseRunner::OclRxBaseRunner(size_t index, const OclLaunchData &data) : OclBaseRunner(index, data)
{
uint32_t worksize = 0;
uint32_t gcn_version = 12;
switch (data.thread.worksize()) {
case 2:
case 4:
case 8:
case 16:
worksize = data.thread.worksize();
m_worksize = data.thread.worksize();
break;
default:
worksize = 8;
m_worksize = 8;
}
if (data.device.type() == OclDevice::Vega_10 || data.device.type() == OclDevice::Vega_20) {
gcn_version = 14;
m_gcn_version = 14;
}
m_options += " -DALGO=" + std::to_string(m_algorithm.id());
m_options += " -DWORKERS_PER_HASH=" + std::to_string(worksize);
m_options += " -DGCN_VERSION=" + std::to_string(gcn_version);
m_options += " -DWORKERS_PER_HASH=" + std::to_string(m_worksize);
m_options += " -DGCN_VERSION=" + std::to_string(m_gcn_version);
}

View file

@ -69,6 +69,8 @@ protected:
FillAesKernel *m_fillAes4Rx4_entropy = nullptr;
FindSharesKernel *m_find_shares = nullptr;
HashAesKernel *m_hashAes1Rx4 = nullptr;
uint32_t m_gcn_version = 12;
uint32_t m_worksize = 8;
};

View file

@ -32,8 +32,6 @@
#include "backend/opencl/wrappers/OclLib.h"
#include "crypto/rx/RxAlgo.h"
#include "base/io/log/Log.h"
xmrig::OclRxVmRunner::OclRxVmRunner(size_t index, const OclLaunchData &data) : OclRxBaseRunner(index, data)
{
@ -76,26 +74,17 @@ void xmrig::OclRxVmRunner::execute(uint32_t iteration)
m_init_vm->enqueue(m_queue, g_intensity, iteration);
// LOG_WARN("bfactor:%u %u %u", bfactor, RxAlgo::programIterations(m_algorithm), num_iterations);
uint32_t first = 1;
uint32_t last = 0;
m_execute_vm->setIterations(num_iterations);
m_execute_vm->setFirst(first);
m_execute_vm->setLast(last);
for (int j = 0, n = 1 << bfactor; j < n; ++j) {
if (j == n - 1) {
last = 1;
m_execute_vm->setLast(last);
m_execute_vm->setLast(1);
}
m_execute_vm->enqueue(m_queue, g_intensity, data().thread.worksize());
m_execute_vm->enqueue(m_queue, g_intensity, m_worksize);
if (j == 0) {
first = 0;
m_execute_vm->setFirst(first);
m_execute_vm->setFirst(0);
}
}
}