fixed constructors for functional objects (added __host__ modifier)
authorVladislav Vinogradov <vlad.vinogradov@itseez.com>
Fri, 7 Jun 2013 10:46:42 +0000 (14:46 +0400)
committerVladislav Vinogradov <vlad.vinogradov@itseez.com>
Fri, 7 Jun 2013 12:32:43 +0000 (16:32 +0400)
16 files changed:
modules/gpuarithm/src/cuda/absdiff_mat.cu
modules/gpuarithm/src/cuda/absdiff_scalar.cu
modules/gpuarithm/src/cuda/add_mat.cu
modules/gpuarithm/src/cuda/add_scalar.cu
modules/gpuarithm/src/cuda/add_weighted.cu
modules/gpuarithm/src/cuda/cmp_mat.cu
modules/gpuarithm/src/cuda/div_inv.cu
modules/gpuarithm/src/cuda/div_mat.cu
modules/gpuarithm/src/cuda/div_scalar.cu
modules/gpuarithm/src/cuda/math.cu
modules/gpuarithm/src/cuda/minmax_mat.cu
modules/gpuarithm/src/cuda/mul_mat.cu
modules/gpuarithm/src/cuda/mul_scalar.cu
modules/gpuarithm/src/cuda/reduce.cu
modules/gpuarithm/src/cuda/sub_mat.cu
modules/gpuarithm/src/cuda/sub_scalar.cu

index d47cbdc..d47068e 100644 (file)
@@ -62,8 +62,8 @@ namespace arithm
             return vabsdiff4(a, b);
         }
 
-        __device__ __forceinline__ VAbsDiff4() {}
-        __device__ __forceinline__ VAbsDiff4(const VAbsDiff4& other) {}
+        __host__ __device__ __forceinline__ VAbsDiff4() {}
+        __host__ __device__ __forceinline__ VAbsDiff4(const VAbsDiff4&) {}
     };
 
     struct VAbsDiff2 : binary_function<uint, uint, uint>
@@ -73,8 +73,8 @@ namespace arithm
             return vabsdiff2(a, b);
         }
 
-        __device__ __forceinline__ VAbsDiff2() {}
-        __device__ __forceinline__ VAbsDiff2(const VAbsDiff2& other) {}
+        __host__ __device__ __forceinline__ VAbsDiff2() {}
+        __host__ __device__ __forceinline__ VAbsDiff2(const VAbsDiff2&) {}
     };
 
     __device__ __forceinline__ int _abs(int a)
@@ -97,8 +97,8 @@ namespace arithm
             return saturate_cast<T>(_abs(a - b));
         }
 
-        __device__ __forceinline__ AbsDiffMat() {}
-        __device__ __forceinline__ AbsDiffMat(const AbsDiffMat& other) {}
+        __host__ __device__ __forceinline__ AbsDiffMat() {}
+        __host__ __device__ __forceinline__ AbsDiffMat(const AbsDiffMat&) {}
     };
 }
 
index e705609..5a89791 100644 (file)
@@ -59,7 +59,7 @@ namespace arithm
     {
         S val;
 
-        explicit AbsDiffScalar(S val_) : val(val_) {}
+        __host__ explicit AbsDiffScalar(S val_) : val(val_) {}
 
         __device__ __forceinline__ T operator ()(T a) const
         {
index 511e11d..3b1bc1f 100644 (file)
@@ -62,8 +62,8 @@ namespace arithm
             return vadd4(a, b);
         }
 
-        __device__ __forceinline__ VAdd4() {}
-        __device__ __forceinline__ VAdd4(const VAdd4& other) {}
+        __host__ __device__ __forceinline__ VAdd4() {}
+        __host__ __device__ __forceinline__ VAdd4(const VAdd4&) {}
     };
 
     struct VAdd2 : binary_function<uint, uint, uint>
@@ -73,8 +73,8 @@ namespace arithm
             return vadd2(a, b);
         }
 
-        __device__ __forceinline__ VAdd2() {}
-        __device__ __forceinline__ VAdd2(const VAdd2& other) {}
+        __host__ __device__ __forceinline__ VAdd2() {}
+        __host__ __device__ __forceinline__ VAdd2(const VAdd2&) {}
     };
 
     template <typename T, typename D> struct AddMat : binary_function<T, T, D>
@@ -84,8 +84,8 @@ namespace arithm
             return saturate_cast<D>(a + b);
         }
 
-        __device__ __forceinline__ AddMat() {}
-        __device__ __forceinline__ AddMat(const AddMat& other) {}
+        __host__ __device__ __forceinline__ AddMat() {}
+        __host__ __device__ __forceinline__ AddMat(const AddMat&) {}
     };
 }
 
index 3f43f8d..3362c2b 100644 (file)
@@ -59,7 +59,7 @@ namespace arithm
     {
         S val;
 
-        explicit AddScalar(S val_) : val(val_) {}
+        __host__ explicit AddScalar(S val_) : val(val_) {}
 
         __device__ __forceinline__ D operator ()(T a) const
         {
index 88d8de9..bf632d6 100644 (file)
@@ -74,7 +74,7 @@ namespace arithm
         float beta;
         float gamma;
 
-        AddWeighted_(double alpha_, double beta_, double gamma_) : alpha(static_cast<float>(alpha_)), beta(static_cast<float>(beta_)), gamma(static_cast<float>(gamma_)) {}
+        __host__ AddWeighted_(double alpha_, double beta_, double gamma_) : alpha(static_cast<float>(alpha_)), beta(static_cast<float>(beta_)), gamma(static_cast<float>(gamma_)) {}
 
         __device__ __forceinline__ D operator ()(T1 a, T2 b) const
         {
@@ -87,7 +87,7 @@ namespace arithm
         double beta;
         double gamma;
 
-        AddWeighted_(double alpha_, double beta_, double gamma_) : alpha(alpha_), beta(beta_), gamma(gamma_) {}
+        __host__ AddWeighted_(double alpha_, double beta_, double gamma_) : alpha(alpha_), beta(beta_), gamma(gamma_) {}
 
         __device__ __forceinline__ D operator ()(T1 a, T2 b) const
         {
index 9cf9787..6602edf 100644 (file)
@@ -62,8 +62,8 @@ namespace arithm
             return vcmpeq4(a, b);
         }
 
-        __device__ __forceinline__ VCmpEq4() {}
-        __device__ __forceinline__ VCmpEq4(const VCmpEq4& other) {}
+        __host__ __device__ __forceinline__ VCmpEq4() {}
+        __host__ __device__ __forceinline__ VCmpEq4(const VCmpEq4&) {}
     };
     struct VCmpNe4 : binary_function<uint, uint, uint>
     {
@@ -72,8 +72,8 @@ namespace arithm
             return vcmpne4(a, b);
         }
 
-        __device__ __forceinline__ VCmpNe4() {}
-        __device__ __forceinline__ VCmpNe4(const VCmpNe4& other) {}
+        __host__ __device__ __forceinline__ VCmpNe4() {}
+        __host__ __device__ __forceinline__ VCmpNe4(const VCmpNe4&) {}
     };
     struct VCmpLt4 : binary_function<uint, uint, uint>
     {
@@ -82,8 +82,8 @@ namespace arithm
             return vcmplt4(a, b);
         }
 
-        __device__ __forceinline__ VCmpLt4() {}
-        __device__ __forceinline__ VCmpLt4(const VCmpLt4& other) {}
+        __host__ __device__ __forceinline__ VCmpLt4() {}
+        __host__ __device__ __forceinline__ VCmpLt4(const VCmpLt4&) {}
     };
     struct VCmpLe4 : binary_function<uint, uint, uint>
     {
@@ -92,8 +92,8 @@ namespace arithm
             return vcmple4(a, b);
         }
 
-        __device__ __forceinline__ VCmpLe4() {}
-        __device__ __forceinline__ VCmpLe4(const VCmpLe4& other) {}
+        __host__ __device__ __forceinline__ VCmpLe4() {}
+        __host__ __device__ __forceinline__ VCmpLe4(const VCmpLe4&) {}
     };
 
     template <class Op, typename T>
index bda3df3..9cfda93 100644 (file)
@@ -59,7 +59,7 @@ namespace arithm
     {
         S val;
 
-        explicit DivInv(S val_) : val(val_) {}
+        __host__ explicit DivInv(S val_) : val(val_) {}
 
         __device__ __forceinline__ D operator ()(T a) const
         {
index 9d50dc7..aab6638 100644 (file)
@@ -91,8 +91,8 @@ namespace arithm
             return b != 0 ? saturate_cast<D>(a / b) : 0;
         }
 
-        __device__ __forceinline__ Div() {}
-        __device__ __forceinline__ Div(const Div& other) {}
+        __host__ __device__ __forceinline__ Div() {}
+        __host__ __device__ __forceinline__ Div(const Div&) {}
     };
     template <typename T> struct Div<T, float> : binary_function<T, T, float>
     {
@@ -101,8 +101,8 @@ namespace arithm
             return b != 0 ? static_cast<float>(a) / b : 0;
         }
 
-        __device__ __forceinline__ Div() {}
-        __device__ __forceinline__ Div(const Div& other) {}
+        __host__ __device__ __forceinline__ Div() {}
+        __host__ __device__ __forceinline__ Div(const Div&) {}
     };
     template <typename T> struct Div<T, double> : binary_function<T, T, double>
     {
@@ -111,15 +111,15 @@ namespace arithm
             return b != 0 ? static_cast<double>(a) / b : 0;
         }
 
-        __device__ __forceinline__ Div() {}
-        __device__ __forceinline__ Div(const Div& other) {}
+        __host__ __device__ __forceinline__ Div() {}
+        __host__ __device__ __forceinline__ Div(const Div&) {}
     };
 
     template <typename T, typename S, typename D> struct DivScale : binary_function<T, T, D>
     {
         S scale;
 
-        explicit DivScale(S scale_) : scale(scale_) {}
+        __host__ explicit DivScale(S scale_) : scale(scale_) {}
 
         __device__ __forceinline__ D operator ()(T a, T b) const
         {
index b176cfa..42ba90c 100644 (file)
@@ -59,7 +59,7 @@ namespace arithm
     {
         S val;
 
-        explicit DivScalar(S val_) : val(val_) {}
+        __host__ explicit DivScalar(S val_) : val(val_) {}
 
         __device__ __forceinline__ D operator ()(T a) const
         {
index 86be98e..1f2e7b8 100644 (file)
@@ -94,8 +94,8 @@ namespace arithm
             return saturate_cast<T>(x * x);
         }
 
-        __device__ __forceinline__ Sqr() {}
-        __device__ __forceinline__ Sqr(const Sqr& other) {}
+        __host__ __device__ __forceinline__ Sqr() {}
+        __host__ __device__ __forceinline__ Sqr(const Sqr&) {}
     };
 }
 
@@ -190,8 +190,8 @@ namespace arithm
             return saturate_cast<T>(f(x));
         }
 
-        __device__ __forceinline__ Exp() {}
-        __device__ __forceinline__ Exp(const Exp& other) {}
+        __host__ __device__ __forceinline__ Exp() {}
+        __host__ __device__ __forceinline__ Exp(const Exp&) {}
     };
 }
 
@@ -228,7 +228,7 @@ namespace arithm
     {
         float power;
 
-        PowOp(double power_) : power(static_cast<float>(power_)) {}
+        __host__ explicit PowOp(double power_) : power(static_cast<float>(power_)) {}
 
         __device__ __forceinline__ T operator()(T e) const
         {
@@ -239,7 +239,7 @@ namespace arithm
     {
         float power;
 
-        PowOp(double power_) : power(static_cast<float>(power_)) {}
+        __host__ explicit PowOp(double power_) : power(static_cast<float>(power_)) {}
 
         __device__ __forceinline__ T operator()(T e) const
         {
@@ -255,7 +255,7 @@ namespace arithm
     {
         float power;
 
-        PowOp(double power_) : power(static_cast<float>(power_)) {}
+        __host__ explicit PowOp(double power_) : power(static_cast<float>(power_)) {}
 
         __device__ __forceinline__ float operator()(float e) const
         {
@@ -266,7 +266,7 @@ namespace arithm
     {
         double power;
 
-        PowOp(double power_) : power(power_) {}
+        __host__ explicit PowOp(double power_) : power(power_) {}
 
         __device__ __forceinline__ double operator()(double e) const
         {
index 6e9c247..0bf5a46 100644 (file)
@@ -65,8 +65,8 @@ namespace arithm
             return vmin4(a, b);
         }
 
-        __device__ __forceinline__ VMin4() {}
-        __device__ __forceinline__ VMin4(const VMin4& other) {}
+        __host__ __device__ __forceinline__ VMin4() {}
+        __host__ __device__ __forceinline__ VMin4(const VMin4&) {}
     };
 
     struct VMin2 : binary_function<uint, uint, uint>
@@ -76,8 +76,8 @@ namespace arithm
             return vmin2(a, b);
         }
 
-        __device__ __forceinline__ VMin2() {}
-        __device__ __forceinline__ VMin2(const VMin2& other) {}
+        __host__ __device__ __forceinline__ VMin2() {}
+        __host__ __device__ __forceinline__ VMin2(const VMin2&) {}
     };
 }
 
@@ -151,8 +151,8 @@ namespace arithm
             return vmax4(a, b);
         }
 
-        __device__ __forceinline__ VMax4() {}
-        __device__ __forceinline__ VMax4(const VMax4& other) {}
+        __host__ __device__ __forceinline__ VMax4() {}
+        __host__ __device__ __forceinline__ VMax4(const VMax4&) {}
     };
 
     struct VMax2 : binary_function<uint, uint, uint>
@@ -162,8 +162,8 @@ namespace arithm
             return vmax2(a, b);
         }
 
-        __device__ __forceinline__ VMax2() {}
-        __device__ __forceinline__ VMax2(const VMax2& other) {}
+        __host__ __device__ __forceinline__ VMax2() {}
+        __host__ __device__ __forceinline__ VMax2(const VMax2&) {}
     };
 }
 
index cde44ba..25bc8a5 100644 (file)
@@ -69,8 +69,8 @@ namespace arithm
             return res;
         }
 
-        __device__ __forceinline__ Mul_8uc4_32f() {}
-        __device__ __forceinline__ Mul_8uc4_32f(const Mul_8uc4_32f& other) {}
+        __host__ __device__ __forceinline__ Mul_8uc4_32f() {}
+        __host__ __device__ __forceinline__ Mul_8uc4_32f(const Mul_8uc4_32f&) {}
     };
 
     struct Mul_16sc4_32f : binary_function<short4, float, short4>
@@ -81,8 +81,8 @@ namespace arithm
                                saturate_cast<short>(a.z * b), saturate_cast<short>(a.w * b));
         }
 
-        __device__ __forceinline__ Mul_16sc4_32f() {}
-        __device__ __forceinline__ Mul_16sc4_32f(const Mul_16sc4_32f& other) {}
+        __host__ __device__ __forceinline__ Mul_16sc4_32f() {}
+        __host__ __device__ __forceinline__ Mul_16sc4_32f(const Mul_16sc4_32f&) {}
     };
 
     template <typename T, typename D> struct Mul : binary_function<T, T, D>
@@ -92,15 +92,15 @@ namespace arithm
             return saturate_cast<D>(a * b);
         }
 
-        __device__ __forceinline__ Mul() {}
-        __device__ __forceinline__ Mul(const Mul& other) {}
+        __host__ __device__ __forceinline__ Mul() {}
+        __host__ __device__ __forceinline__ Mul(const Mul&) {}
     };
 
     template <typename T, typename S, typename D> struct MulScale : binary_function<T, T, D>
     {
         S scale;
 
-        explicit MulScale(S scale_) : scale(scale_) {}
+        __host__ explicit MulScale(S scale_) : scale(scale_) {}
 
         __device__ __forceinline__ D operator ()(T a, T b) const
         {
index 208bfc6..6546550 100644 (file)
@@ -59,7 +59,7 @@ namespace arithm
     {
         S val;
 
-        explicit MulScalar(S val_) : val(val_) {}
+        __host__ explicit MulScalar(S val_) : val(val_) {}
 
         __device__ __forceinline__ D operator ()(T a) const
         {
index f2056b9..e43db90 100644 (file)
@@ -76,8 +76,8 @@ namespace reduce
             return r;
         }
 
-        __device__ __forceinline__ Sum() {}
-        __device__ __forceinline__ Sum(const Sum&) {}
+        __host__ __device__ __forceinline__ Sum() {}
+        __host__ __device__ __forceinline__ Sum(const Sum&) {}
     };
 
     struct Avg
@@ -100,8 +100,8 @@ namespace reduce
             return r / sz;
         }
 
-        __device__ __forceinline__ Avg() {}
-        __device__ __forceinline__ Avg(const Avg&) {}
+        __host__ __device__ __forceinline__ Avg() {}
+        __host__ __device__ __forceinline__ Avg(const Avg&) {}
     };
 
     struct Min
@@ -125,8 +125,8 @@ namespace reduce
             return r;
         }
 
-        __device__ __forceinline__ Min() {}
-        __device__ __forceinline__ Min(const Min&) {}
+        __host__ __device__ __forceinline__ Min() {}
+        __host__ __device__ __forceinline__ Min(const Min&) {}
     };
 
     struct Max
@@ -150,8 +150,8 @@ namespace reduce
             return r;
         }
 
-        __device__ __forceinline__ Max() {}
-        __device__ __forceinline__ Max(const Max&) {}
+        __host__ __device__ __forceinline__ Max() {}
+        __host__ __device__ __forceinline__ Max(const Max&) {}
     };
 
     ///////////////////////////////////////////////////////////
index adbdb2f..077eafb 100644 (file)
@@ -62,8 +62,8 @@ namespace arithm
             return vsub4(a, b);
         }
 
-        __device__ __forceinline__ VSub4() {}
-        __device__ __forceinline__ VSub4(const VSub4& other) {}
+        __host__ __device__ __forceinline__ VSub4() {}
+        __host__ __device__ __forceinline__ VSub4(const VSub4&) {}
     };
 
     struct VSub2 : binary_function<uint, uint, uint>
@@ -73,8 +73,8 @@ namespace arithm
             return vsub2(a, b);
         }
 
-        __device__ __forceinline__ VSub2() {}
-        __device__ __forceinline__ VSub2(const VSub2& other) {}
+        __host__ __device__ __forceinline__ VSub2() {}
+        __host__ __device__ __forceinline__ VSub2(const VSub2&) {}
     };
 
     template <typename T, typename D> struct SubMat : binary_function<T, T, D>
@@ -84,8 +84,8 @@ namespace arithm
             return saturate_cast<D>(a - b);
         }
 
-        __device__ __forceinline__ SubMat() {}
-        __device__ __forceinline__ SubMat(const SubMat& other) {}
+        __host__ __device__ __forceinline__ SubMat() {}
+        __host__ __device__ __forceinline__ SubMat(const SubMat&) {}
     };
 }
 
index ed1c96e..05c0cc7 100644 (file)
@@ -59,7 +59,7 @@ namespace arithm
     {
         S val;
 
-        explicit SubScalar(S val_) : val(val_) {}
+        __host__ explicit SubScalar(S val_) : val(val_) {}
 
         __device__ __forceinline__ D operator ()(T a) const
         {