mirror of
https://github.com/xmrig/xmrig.git
synced 2024-11-18 10:01:06 +00:00
Cleanup.
This commit is contained in:
parent
95daab4bc0
commit
82595ee256
7 changed files with 16 additions and 26 deletions
|
@ -60,7 +60,7 @@ xmrig::OclThread::OclThread(const rapidjson::Value &value)
|
|||
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
m_bfactor = Json::getUint(value, kBFactor, 6);
|
||||
m_gcnAsm = Json::getUint(value, kGCNAsm, m_gcnAsm);
|
||||
m_gcnAsm = Json::getBool(value, kGCNAsm, m_gcnAsm);
|
||||
m_datasetHost = Json::getBool(value, kDatasetHost, m_datasetHost);
|
||||
# endif
|
||||
|
||||
|
@ -70,6 +70,8 @@ xmrig::OclThread::OclThread(const rapidjson::Value &value)
|
|||
m_memChunk = std::min(si[1].GetUint(), 18u);
|
||||
}
|
||||
else {
|
||||
m_stridedIndex = 0;
|
||||
m_memChunk = 0;
|
||||
m_fields.set(STRIDED_INDEX_FIELD, false);
|
||||
}
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ private:
|
|||
inline void setIntensity(uint32_t intensity) { m_intensity = intensity / m_worksize * m_worksize; }
|
||||
|
||||
bool m_datasetHost = false;
|
||||
bool m_gcnAsm = false;
|
||||
bool m_gcnAsm = true;
|
||||
std::bitset<FIELD_MAX> m_fields = 1;
|
||||
std::vector<int64_t> m_threads;
|
||||
uint32_t m_bfactor = 6;
|
||||
|
|
|
@ -56,6 +56,8 @@ void xmrig::ExecuteVmKernel::setFirst(uint32_t first)
|
|||
void xmrig::ExecuteVmKernel::setIterations(uint32_t num_iterations)
|
||||
{
|
||||
setArg(5, sizeof(uint32_t), &num_iterations);
|
||||
setFirst(1);
|
||||
setLast(0);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,8 +53,6 @@
|
|||
#include <mutex>
|
||||
#include <uv.h>
|
||||
|
||||
#include "base/tools/Chrono.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
|
Loading…
Reference in a new issue