Submit top benchmark diff.

This commit is contained in:
XMRig 2020-11-17 07:33:20 +07:00
parent e2ea11ffeb
commit a2a0defeef
No known key found for this signature in database
GPG key ID: 446A53638BE94409
8 changed files with 17 additions and 17 deletions

View file

@ -39,6 +39,7 @@ static std::shared_ptr<Async> async;
static uint32_t remaining = 0;
static uint64_t doneTime = 0;
static uint64_t result = 0;
static uint64_t topDiff = 0;
IBenchListener *BenchState::m_listener = nullptr;
@ -75,7 +76,7 @@ uint64_t xmrig::BenchState::start(size_t threads, const IBackend *backend)
remaining = static_cast<uint32_t>(threads);
async = std::make_shared<Async>([] {
m_listener->onBenchDone(result, doneTime);
m_listener->onBenchDone(result, topDiff, doneTime);
async.reset();
xmrig::done = true;
});
@ -94,7 +95,7 @@ void xmrig::BenchState::destroy()
}
void xmrig::BenchState::done(uint64_t data, uint64_t ts)
void xmrig::BenchState::done(uint64_t data, uint64_t diff, uint64_t ts)
{
assert(async && remaining > 0);
@ -102,6 +103,7 @@ void xmrig::BenchState::done(uint64_t data, uint64_t ts)
result ^= data;
doneTime = std::max(doneTime, ts);
topDiff = std::max(topDiff, diff);
--remaining;
if (remaining == 0) {

View file

@ -39,7 +39,7 @@ public:
static uint64_t referenceHash(const Algorithm &algo, uint32_t size, uint32_t threads);
static uint64_t start(size_t threads, const IBackend *backend);
static void destroy();
static void done(uint64_t data, uint64_t ts);
static void done(uint64_t data, uint64_t diff, uint64_t ts);
inline static uint32_t size() { return m_size; }
inline static void setListener(IBenchListener *listener) { m_listener = listener; }

View file

@ -33,6 +33,7 @@ static const std::map<int, std::map<uint32_t, uint64_t> > hashCheck = {
{ Algorithm::RX_0, {
# ifndef NDEBUG
{ 10000U, 0x4A597463865ACF0EULL },
{ 20000U, 0xC82B490C757DA738ULL },
# endif
{ 250000U, 0x7D6054757BB08A63ULL },
{ 500000U, 0x96607546DE1F5ECCULL },
@ -50,6 +51,7 @@ static const std::map<int, std::map<uint32_t, uint64_t> > hashCheck = {
{ Algorithm::RX_WOW, {
# ifndef NDEBUG
{ 10000U, 0x6B0918757100B338ULL },
{ 20000U, 0x0B55785C1837F41BULL },
# endif
{ 250000U, 0xC7F712C9603E2603ULL },
{ 500000U, 0x21A0E5AAE6DA7D8DULL },
@ -71,6 +73,7 @@ static const std::map<int, std::map<uint32_t, uint64_t> > hashCheck1T = {
{ Algorithm::RX_0, {
# ifndef NDEBUG
{ 10000U, 0xADFC3A66F79BFE7FULL },
{ 20000U, 0x8ED578A60D55C0DBULL },
# endif
{ 250000U, 0x90A15B799486F3EBULL },
{ 500000U, 0xAA83118FEE570F9AULL },
@ -88,6 +91,7 @@ static const std::map<int, std::map<uint32_t, uint64_t> > hashCheck1T = {
{ Algorithm::RX_WOW, {
# ifndef NDEBUG
{ 10000U, 0x9EC1B9B8C8C7F082ULL },
{ 20000U, 0xF1DA44FA2A20D730ULL },
# endif
{ 250000U, 0x7B409F096C863207ULL },
{ 500000U, 0x70B7B80D15654216ULL },

View file

@ -37,7 +37,7 @@ public:
IBenchListener() = default;
virtual ~IBenchListener() = default;
virtual void onBenchDone(uint64_t result, uint64_t ts) = 0;
virtual void onBenchDone(uint64_t result, uint64_t diff, uint64_t ts) = 0;
virtual void onBenchStart(uint64_t ts, uint32_t threads, const IBackend *backend) = 0;
};