From: Vladislav Vinogradov Date: Mon, 29 Jul 2013 13:53:03 +0000 (+0400) Subject: used new device layer for cv::gpu::compare X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~3715^2~26 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ef9917ecf141604063070cca5195bad4f58f015c;p=platform%2Fupstream%2Fopencv.git used new device layer for cv::gpu::compare --- diff --git a/modules/cudaarithm/src/cuda/cmp_mat.cu b/modules/cudaarithm/src/cuda/cmp_mat.cu index cdbb963..3693fc2 100644 --- a/modules/cudaarithm/src/cuda/cmp_mat.cu +++ b/modules/cudaarithm/src/cuda/cmp_mat.cu @@ -40,30 +40,54 @@ // //M*/ -#if !defined CUDA_DISABLER +#include "opencv2/opencv_modules.hpp" -#include "opencv2/core/cuda/common.hpp" -#include "opencv2/core/cuda/functional.hpp" -#include "opencv2/core/cuda/transform.hpp" -#include "opencv2/core/cuda/saturate_cast.hpp" -#include "opencv2/core/cuda/simd_functions.hpp" +#ifndef HAVE_OPENCV_CUDEV -#include "arithm_func_traits.hpp" +#error "opencv_cudev is required" -using namespace cv::cuda; -using namespace cv::cuda::device; +#else -namespace arithm +#include "opencv2/cudev.hpp" + +using namespace cv::cudev; + +void cmpMat(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, const GpuMat&, double, Stream& stream, int cmpop); + +namespace { + template struct CmpOp : binary_function + { + __device__ __forceinline__ uchar operator()(T a, T b) const + { + Op op; + return -op(a, b); + } + }; + + template struct TransformPolicy : DefaultTransformPolicy + { + }; + template <> struct TransformPolicy : DefaultTransformPolicy + { + enum { + shift = 1 + }; + }; + + template