Commit d9d9b059 authored by Alexander Alekhin's avatar Alexander Alekhin

core(ocl): add parameter to limit device max workgroup size

used by OpenCV
parent 55171b25
...@@ -1257,6 +1257,14 @@ struct Device::Impl ...@@ -1257,6 +1257,14 @@ struct Device::Impl
else else
vendorID_ = UNKNOWN_VENDOR; vendorID_ = UNKNOWN_VENDOR;
const size_t CV_OPENCL_DEVICE_MAX_WORK_GROUP_SIZE = utils::getConfigurationParameterSizeT("OPENCV_OPENCL_DEVICE_MAX_WORK_GROUP_SIZE", 0);
if (CV_OPENCL_DEVICE_MAX_WORK_GROUP_SIZE > 0)
{
const size_t new_maxWorkGroupSize = std::min(maxWorkGroupSize_, CV_OPENCL_DEVICE_MAX_WORK_GROUP_SIZE);
if (new_maxWorkGroupSize != maxWorkGroupSize_)
CV_LOG_WARNING(NULL, "OpenCL: using workgroup size: " << new_maxWorkGroupSize << " (was " << maxWorkGroupSize_ << ")");
maxWorkGroupSize_ = new_maxWorkGroupSize;
}
#if 0 #if 0
if (isExtensionSupported("cl_khr_spir")) if (isExtensionSupported("cl_khr_spir"))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment