From fdc133d8c9e112d4a20ffc9f2efdfbb7754f048b Mon Sep 17 00:00:00 2001 From: peng xiao Date: Thu, 30 May 2013 09:37:05 +0800 Subject: [PATCH] Fix ocl::pyrup kernel build on Mac. --- modules/ocl/src/opencl/pyr_up.cl | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/modules/ocl/src/opencl/pyr_up.cl b/modules/ocl/src/opencl/pyr_up.cl index ef41c94..4afa7b7 100644 --- a/modules/ocl/src/opencl/pyr_up.cl +++ b/modules/ocl/src/opencl/pyr_up.cl @@ -389,8 +389,8 @@ __kernel void pyrUp_C4_D0(__global uchar4* src,__global uchar4* dst, float4 sum = (float4)(0,0,0,0); - const int evenFlag = (int)((tidx & 1) == 0); - const int oddFlag = (int)((tidx & 1) != 0); + const float4 evenFlag = (float4)((tidx & 1) == 0); + const float4 oddFlag = (float4)((tidx & 1) != 0); const bool eveny = ((tidy & 1) == 0); float4 co1 = (float4)(0.375f, 0.375f, 0.375f, 0.375f); @@ -455,6 +455,7 @@ __kernel void pyrUp_C4_D0(__global uchar4* src,__global uchar4* dst, dst[x + y * dstStep] = convert_uchar4_sat_rte(4.0f * sum); } } + /////////////////////////////////////////////////////////////////////// ////////////////////////// CV_16UC4 ////////////////////////////////// /////////////////////////////////////////////////////////////////////// @@ -492,8 +493,8 @@ __kernel void pyrUp_C4_D2(__global ushort4* src,__global ushort4* dst, float4 sum = (float4)(0,0,0,0); - const int evenFlag = (int)((get_local_id(0) & 1) == 0); - const int oddFlag = (int)((get_local_id(0) & 1) != 0); + const float4 evenFlag = (float4)((get_local_id(0) & 1) == 0); + const float4 oddFlag = (float4)((get_local_id(0) & 1) != 0); const bool eveny = ((get_local_id(1) & 1) == 0); const int tidx = get_local_id(0); @@ -604,8 +605,8 @@ __kernel void pyrUp_C4_D5(__global float4* src,__global float4* dst, float4 sum = (float4)(0,0,0,0); - const int evenFlag = (int)((tidx & 1) == 0); - const int oddFlag = (int)((tidx & 1) != 0); + const float4 evenFlag = (float4)((tidx & 1) == 0); + const float4 oddFlag = (float4)((tidx & 1) != 0); const bool eveny = ((tidy & 1) == 0); float4 co1 = (float4)(0.375f, 0.375f, 0.375f, 0.375f); @@ -669,4 +670,4 @@ __kernel void pyrUp_C4_D5(__global float4* src,__global float4* dst, { dst[x + y * dstStep] = 4.0f * sum; } -} \ No newline at end of file +} -- 2.7.4