From 734ea77c9aebaf3f0646d2f4a89166889d481d94 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Mon, 23 Oct 2017 13:56:11 +0300 Subject: [PATCH] ocl(macosx): fix CL_INVALID_BUILD_OPTIONS for gemm programs MacOSX OpenCL compiler is very strict to whitespace issues --- modules/core/src/matmul.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/core/src/matmul.cpp b/modules/core/src/matmul.cpp index 514968ad54..cfd7fa1eaa 100644 --- a/modules/core/src/matmul.cpp +++ b/modules/core/src/matmul.cpp @@ -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);