Skip to content
Snippets Groups Projects
Commit 4524b875 authored by psychocrypt's avatar psychocrypt
Browse files

OpenCL: fix work size message

Fix message with the maximal allowed worksize if cryptonight_gpu is
used.
parent 2e701a7a
No related branches found
No related tags found
No related merge requests found
...@@ -284,10 +284,21 @@ size_t InitOpenCLGpu(cl_context opencl_ctx, GpuContext* ctx, const char* source_ ...@@ -284,10 +284,21 @@ size_t InitOpenCLGpu(cl_context opencl_ctx, GpuContext* ctx, const char* source_
return ERR_OCL_API; return ERR_OCL_API;
} }
/* Some kernel spawn 8 times more threads than the user is configuring. auto neededAlgorithms = ::jconf::inst()->GetCurrentCoinSelection().GetAllAlgorithms();
* To give the user the correct maximum work size we divide the hardware specific max by 8. bool useCryptonight_gpu = std::find(neededAlgorithms.begin(), neededAlgorithms.end(), cryptonight_gpu) != neededAlgorithms.end();
*/
MaximumWorkSize /= 8; 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); 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) #if defined(CL_VERSION_2_0) && !defined(CONF_ENFORCE_OpenCL_1_2)
const cl_queue_properties CommandQueueProperties[] = { 0, 0, 0 }; const cl_queue_properties CommandQueueProperties[] = { 0, 0, 0 };
...@@ -316,8 +327,6 @@ size_t InitOpenCLGpu(cl_context opencl_ctx, GpuContext* ctx, const char* source_ ...@@ -316,8 +327,6 @@ size_t InitOpenCLGpu(cl_context opencl_ctx, GpuContext* ctx, const char* source_
return ERR_OCL_API; return ERR_OCL_API;
} }
auto neededAlgorithms = ::jconf::inst()->GetCurrentCoinSelection().GetAllAlgorithms();
size_t scratchPadSize = 0; size_t scratchPadSize = 0;
for(const auto algo : neededAlgorithms) for(const auto algo : neededAlgorithms)
{ {
......
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