Implemented unified cryptonight and RandomX scratchpad memory.

This commit is contained in:
XMRig 2019-07-17 04:33:11 +07:00
parent 5699147aab
commit 20313cbc56
30 changed files with 434 additions and 297 deletions

View file

@ -48,12 +48,12 @@ public:
CpuWorker(size_t index, const CpuLaunchData &data);
~CpuWorker() override;
inline const MemInfo &memory() const { return m_memory; }
protected:
bool selfTest() override;
void start() override;
inline const VirtualMemory *memory() const override { return m_memory; }
private:
inline cn_hash_fun fn(const Algorithm &algorithm) const { return CnHash::fn(algorithm, m_av, m_assembly); }
@ -63,6 +63,7 @@ private:
bool verify(const Algorithm &algorithm, const uint8_t *referenceValue);
bool verify2(const Algorithm &algorithm, const uint8_t *referenceValue);
void allocateCnCtx();
void consumeJob();
const Algorithm m_algorithm;
@ -71,8 +72,8 @@ private:
const CnHash::AlgoVariant m_av;
const Miner *m_miner;
cryptonight_ctx *m_ctx[N];
MemInfo m_memory;
uint8_t m_hash[N * 32];
VirtualMemory *m_memory = nullptr;
WorkerJob<N> m_job;
# ifdef XMRIG_ALGO_RANDOMX