From 0369431ebd08aa22bd6ba2bc2693881d73106d0c Mon Sep 17 00:00:00 2001 From: Jun Zhao Date: Tue, 26 Dec 2017 10:25:36 +0800 Subject: [PATCH] opencl/cvtclr_dx: fix not compile-time constants issue. fix the "initializing global variables with values that are not compile-time constants" issue in Intel SDK for OpenCL. The root cause is when initializing global variables with value, the variable need is compile-time constants. Thanks Zheng, Yang , Chodor, Jaroslaw give a help. Signed-off-by: Liu,Kaixuan Signed-off-by: Jun Zhao --- modules/core/src/opencl/cvtclr_dx.cl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/core/src/opencl/cvtclr_dx.cl b/modules/core/src/opencl/cvtclr_dx.cl index 28029623f0..5be77e757a 100644 --- a/modules/core/src/opencl/cvtclr_dx.cl +++ b/modules/core/src/opencl/cvtclr_dx.cl @@ -71,12 +71,12 @@ float c_YUV2RGBCoeffs_420[5] = 1.5959997177f }; -static __constant float CV_8U_MAX = 255.0f; -static __constant float CV_8U_HALF = 128.0f; -static __constant float BT601_BLACK_RANGE = 16.0f; -static __constant float CV_8U_SCALE = 1.0f / 255.0f; -static __constant float d1 = BT601_BLACK_RANGE / CV_8U_MAX; -static __constant float d2 = CV_8U_HALF / CV_8U_MAX; +static const __constant float CV_8U_MAX = 255.0f; +static const __constant float CV_8U_HALF = 128.0f; +static const __constant float BT601_BLACK_RANGE = 16.0f; +static const __constant float CV_8U_SCALE = 1.0f / 255.0f; +static const __constant float d1 = BT601_BLACK_RANGE / CV_8U_MAX; +static const __constant float d2 = CV_8U_HALF / CV_8U_MAX; #define NCHANNELS 3