diff --git a/xmrstak/backend/amd/amd_gpu/gpu.cpp b/xmrstak/backend/amd/amd_gpu/gpu.cpp index 857abc138cb6d7013a996a7b7f512ee503a066e4..f80c37a8b5eca84ba094d1f04fd2a21f456f3345 100644 --- a/xmrstak/backend/amd/amd_gpu/gpu.cpp +++ b/xmrstak/backend/amd/amd_gpu/gpu.cpp @@ -284,10 +284,21 @@ size_t InitOpenCLGpu(cl_context opencl_ctx, GpuContext* ctx, const char* source_ return ERR_OCL_API; } - /* Some kernel spawn 8 times more threads than the user is configuring. - * To give the user the correct maximum work size we divide the hardware specific max by 8. - */ - MaximumWorkSize /= 8; + auto neededAlgorithms = ::jconf::inst()->GetCurrentCoinSelection().GetAllAlgorithms(); + bool useCryptonight_gpu = std::find(neededAlgorithms.begin(), neededAlgorithms.end(), cryptonight_gpu) != neededAlgorithms.end(); + + if(useCryptonight_gpu) + { + // work cn_1 we use 16x more threads than configured by the user + MaximumWorkSize /= 16; + } + else + { + /* Some kernel spawn 8 times more threads than the user is configuring. + * To give the user the correct maximum work size we divide the hardware specific max by 8. + */ + MaximumWorkSize /= 8; + } printer::inst()->print_msg(L1,"Device %lu work size %lu / %lu.", ctx->deviceIdx, ctx->workSize, MaximumWorkSize); #if defined(CL_VERSION_2_0) && !defined(CONF_ENFORCE_OpenCL_1_2) const cl_queue_properties CommandQueueProperties[] = { 0, 0, 0 }; @@ -316,8 +327,6 @@ size_t InitOpenCLGpu(cl_context opencl_ctx, GpuContext* ctx, const char* source_ return ERR_OCL_API; } - auto neededAlgorithms = ::jconf::inst()->GetCurrentCoinSelection().GetAllAlgorithms(); - size_t scratchPadSize = 0; for(const auto algo : neededAlgorithms) {