Skip to content

Commit 0369431

Browse files
committed
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 <yang.zheng@intel.com>, Chodor, Jaroslaw <jaroslaw.chodor@intel.com> give a help. Signed-off-by: Liu,Kaixuan <kaixuan.liu@intel.com> Signed-off-by: Jun Zhao <jun.zhao@intel.com>
1 parent 047764f commit 0369431

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

modules/core/src/opencl/cvtclr_dx.cl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ float c_YUV2RGBCoeffs_420[5] =
7171
1.5959997177f
7272
};
7373

74-
static __constant float CV_8U_MAX = 255.0f;
75-
static __constant float CV_8U_HALF = 128.0f;
76-
static __constant float BT601_BLACK_RANGE = 16.0f;
77-
static __constant float CV_8U_SCALE = 1.0f / 255.0f;
78-
static __constant float d1 = BT601_BLACK_RANGE / CV_8U_MAX;
79-
static __constant float d2 = CV_8U_HALF / CV_8U_MAX;
74+
static const __constant float CV_8U_MAX = 255.0f;
75+
static const __constant float CV_8U_HALF = 128.0f;
76+
static const __constant float BT601_BLACK_RANGE = 16.0f;
77+
static const __constant float CV_8U_SCALE = 1.0f / 255.0f;
78+
static const __constant float d1 = BT601_BLACK_RANGE / CV_8U_MAX;
79+
static const __constant float d2 = CV_8U_HALF / CV_8U_MAX;
8080

8181
#define NCHANNELS 3
8282

0 commit comments

Comments
 (0)