Merge xmrig v6.7.0 into master

This commit is contained in:
MoneroOcean 2020-12-23 06:03:02 +00:00
commit 1719879f7e
249 changed files with 6814 additions and 6134 deletions

View file

@ -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 + 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),
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),
data.device.index(),
data.device.topology().toString().data(),
data.device.printableName().data()

View file

@ -1,13 +1,6 @@
/* XMRig
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright (c) 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright (c) 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -63,7 +56,7 @@ namespace xmrig {
std::atomic<bool> OclWorker::ready;
static inline bool isReady() { return !Nonce::isPaused() && OclWorker::ready; }
static inline bool isReady() { return !Nonce::isPaused() && OclWorker::ready; }
static inline void printError(size_t id, const char *error)
@ -77,11 +70,10 @@ static inline void printError(size_t id, const char *error)
xmrig::OclWorker::OclWorker(size_t id, const OclLaunchData &data) :
Worker(id, data.affinity, -1),
GpuWorker(id, data.affinity, -1, data.device.index()),
m_algorithm(data.algorithm),
m_miner(data.miner),
m_sharedData(OclSharedState::get(data.device.index())),
m_deviceIndex(data.device.index())
m_sharedData(OclSharedState::get(data.device.index()))
{
switch (m_algorithm.family()) {
case Algorithm::RANDOM_X:
@ -149,13 +141,7 @@ xmrig::OclWorker::~OclWorker()
}
uint64_t xmrig::OclWorker::rawHashes() const
{
return m_hashrateData.interpolate(Chrono::steadyMSecs());
}
void xmrig::OclWorker::jobEarlyNotification(const Job& job)
void xmrig::OclWorker::jobEarlyNotification(const Job &job)
{
if (m_runner) {
m_runner->jobEarlyNotification(job);
@ -192,7 +178,7 @@ void xmrig::OclWorker::start()
break;
}
m_sharedData.resumeDelay(m_id);
m_sharedData.resumeDelay(id());
if (!consumeJob()) {
return;
@ -200,7 +186,7 @@ void xmrig::OclWorker::start()
}
while (!Nonce::isOutdated(Nonce::OPENCL, m_job.sequence())) {
m_sharedData.adjustDelay(m_id);
m_sharedData.adjustDelay(id());
const uint64_t t = Chrono::steadyMSecs();
@ -266,5 +252,5 @@ void xmrig::OclWorker::storeStats(uint64_t t)
m_sharedData.setRunTime(timeStamp - t);
Worker::storeStats();
GpuWorker::storeStats();
}

View file

@ -1,13 +1,6 @@
/* XMRig
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
* Copyright (c) 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright (c) 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -27,8 +20,7 @@
#define XMRIG_OCLWORKER_H
#include "backend/common/HashrateInterpolator.h"
#include "backend/common/Worker.h"
#include "backend/common/GpuWorker.h"
#include "backend/common/WorkerJob.h"
#include "backend/opencl/OclLaunchData.h"
#include "base/tools/Object.h"
@ -42,7 +34,7 @@ class IOclRunner;
class Job;
class OclWorker : public Worker
class OclWorker : public GpuWorker
{
public:
XMRIG_DISABLE_COPY_MOVE_DEFAULT(OclWorker)
@ -51,8 +43,7 @@ public:
~OclWorker() override;
uint64_t rawHashes() const override;
void jobEarlyNotification(const Job&) override;
void jobEarlyNotification(const Job &job) override;
static std::atomic<bool> ready;
@ -70,9 +61,6 @@ private:
IOclRunner *m_runner = nullptr;
OclSharedData &m_sharedData;
WorkerJob<1> m_job;
uint32_t m_deviceIndex;
HashrateInterpolator m_hashrateData;
};

View file

@ -93,7 +93,7 @@ xmrig::OclAstroBWTRunner::~OclAstroBWTRunner()
OclLib::release(m_tmp_indices);
OclLib::release(m_filtered_hashes);
delete m_bwt_data_sizes_host;
delete [] m_bwt_data_sizes_host;
}

View file

@ -43,6 +43,9 @@
namespace xmrig {
constexpr size_t BLOB_SIZE = 40;
OclKawPowRunner::OclKawPowRunner(size_t index, const OclLaunchData &data) : OclBaseRunner(index, data)
{
switch (data.thread.worksize())
@ -82,7 +85,7 @@ void OclKawPowRunner::run(uint32_t nonce, uint32_t *hashOutput)
const size_t global_work_offset = nonce;
const size_t global_work_size = m_intensity - (m_intensity % m_workGroupSize);
enqueueWriteBuffer(m_input, CL_FALSE, 0, 40, m_blob);
enqueueWriteBuffer(m_input, CL_FALSE, 0, BLOB_SIZE, m_blob);
const uint32_t zero[2] = {};
enqueueWriteBuffer(m_output, CL_FALSE, 0, sizeof(uint32_t), zero);
@ -177,7 +180,7 @@ void OclKawPowRunner::set(const Job &job, uint8_t *blob)
OclLib::setKernelArg(m_searchKernel, 5, sizeof(m_stop), &m_stop);
m_blob = blob;
enqueueWriteBuffer(m_input, CL_TRUE, 0, sizeof(m_blob), m_blob);
enqueueWriteBuffer(m_input, CL_TRUE, 0, BLOB_SIZE, m_blob);
}

View file

@ -306,7 +306,7 @@ private:
}
static std::string merge(std::string a, std::string b, uint32_t r)
static std::string merge(const std::string& a, const std::string& b, uint32_t r)
{
switch (r % 4)
{
@ -323,7 +323,7 @@ private:
}
static std::string math(std::string d, std::string a, std::string b, uint32_t r)
static std::string math(const std::string& d, const std::string& a, const std::string& b, uint32_t r)
{
switch (r % 11)
{

View file

@ -836,7 +836,13 @@ xmrig::String xmrig::OclLib::getProgramBuildLog(cl_program program, cl_device_id
return String();
}
char *log = new char[size + 1]();
char* log = nullptr;
try {
log = new char[size + 1]();
}
catch (...) {
return String();
}
if (getProgramBuildInfo(program, device, CL_PROGRAM_BUILD_LOG, size, log, nullptr) != CL_SUCCESS) {
delete [] log;