diff options
author | fireice-uk <fireice-uk@users.noreply.github.com> | 2017-10-23 19:14:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-23 19:14:20 +0100 |
commit | 7030f1b3ab2ff9670c5251919d00387095cf71f2 (patch) | |
tree | 40c19dd7735f372aa194f1399aed4a30d81a1c24 /xmrstak/backend/amd/amd_gpu/gpu.cpp | |
parent | a7116b999efae0b303cd2474bbea3c918a4fe8b3 (diff) | |
parent | 14ceeaca2ea501d1c4ad9ba90655cc3204cd27c3 (diff) | |
download | xmr-stak-7030f1b3ab2ff9670c5251919d00387095cf71f2.zip xmr-stak-7030f1b3ab2ff9670c5251919d00387095cf71f2.tar.gz |
Merge pull request #45 from fireice-uk/topic-nonce-alloc
Implement pool-controlled nonce allocation
Diffstat (limited to 'xmrstak/backend/amd/amd_gpu/gpu.cpp')
-rw-r--r-- | xmrstak/backend/amd/amd_gpu/gpu.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/xmrstak/backend/amd/amd_gpu/gpu.cpp b/xmrstak/backend/amd/amd_gpu/gpu.cpp index f9908cb..37adc5b 100644 --- a/xmrstak/backend/amd/amd_gpu/gpu.cpp +++ b/xmrstak/backend/amd/amd_gpu/gpu.cpp @@ -844,7 +844,8 @@ size_t XMRRunJob(GpuContext* ctx, cl_uint* HashOutput) } }*/ - if((ret = clEnqueueNDRangeKernel(ctx->CommandQueues, ctx->Kernels[1], 1, &ctx->Nonce, &g_thd, &w_size, 0, NULL, NULL)) != CL_SUCCESS) + size_t tmpNonce = ctx->Nonce; + if((ret = clEnqueueNDRangeKernel(ctx->CommandQueues, ctx->Kernels[1], 1, &tmpNonce, &g_thd, &w_size, 0, NULL, NULL)) != CL_SUCCESS) { printer::inst()->print_msg(L1,"Error %s when calling clEnqueueNDRangeKernel for kernel %d.", err_to_str(ret), 1); return ERR_OCL_API; @@ -897,7 +898,8 @@ size_t XMRRunJob(GpuContext* ctx, cl_uint* HashOutput) BranchNonces[i] = ((BranchNonces[i] + w_size - 1u) / w_size) * w_size; // number of global threads must be a multiple of the work group size (w_size) assert(BranchNonces[i]%w_size == 0); - if((ret = clEnqueueNDRangeKernel(ctx->CommandQueues, ctx->Kernels[i + 3], 1, &ctx->Nonce, BranchNonces + i, &w_size, 0, NULL, NULL)) != CL_SUCCESS) + size_t tmpNonce = ctx->Nonce; + if((ret = clEnqueueNDRangeKernel(ctx->CommandQueues, ctx->Kernels[i + 3], 1, &tmpNonce, BranchNonces + i, &w_size, 0, NULL, NULL)) != CL_SUCCESS) { printer::inst()->print_msg(L1,"Error %s when calling clEnqueueNDRangeKernel for kernel %d.", err_to_str(ret), i + 3); return ERR_OCL_API; |