Improved thread self test error message.

This commit is contained in:
XMRig 2019-09-16 01:27:51 +07:00
parent d8b07570a3
commit 2a107cc463
6 changed files with 30 additions and 8 deletions

View file

@ -29,6 +29,7 @@
#include "backend/common/Workers.h"
#include "backend/cpu/CpuWorker.h"
#include "base/io/log/Log.h"
#include "base/tools/Object.h"
#ifdef XMRIG_FEATURE_OPENCL
@ -42,9 +43,10 @@ namespace xmrig {
class WorkersPrivate
{
public:
inline WorkersPrivate()
{
}
XMRIG_DISABLE_COPY_MOVE(WorkersPrivate)
WorkersPrivate() = default;
inline ~WorkersPrivate()
@ -155,7 +157,7 @@ void xmrig::Workers<T>::onReady(void *arg)
IWorker *worker = create(handle);
if (!worker || !worker->selfTest()) {
LOG_ERR("thread %zu error: \"hash self-test failed\".", worker->id());
LOG_ERR("%s " RED("thread ") RED_BOLD("#%zu") RED(" self-test failed"), T::tag(), worker->id());
delete worker;
return;

View file

@ -26,7 +26,7 @@
#define XMRIG_IBACKEND_H
#include <stdint.h>
#include <cstdint>
#include "rapidjson/fwd.h"

View file

@ -24,13 +24,15 @@
*/
#include <algorithm>
#include "backend/cpu/CpuLaunchData.h"
#include "backend/common/Tags.h"
#include "backend/cpu/CpuConfig.h"
#include <algorithm>
xmrig::CpuLaunchData::CpuLaunchData(const Miner *miner, const Algorithm &algorithm, const CpuConfig &config, const CpuThread &thread) :
algorithm(algorithm),
assembly(config.assembly()),
@ -65,3 +67,9 @@ xmrig::CnHash::AlgoVariant xmrig::CpuLaunchData::av() const
return static_cast<CnHash::AlgoVariant>(!hwAES ? (intensity + 5) : (intensity + 2));
}
const char *xmrig::CpuLaunchData::tag()
{
return cpu_tag();
}

View file

@ -54,6 +54,8 @@ public:
inline bool operator!=(const CpuLaunchData &other) const { return !isEqual(other); }
inline bool operator==(const CpuLaunchData &other) const { return isEqual(other); }
static const char *tag();
const Algorithm algorithm;
const Assembly assembly;
const bool hugePages;

View file

@ -25,6 +25,8 @@
#include "backend/opencl/OclLaunchData.h"
#include "backend/common/Tags.h"
#include "backend/opencl/OclConfig.h"
@ -45,3 +47,9 @@ bool xmrig::OclLaunchData::isEqual(const OclLaunchData &other) const
return (other.algorithm == algorithm &&
other.thread == thread);
}
const char *xmrig::OclLaunchData::tag()
{
return ocl_tag();
}

View file

@ -62,6 +62,8 @@ public:
inline bool operator!=(const OclLaunchData &other) const { return !isEqual(other); }
inline bool operator==(const OclLaunchData &other) const { return isEqual(other); }
static const char *tag();
cl_context ctx = nullptr;
const Algorithm algorithm;
const bool cache;