Fix GPU nicehash support

This commit is contained in:
fireice-uk
2017-10-22 13:15:18 +01:00
parent d3c5911f8e
commit 265ef629a1
2 changed files with 7 additions and 2 deletions
+3 -1
View File
@@ -170,7 +170,6 @@ void minethd::work_main()
cryptonight_ctx* cpu_ctx;
cpu_ctx = cpu::minethd::minethd_alloc_ctx();
cn_hash_fun hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/);
pGpuCtx->Nonce = *(uint32_t*)(oWork.bWorkBlob + 39);
globalStates::inst().iConsumeCnt++;
while (bQuit == 0)
@@ -195,6 +194,9 @@ void minethd::work_main()
uint32_t target = oWork.iTarget32;
XMRSetJob(pGpuCtx, oWork.bWorkBlob, oWork.iWorkSize, target);
if(oWork.bNiceHash)
pGpuCtx->Nonce = *(uint32_t*)(oWork.bWorkBlob + 39);
while(globalStates::inst().iGlobalJobNo.load(std::memory_order_relaxed) == iJobNo)
{
//Allocate a new nonce every 16 rounds
+4 -1
View File
@@ -195,7 +195,7 @@ void minethd::work_main()
cryptonight_ctx* cpu_ctx;
cpu_ctx = cpu::minethd::minethd_alloc_ctx();
cn_hash_fun hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/);
uint32_t iNonce = *(uint32_t*)(oWork.bWorkBlob + 39);
uint32_t iNonce;
globalStates::inst().iConsumeCnt++;
@@ -227,6 +227,9 @@ void minethd::work_main()
assert(sizeof(job_result::sJobID) == sizeof(pool_job::sJobID));
if(oWork.bNiceHash)
iNonce = *(uint32_t*)(oWork.bWorkBlob + 39);
while(globalStates::inst().iGlobalJobNo.load(std::memory_order_relaxed) == iJobNo)
{
//Allocate a new nonce every 16 rounds