From fdfffa52916fdf30225bd26f6cee86eb05fbccad Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Tue, 30 Jul 2013 09:45:54 +0400 Subject: [PATCH] fixed warnings --- modules/cudaarithm/src/cuda/div_scalar.cu | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/modules/cudaarithm/src/cuda/div_scalar.cu b/modules/cudaarithm/src/cuda/div_scalar.cu index d3d2ce03f..97ada8341 100644 --- a/modules/cudaarithm/src/cuda/div_scalar.cu +++ b/modules/cudaarithm/src/cuda/div_scalar.cu @@ -56,18 +56,16 @@ void divScalar(const GpuMat& src, cv::Scalar val, bool inv, GpuMat& dst, const G namespace { - template struct SafeDiv; - template <> struct SafeDiv<1> + template struct SafeDiv; + template struct SafeDiv { - template __device__ __forceinline__ static T op(T a, T b) { return b != 0 ? a / b : 0; } }; - template <> struct SafeDiv<2> + template struct SafeDiv { - template __device__ __forceinline__ static T op(const T& a, const T& b) { T res; @@ -78,9 +76,8 @@ namespace return res; } }; - template <> struct SafeDiv<3> + template struct SafeDiv { - template __device__ __forceinline__ static T op(const T& a, const T& b) { T res; @@ -92,9 +89,8 @@ namespace return res; } }; - template <> struct SafeDiv<4> + template struct SafeDiv { - template __device__ __forceinline__ static T op(const T& a, const T& b) { T res; @@ -114,7 +110,7 @@ namespace __device__ __forceinline__ DstType operator ()(SrcType a) const { - return saturate_cast(SafeDiv::cn>::op(saturate_cast(a), val)); + return saturate_cast(SafeDiv::cn>::op(saturate_cast(a), val)); } }; @@ -124,7 +120,7 @@ namespace __device__ __forceinline__ DstType operator ()(SrcType a) const { - return saturate_cast(SafeDiv::cn>::op(val, saturate_cast(a))); + return saturate_cast(SafeDiv::cn>::op(val, saturate_cast(a))); } };