RandomX dataset specific code moved into OclSharedData class.

This commit is contained in:
XMRig 2019-09-30 06:59:44 +07:00
parent f4943b77f3
commit 77eecdd2c2
16 changed files with 90 additions and 173 deletions

View file

@ -24,6 +24,7 @@
#include "backend/opencl/wrappers/OclContext.h"
#include "backend/opencl/runners/tools/OclSharedState.h"
#include "backend/opencl/wrappers/OclLib.h"
@ -42,7 +43,7 @@ xmrig::OclContext::~OclContext()
}
bool xmrig::OclContext::init(const std::vector<OclDevice> &devices, std::vector<OclLaunchData> &threads, const Job &job)
bool xmrig::OclContext::init(const std::vector<OclDevice> &devices, std::vector<OclLaunchData> &threads)
{
if (!m_ctx) {
std::vector<cl_device_id> ids(devices.size());
@ -59,12 +60,6 @@ bool xmrig::OclContext::init(const std::vector<OclDevice> &devices, std::vector<
for (OclLaunchData &data : threads) {
data.ctx = m_ctx;
# ifdef XMRIG_ALGO_RANDOMX
if (data.algorithm.family() == Algorithm::RANDOM_X) {
data.dataset->createBuffer(m_ctx, job, data.thread.isDatasetHost());
}
# endif
}
return true;

View file

@ -49,7 +49,7 @@ public:
OclContext(const OclDevice &device);
~OclContext();
bool init(const std::vector<OclDevice> &devices, std::vector<OclLaunchData> &threads, const Job &job);
bool init(const std::vector<OclDevice> &devices, std::vector<OclLaunchData> &threads);
inline bool isValid() const { return m_ctx != nullptr; }
inline cl_context ctx() const { return m_ctx; }