From d8b192c84d0b832174ece168356863674471ffb7 Mon Sep 17 00:00:00 2001 From: yao Date: Mon, 20 May 2013 14:46:17 +0800 Subject: [PATCH] Fix the mismatch on NV GPUs --- modules/ocl/src/opencl/arithm_mul.cl | 8 +++++++- modules/ocl/src/tvl1flow.cpp | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/ocl/src/opencl/arithm_mul.cl b/modules/ocl/src/opencl/arithm_mul.cl index e1cc9f6ab..40988f5fe 100644 --- a/modules/ocl/src/opencl/arithm_mul.cl +++ b/modules/ocl/src/opencl/arithm_mul.cl @@ -277,9 +277,15 @@ __kernel void arithm_mul_D6 (__global double *src1, int src1_step, int src1_offs } #endif +#ifdef DOUBLE_SUPPORT +#define SCALAR_TYPE double +#else +#define SCALAR_TYPE float +#endif + __kernel void arithm_muls_D5 (__global float *src1, int src1_step, int src1_offset, __global float *dst, int dst_step, int dst_offset, - int rows, int cols, int dst_step1, float scalar) + int rows, int cols, int dst_step1, SCALAR_TYPE scalar) { int x = get_global_id(0); int y = get_global_id(1); diff --git a/modules/ocl/src/tvl1flow.cpp b/modules/ocl/src/tvl1flow.cpp index 8182f41a1..a322f62a4 100644 --- a/modules/ocl/src/tvl1flow.cpp +++ b/modules/ocl/src/tvl1flow.cpp @@ -472,4 +472,8 @@ void ocl_tvl1flow::warpBackward(const oclMat &I0, const oclMat &I1, oclMat &I1x, args.push_back( make_pair( sizeof(cl_int), (void*)&u2_offset_y)); openCLExecuteKernel(clCxt, &tvl1flow, kernelName, globalThread, localThread, args, -1, -1); + + releaseTexture(I1_tex); + releaseTexture(I1x_tex); + releaseTexture(I1y_tex); } \ No newline at end of file