1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-08 08:23:34 -05:00

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

@@ -48,15 +48,27 @@ xmrig::OclSharedData &xmrig::OclSharedState::get(uint32_t index)
void xmrig::OclSharedState::release()
{
for (auto &kv : map) {
kv.second.release();
}
map.clear();
}
void xmrig::OclSharedState::start(const std::vector<OclLaunchData> &threads)
void xmrig::OclSharedState::start(const std::vector<OclLaunchData> &threads, const Job &job)
{
assert(map.empty());
for (const auto &data : threads) {
++map[data.device.index()];
auto &sharedData = map[data.device.index()];
++sharedData;
# ifdef XMRIG_ALGO_RANDOMX
if (data.algorithm.family() == Algorithm::RANDOM_X) {
sharedData.createDataset(data.ctx, job, data.thread.isDatasetHost());
}
# endif
}
}