Merge xmrig v6.4.0 into master
This commit is contained in:
commit
2cf2fcaf8c
109 changed files with 7365 additions and 6359 deletions
|
@ -385,9 +385,9 @@ void xmrig::OclBackend::printHashrate(bool details)
|
|||
Log::print("| %8zu | %8" PRId64 " | %8s | %8s | %8s |" CYAN_BOLD(" #%u") YELLOW(" %s") " %s",
|
||||
i,
|
||||
data.affinity,
|
||||
Hashrate::format(hashrate()->calc(i, Hashrate::ShortInterval) * scale, num, sizeof num / 3),
|
||||
Hashrate::format(hashrate()->calc(i, Hashrate::MediumInterval) * scale, num + 16, sizeof num / 3),
|
||||
Hashrate::format(hashrate()->calc(i, Hashrate::LargeInterval) * scale, num + 16 * 2, sizeof num / 3),
|
||||
Hashrate::format(hashrate()->calc(i + 1, Hashrate::ShortInterval) * scale, num, sizeof num / 3),
|
||||
Hashrate::format(hashrate()->calc(i + 1, Hashrate::MediumInterval) * scale, num + 16, sizeof num / 3),
|
||||
Hashrate::format(hashrate()->calc(i + 1, Hashrate::LargeInterval) * scale, num + 16 * 2, sizeof num / 3),
|
||||
data.device.index(),
|
||||
data.device.topology().toString().data(),
|
||||
data.device.printableName().data()
|
||||
|
@ -397,9 +397,9 @@ void xmrig::OclBackend::printHashrate(bool details)
|
|||
}
|
||||
|
||||
Log::print(WHITE_BOLD_S "| - | - | %8s | %8s | %8s |",
|
||||
Hashrate::format(hashrate()->calc(Hashrate::ShortInterval) * scale, num, sizeof num / 3),
|
||||
Hashrate::format(hashrate()->calc(Hashrate::MediumInterval) * scale, num + 16, sizeof num / 3),
|
||||
Hashrate::format(hashrate()->calc(Hashrate::LargeInterval) * scale, num + 16 * 2, sizeof num / 3)
|
||||
Hashrate::format(hashrate_short * scale, num, sizeof num / 3),
|
||||
Hashrate::format(hashrate_medium * scale, num + 16, sizeof num / 3),
|
||||
Hashrate::format(hashrate_large * scale, num + 16 * 2, sizeof num / 3)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -485,9 +485,9 @@ void xmrig::OclBackend::stop()
|
|||
}
|
||||
|
||||
|
||||
void xmrig::OclBackend::tick(uint64_t ticks)
|
||||
bool xmrig::OclBackend::tick(uint64_t ticks)
|
||||
{
|
||||
d_ptr->workers.tick(ticks);
|
||||
return d_ptr->workers.tick(ticks);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -63,13 +63,18 @@ protected:
|
|||
void setJob(const Job &job) override;
|
||||
void start(IWorker *worker, bool ready) override;
|
||||
void stop() override;
|
||||
void tick(uint64_t ticks) override;
|
||||
bool tick(uint64_t ticks) override;
|
||||
|
||||
# ifdef XMRIG_FEATURE_API
|
||||
rapidjson::Value toJSON(rapidjson::Document &doc) const override;
|
||||
void handleRequest(IApiRequest &request) override;
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_FEATURE_BENCHMARK
|
||||
inline Benchmark *benchmark() const override { return nullptr; }
|
||||
inline void printBenchProgress() const override {}
|
||||
# endif
|
||||
|
||||
private:
|
||||
OclBackendPrivate *d_ptr;
|
||||
};
|
||||
|
|
|
@ -67,6 +67,7 @@ public:
|
|||
const OclDevice device;
|
||||
const OclPlatform platform;
|
||||
const OclThread thread;
|
||||
const uint32_t benchSize = 0;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -60,12 +60,10 @@
|
|||
namespace xmrig {
|
||||
|
||||
|
||||
static constexpr uint32_t kReserveCount = 32768;
|
||||
std::atomic<bool> OclWorker::ready;
|
||||
|
||||
|
||||
static inline bool isReady() { return !Nonce::isPaused() && OclWorker::ready; }
|
||||
static inline uint32_t roundSize(uint32_t intensity) { return kReserveCount / intensity + 1; }
|
||||
|
||||
|
||||
static inline void printError(size_t id, const char *error)
|
||||
|
@ -82,7 +80,6 @@ xmrig::OclWorker::OclWorker(size_t id, const OclLaunchData &data) :
|
|||
Worker(id, data.affinity, -1),
|
||||
m_algorithm(data.algorithm),
|
||||
m_miner(data.miner),
|
||||
m_intensity(data.thread.intensity()),
|
||||
m_sharedData(OclSharedState::get(data.device.index())),
|
||||
m_deviceIndex(data.device.index())
|
||||
{
|
||||
|
@ -152,6 +149,12 @@ xmrig::OclWorker::~OclWorker()
|
|||
}
|
||||
|
||||
|
||||
uint64_t xmrig::OclWorker::rawHashes() const
|
||||
{
|
||||
return m_hashrateData.interpolate(Chrono::steadyMSecs());
|
||||
}
|
||||
|
||||
|
||||
void xmrig::OclWorker::jobEarlyNotification(const Job& job)
|
||||
{
|
||||
if (m_runner) {
|
||||
|
@ -176,8 +179,6 @@ void xmrig::OclWorker::start()
|
|||
{
|
||||
cl_uint results[0x100];
|
||||
|
||||
const uint32_t runnerRoundSize = m_runner->roundSize();
|
||||
|
||||
while (Nonce::sequence(Nonce::OPENCL) > 0) {
|
||||
if (!isReady()) {
|
||||
m_sharedData.setResumeCounter(0);
|
||||
|
@ -216,7 +217,7 @@ void xmrig::OclWorker::start()
|
|||
JobResults::submit(m_job.currentJob(), results, results[0xFF], m_deviceIndex);
|
||||
}
|
||||
|
||||
if (!Nonce::isOutdated(Nonce::OPENCL, m_job.sequence()) && !m_job.nextRound(roundSize(runnerRoundSize), runnerRoundSize)) {
|
||||
if (!Nonce::isOutdated(Nonce::OPENCL, m_job.sequence()) && !m_job.nextRound(1, intensity())) {
|
||||
JobResults::done(m_job.currentJob());
|
||||
}
|
||||
|
||||
|
@ -237,7 +238,7 @@ bool xmrig::OclWorker::consumeJob()
|
|||
return false;
|
||||
}
|
||||
|
||||
m_job.add(m_miner->job(), roundSize(m_intensity) * m_intensity, Nonce::OPENCL);
|
||||
m_job.add(m_miner->job(), intensity(), Nonce::OPENCL);
|
||||
|
||||
try {
|
||||
m_runner->set(m_job.currentJob(), m_job.blob());
|
||||
|
@ -259,8 +260,11 @@ void xmrig::OclWorker::storeStats(uint64_t t)
|
|||
}
|
||||
|
||||
m_count += m_runner->processedHashes();
|
||||
const uint64_t timeStamp = Chrono::steadyMSecs();
|
||||
|
||||
m_sharedData.setRunTime(Chrono::steadyMSecs() - t);
|
||||
m_hashrateData.addDataPoint(m_count, timeStamp);
|
||||
|
||||
m_sharedData.setRunTime(timeStamp - t);
|
||||
|
||||
Worker::storeStats();
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#define XMRIG_OCLWORKER_H
|
||||
|
||||
|
||||
#include "backend/common/HashrateInterpolator.h"
|
||||
#include "backend/common/Worker.h"
|
||||
#include "backend/common/WorkerJob.h"
|
||||
#include "backend/opencl/OclLaunchData.h"
|
||||
|
@ -50,6 +51,7 @@ public:
|
|||
|
||||
~OclWorker() override;
|
||||
|
||||
uint64_t rawHashes() const override;
|
||||
void jobEarlyNotification(const Job&) override;
|
||||
|
||||
static std::atomic<bool> ready;
|
||||
|
@ -65,11 +67,12 @@ private:
|
|||
|
||||
const Algorithm m_algorithm;
|
||||
const Miner *m_miner;
|
||||
const uint32_t m_intensity;
|
||||
IOclRunner *m_runner = nullptr;
|
||||
OclSharedData &m_sharedData;
|
||||
WorkerJob<1> m_job;
|
||||
uint32_t m_deviceIndex;
|
||||
|
||||
HashrateInterpolator m_hashrateData;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -20,16 +20,15 @@
|
|||
#define ALGO_CN_GPU 19
|
||||
#define ALGO_RX_0 20
|
||||
#define ALGO_RX_WOW 21
|
||||
#define ALGO_RX_LOKI 22
|
||||
#define ALGO_RX_ARQ 23
|
||||
#define ALGO_RX_SFX 24
|
||||
#define ALGO_RX_KEVA 25
|
||||
#define ALGO_RX_ARQ 22
|
||||
#define ALGO_RX_SFX 23
|
||||
#define ALGO_RX_KEVA 24
|
||||
#define ALGO_AR2_CHUKWA 25
|
||||
#define ALGO_AR2_CHUKWA 26
|
||||
#define ALGO_AR2_WRKZ 27
|
||||
#define ALGO_ASTROBWT_DERO 28
|
||||
#define ALGO_KAWPOW_RVN 29
|
||||
#define ALGO_RX_DEFYX 30
|
||||
#define ALGO_RX_XLA 31
|
||||
#define ALGO_RX_XLA 30
|
||||
|
||||
#define FAMILY_UNKNOWN 0
|
||||
#define FAMILY_CN 1
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -4,8 +4,6 @@
|
|||
#include "randomx_constants_monero.h"
|
||||
#elif (ALGO == ALGO_RX_WOW)
|
||||
#include "randomx_constants_wow.h"
|
||||
#elif (ALGO == ALGO_RX_LOKI)
|
||||
#include "randomx_constants_loki.h"
|
||||
#elif (ALGO == ALGO_RX_ARQ)
|
||||
#include "randomx_constants_arqma.h"
|
||||
#elif (ALGO == ALGO_RX_KEVA)
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,96 +0,0 @@
|
|||
/*
|
||||
Copyright (c) 2019 SChernykh
|
||||
|
||||
This file is part of RandomX OpenCL.
|
||||
|
||||
RandomX OpenCL is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
RandomX OpenCL is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with RandomX OpenCL. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
//Dataset base size in bytes. Must be a power of 2.
|
||||
#define RANDOMX_DATASET_BASE_SIZE 2147483648
|
||||
|
||||
//Dataset extra size. Must be divisible by 64.
|
||||
#define RANDOMX_DATASET_EXTRA_SIZE 33554368
|
||||
|
||||
//Scratchpad L3 size in bytes. Must be a power of 2.
|
||||
#define RANDOMX_SCRATCHPAD_L3 2097152
|
||||
|
||||
//Scratchpad L2 size in bytes. Must be a power of two and less than or equal to RANDOMX_SCRATCHPAD_L3.
|
||||
#define RANDOMX_SCRATCHPAD_L2 262144
|
||||
|
||||
//Scratchpad L1 size in bytes. Must be a power of two (minimum 64) and less than or equal to RANDOMX_SCRATCHPAD_L2.
|
||||
#define RANDOMX_SCRATCHPAD_L1 16384
|
||||
|
||||
//Jump condition mask size in bits.
|
||||
#define RANDOMX_JUMP_BITS 8
|
||||
|
||||
//Jump condition mask offset in bits. The sum of RANDOMX_JUMP_BITS and RANDOMX_JUMP_OFFSET must not exceed 16.
|
||||
#define RANDOMX_JUMP_OFFSET 8
|
||||
|
||||
//Integer instructions
|
||||
#define RANDOMX_FREQ_IADD_RS 25
|
||||
#define RANDOMX_FREQ_IADD_M 7
|
||||
#define RANDOMX_FREQ_ISUB_R 16
|
||||
#define RANDOMX_FREQ_ISUB_M 7
|
||||
#define RANDOMX_FREQ_IMUL_R 16
|
||||
#define RANDOMX_FREQ_IMUL_M 4
|
||||
#define RANDOMX_FREQ_IMULH_R 4
|
||||
#define RANDOMX_FREQ_IMULH_M 1
|
||||
#define RANDOMX_FREQ_ISMULH_R 4
|
||||
#define RANDOMX_FREQ_ISMULH_M 1
|
||||
#define RANDOMX_FREQ_IMUL_RCP 8
|
||||
#define RANDOMX_FREQ_INEG_R 2
|
||||
#define RANDOMX_FREQ_IXOR_R 15
|
||||
#define RANDOMX_FREQ_IXOR_M 5
|
||||
#define RANDOMX_FREQ_IROR_R 8
|
||||
#define RANDOMX_FREQ_IROL_R 2
|
||||
#define RANDOMX_FREQ_ISWAP_R 4
|
||||
|
||||
//Floating point instructions
|
||||
#define RANDOMX_FREQ_FSWAP_R 4
|
||||
#define RANDOMX_FREQ_FADD_R 16
|
||||
#define RANDOMX_FREQ_FADD_M 5
|
||||
#define RANDOMX_FREQ_FSUB_R 16
|
||||
#define RANDOMX_FREQ_FSUB_M 5
|
||||
#define RANDOMX_FREQ_FSCAL_R 6
|
||||
#define RANDOMX_FREQ_FMUL_R 32
|
||||
#define RANDOMX_FREQ_FDIV_M 4
|
||||
#define RANDOMX_FREQ_FSQRT_R 6
|
||||
|
||||
//Control instructions
|
||||
#define RANDOMX_FREQ_CBRANCH 16
|
||||
#define RANDOMX_FREQ_CFROUND 1
|
||||
|
||||
//Store instruction
|
||||
#define RANDOMX_FREQ_ISTORE 16
|
||||
|
||||
//No-op instruction
|
||||
#define RANDOMX_FREQ_NOP 0
|
||||
|
||||
#define RANDOMX_DATASET_ITEM_SIZE 64
|
||||
|
||||
#define RANDOMX_PROGRAM_SIZE 320
|
||||
|
||||
#define HASH_SIZE 64
|
||||
#define ENTROPY_SIZE (128 + RANDOMX_PROGRAM_SIZE * 8)
|
||||
#define REGISTERS_SIZE 256
|
||||
#define IMM_BUF_SIZE (RANDOMX_PROGRAM_SIZE * 4 - REGISTERS_SIZE)
|
||||
#define IMM_INDEX_COUNT ((IMM_BUF_SIZE / 4) - 2)
|
||||
#define VM_STATE_SIZE (REGISTERS_SIZE + IMM_BUF_SIZE + RANDOMX_PROGRAM_SIZE * 4)
|
||||
#define ROUNDING_MODE (RANDOMX_FREQ_CFROUND ? -1 : 0)
|
||||
|
||||
// Scratchpad L1/L2/L3 bits
|
||||
#define LOC_L1 (32 - 14)
|
||||
#define LOC_L2 (32 - 18)
|
||||
#define LOC_L3 (32 - 21)
|
Loading…
Add table
Add a link
Reference in a new issue