This commit is contained in:
Konstantin Matskevich
2013-12-30 13:06:32 +04:00
parent a70a8e8680
commit 55634c1f52
3 changed files with 14 additions and 1 deletions

View File

@@ -51,12 +51,14 @@ namespace clahe
const int tilesX, const int tilesY, const cv::Size tileSize,
const int clipLimit, const float lutScale)
{
cv::ocl::Kernel _k("calcLut", cv::ocl::imgproc::clahe_oclsrc);
bool is_cpu = cv::ocl::Device::getDefault().type() == cv::ocl::Device::TYPE_CPU;
cv::String opts;
if(is_cpu)
opts = "-D CPU ";
else
opts = cv::format("-D WAVE_SIZE=%d", cv::ocl::Device::getDefault().maxWorkGroupSize());
opts = cv::format("-D WAVE_SIZE=%d", _k.preferedWorkGroupSizeMultiple());
cv::ocl::Kernel k("calcLut", cv::ocl::imgproc::clahe_oclsrc, opts);
if(k.empty())