From a6a0fb965a8fde9aaeeca103f26255f9951d2e7d Mon Sep 17 00:00:00 2001 From: XMRig Date: Wed, 6 Feb 2019 01:27:50 +0700 Subject: [PATCH] Fixed self test, cn/gpu not support multihash mode. --- src/workers/MultiWorker.cpp | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/src/workers/MultiWorker.cpp b/src/workers/MultiWorker.cpp index a25665df6..9b0877b80 100644 --- a/src/workers/MultiWorker.cpp +++ b/src/workers/MultiWorker.cpp @@ -54,17 +54,24 @@ bool MultiWorker::selfTest() using namespace xmrig; if (m_thread->algorithm() == CRYPTONIGHT) { - return verify(VARIANT_0, test_output_v0) && - verify(VARIANT_1, test_output_v1) && - verify(VARIANT_2, test_output_v2) && - verify(VARIANT_XTL, test_output_xtl) && - verify(VARIANT_MSR, test_output_msr) && - verify(VARIANT_XAO, test_output_xao) && - verify(VARIANT_RTO, test_output_rto) && -# ifndef XMRIG_NO_CN_GPU - verify(VARIANT_GPU, test_output_gpu) && -# endif - verify(VARIANT_HALF, test_output_half); + const bool rc = verify(VARIANT_0, test_output_v0) && + verify(VARIANT_1, test_output_v1) && + verify(VARIANT_2, test_output_v2) && + verify(VARIANT_XTL, test_output_xtl) && + verify(VARIANT_MSR, test_output_msr) && + verify(VARIANT_XAO, test_output_xao) && + verify(VARIANT_RTO, test_output_rto) && + verify(VARIANT_HALF, test_output_half); + +# ifndef XMRIG_NO_CN_GPU + if (!rc || N > 1) { + return rc; + } + + return verify(VARIANT_GPU, test_output_gpu); +# else + return rc; +# endif } # ifndef XMRIG_NO_AEON