diff --git a/modules/ocl/src/opencl/arithm_add_scalar.cl b/modules/ocl/src/opencl/arithm_add_scalar.cl index f908b89f5..671bd1295 100644 --- a/modules/ocl/src/opencl/arithm_add_scalar.cl +++ b/modules/ocl/src/opencl/arithm_add_scalar.cl @@ -70,7 +70,7 @@ #if defined (FUNC_ABS) #define EXPRESSION \ - T value = (src1[src1_index] > 0) ? src1[src1_index] : -src1[src1_index]; \ + T value = src1[src1_index] > (T)(0) ? src1[src1_index] : -src1[src1_index]; \ dst[dst_index] = value; #endif diff --git a/modules/ocl/test/test_arithm.cpp b/modules/ocl/test/test_arithm.cpp index db05f4556..a5d4e08db 100644 --- a/modules/ocl/test/test_arithm.cpp +++ b/modules/ocl/test/test_arithm.cpp @@ -462,7 +462,7 @@ TEST_P(Min, Mat) random_roi(); dst1_roi = cv::min(src1_roi, src2_roi); - cv::ocl::min(gsrc1, gsrc2, gdst1); + cv::ocl::min(gsrc1_roi, gsrc2_roi, gdst1_roi); Near(0); } } @@ -476,7 +476,7 @@ TEST_P(Max, Mat) random_roi(); dst1_roi = cv::min(src1_roi, src2_roi); - cv::ocl::min(gsrc1, gsrc2, gdst1); + cv::ocl::min(gsrc1_roi, gsrc2_roi, gdst1_roi); Near(0); } } @@ -492,7 +492,7 @@ TEST_P(Abs, Abs) random_roi(); dst1_roi = cv::abs(src1_roi); - cv::ocl::abs(gsrc1, gdst1); + cv::ocl::abs(gsrc1_roi, gdst1_roi); Near(0); } } @@ -1466,7 +1466,7 @@ TEST_P(Norm, NORM_L1) const double cpuRes = cv::norm(src1_roi, src2_roi, type); const double gpuRes = cv::ocl::norm(gsrc1_roi, gsrc2_roi, type); - EXPECT_NEAR(cpuRes, gpuRes, 0.1); + EXPECT_NEAR(cpuRes, gpuRes, 0.2); } }