1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-25 13:42:54 -05:00

CUDA backend: update RandomX dataset when it changes

This commit is contained in:
SChernykh
2024-12-18 13:18:11 +01:00
parent cd2fd9d7a6
commit 4a13a8a75c
4 changed files with 22 additions and 0 deletions

View File

@@ -55,6 +55,15 @@ bool xmrig::CudaRxRunner::run(uint32_t startNonce, uint32_t *rescount, uint32_t
bool xmrig::CudaRxRunner::set(const Job &job, uint8_t *blob)
{
if (!m_datasetHost && (m_seed != job.seed())) {
m_seed = job.seed();
if (m_ready) {
auto dataset = Rx::dataset(job, 0);
callWrapper(CudaLib::rxUpdateDataset(m_ctx, dataset->raw(), dataset->size(false)));
}
}
const bool rc = CudaBaseRunner::set(job, blob);
if (!rc || m_ready) {
return rc;

View File

@@ -27,6 +27,7 @@
#include "backend/cuda/runners/CudaBaseRunner.h"
#include "base/tools/Buffer.h"
namespace xmrig {
@@ -46,6 +47,7 @@ protected:
private:
bool m_ready = false;
const bool m_datasetHost = false;
Buffer m_seed;
size_t m_intensity = 0;
};