Initial RandomX source code prepare and compile.

This commit is contained in:
XMRig 2019-09-08 21:56:18 +07:00
parent 29790da63d
commit ff89ec660c
17 changed files with 5481 additions and 57 deletions

View file

@ -43,9 +43,16 @@ class OclLaunchData;
class OclBaseRunner : public IOclRunner
{
public:
OclBaseRunner() = delete;
OclBaseRunner(const OclBaseRunner &other) = delete;
OclBaseRunner(OclBaseRunner &&other) = delete;
OclBaseRunner(size_t id, const OclLaunchData &data);
~OclBaseRunner() override;
OclBaseRunner &operator=(const OclBaseRunner &other) = delete;
OclBaseRunner &operator=(OclBaseRunner &&other) = delete;
protected:
inline cl_context ctx() const override { return m_ctx; }
inline const Algorithm &algorithm() const override { return m_algorithm; }

View file

@ -24,9 +24,33 @@
#include "backend/opencl/runners/OclRxRunner.h"
#include "backend/opencl/OclLaunchData.h"
xmrig::OclRxRunner::OclRxRunner(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();
break;
default:
worksize = 8;
}
if (data.device.type() == OclDevice::Vega_10 || data.device.type() == OclDevice::Vega_20) {
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);
}
@ -46,3 +70,13 @@ bool xmrig::OclRxRunner::set(const Job &job, uint8_t *blob)
{
return false;
}
void xmrig::OclRxRunner::build()
{
OclBaseRunner::build();
if (!m_program) {
return;
}
}

View file

@ -41,6 +41,7 @@ protected:
bool run(uint32_t nonce, uint32_t *hashOutput) override;
bool selfTest() const override;
bool set(const Job &job, uint8_t *blob) override;
void build() override;
};