Skip to content
Snippets Groups Projects
Commit 265ef629 authored by fireice-uk's avatar fireice-uk
Browse files

Fix GPU nicehash support

parent d3c5911f
No related branches found
No related tags found
No related merge requests found
...@@ -170,7 +170,6 @@ void minethd::work_main() ...@@ -170,7 +170,6 @@ void minethd::work_main()
cryptonight_ctx* cpu_ctx; cryptonight_ctx* cpu_ctx;
cpu_ctx = cpu::minethd::minethd_alloc_ctx(); cpu_ctx = cpu::minethd::minethd_alloc_ctx();
cn_hash_fun hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/); cn_hash_fun hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/);
pGpuCtx->Nonce = *(uint32_t*)(oWork.bWorkBlob + 39);
globalStates::inst().iConsumeCnt++; globalStates::inst().iConsumeCnt++;
while (bQuit == 0) while (bQuit == 0)
...@@ -195,6 +194,9 @@ void minethd::work_main() ...@@ -195,6 +194,9 @@ void minethd::work_main()
uint32_t target = oWork.iTarget32; uint32_t target = oWork.iTarget32;
XMRSetJob(pGpuCtx, oWork.bWorkBlob, oWork.iWorkSize, target); 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) while(globalStates::inst().iGlobalJobNo.load(std::memory_order_relaxed) == iJobNo)
{ {
//Allocate a new nonce every 16 rounds //Allocate a new nonce every 16 rounds
......
...@@ -195,7 +195,7 @@ void minethd::work_main() ...@@ -195,7 +195,7 @@ void minethd::work_main()
cryptonight_ctx* cpu_ctx; cryptonight_ctx* cpu_ctx;
cpu_ctx = cpu::minethd::minethd_alloc_ctx(); cpu_ctx = cpu::minethd::minethd_alloc_ctx();
cn_hash_fun hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/); 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++; globalStates::inst().iConsumeCnt++;
...@@ -227,6 +227,9 @@ void minethd::work_main() ...@@ -227,6 +227,9 @@ void minethd::work_main()
assert(sizeof(job_result::sJobID) == sizeof(pool_job::sJobID)); 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) while(globalStates::inst().iGlobalJobNo.load(std::memory_order_relaxed) == iJobNo)
{ {
//Allocate a new nonce every 16 rounds //Allocate a new nonce every 16 rounds
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment