ocl(macosx): fix CL_INVALID_BUILD_OPTIONS for gemm programs
authorAlexander Alekhin <alexander.alekhin@intel.com>
Mon, 23 Oct 2017 10:56:11 +0000 (13:56 +0300)
committerAlexander Alekhin <alexander.alekhin@intel.com>
Mon, 23 Oct 2017 10:56:11 +0000 (13:56 +0300)
MacOSX OpenCL compiler is very strict to whitespace issues

modules/core/src/matmul.cpp

index 514968a..cfd7fa1 100644 (file)
@@ -845,11 +845,11 @@ static bool ocl_gemm( InputArray matA, InputArray matB, double alpha,
         int vectorWidths[] = { 4, 4, 2, 2, 1, 4, cn, -1 };
         int kercn = ocl::checkOptimalVectorWidth(vectorWidths, B, D);
 
-        opts += format(" -D T=%s -D T1=%s -D WT=%s -D cn=%d -D kercn=%d -D LOCAL_SIZE=%d %s %s %s",
+        opts += format(" -D T=%s -D T1=%s -D WT=%s -D cn=%d -D kercn=%d -D LOCAL_SIZE=%d%s%s%s",
                           ocl::typeToStr(type), ocl::typeToStr(depth), ocl::typeToStr(CV_MAKETYPE(depth, kercn)),
                           cn, kercn, block_size,
-                          (sizeA.width % block_size !=0) ? "-D NO_MULT" : "",
-                          haveC ? "-D HAVE_C" : "",
+                          (sizeA.width % block_size !=0) ? " -D NO_MULT" : "",
+                          haveC ? " -D HAVE_C" : "",
                           doubleSupport ? " -D DOUBLE_SUPPORT" : "");
 
         ocl::Kernel k("gemm", cv::ocl::core::gemm_oclsrc, opts);