summaryrefslogtreecommitdiffstats
path: root/xmrstak
diff options
context:
space:
mode:
authorfireice-uk <fireice-uk@users.noreply.github.com>2017-10-17 21:35:26 +0100
committerfireice-uk <fireice-uk@users.noreply.github.com>2017-10-22 13:15:18 +0100
commit265ef629a19128a2ae7faff31179a9f4816ce2a3 (patch)
tree9b162e9713a0a702d41ea4761b07804df8f35085 /xmrstak
parentd3c5911f8e486ac0d08c5160f6d9bd934c697b91 (diff)
downloadxmr-stak-265ef629a19128a2ae7faff31179a9f4816ce2a3.zip
xmr-stak-265ef629a19128a2ae7faff31179a9f4816ce2a3.tar.gz
Fix GPU nicehash support
Diffstat (limited to 'xmrstak')
-rw-r--r--xmrstak/backend/amd/minethd.cpp4
-rw-r--r--xmrstak/backend/nvidia/minethd.cpp5
2 files changed, 7 insertions, 2 deletions
diff --git a/xmrstak/backend/amd/minethd.cpp b/xmrstak/backend/amd/minethd.cpp
index ca0b110..9d18860 100644
--- a/xmrstak/backend/amd/minethd.cpp
+++ b/xmrstak/backend/amd/minethd.cpp
@@ -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
diff --git a/xmrstak/backend/nvidia/minethd.cpp b/xmrstak/backend/nvidia/minethd.cpp
index 20d578d..8913877 100644
--- a/xmrstak/backend/nvidia/minethd.cpp
+++ b/xmrstak/backend/nvidia/minethd.cpp
@@ -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
OpenPOWER on IntegriCloud