Commit 869a35fa authored by Vladislav Vinogradov's avatar Vladislav Vinogradov

fixed constructors for functional objects (added __host__ modifier)

parent bf7c1c6c
...@@ -62,8 +62,8 @@ namespace arithm ...@@ -62,8 +62,8 @@ namespace arithm
return vabsdiff4(a, b); return vabsdiff4(a, b);
} }
__device__ __forceinline__ VAbsDiff4() {} __host__ __device__ __forceinline__ VAbsDiff4() {}
__device__ __forceinline__ VAbsDiff4(const VAbsDiff4& other) {} __host__ __device__ __forceinline__ VAbsDiff4(const VAbsDiff4&) {}
}; };
struct VAbsDiff2 : binary_function<uint, uint, uint> struct VAbsDiff2 : binary_function<uint, uint, uint>
...@@ -73,8 +73,8 @@ namespace arithm ...@@ -73,8 +73,8 @@ namespace arithm
return vabsdiff2(a, b); return vabsdiff2(a, b);
} }
__device__ __forceinline__ VAbsDiff2() {} __host__ __device__ __forceinline__ VAbsDiff2() {}
__device__ __forceinline__ VAbsDiff2(const VAbsDiff2& other) {} __host__ __device__ __forceinline__ VAbsDiff2(const VAbsDiff2&) {}
}; };
__device__ __forceinline__ int _abs(int a) __device__ __forceinline__ int _abs(int a)
...@@ -97,8 +97,8 @@ namespace arithm ...@@ -97,8 +97,8 @@ namespace arithm
return saturate_cast<T>(_abs(a - b)); return saturate_cast<T>(_abs(a - b));
} }
__device__ __forceinline__ AbsDiffMat() {} __host__ __device__ __forceinline__ AbsDiffMat() {}
__device__ __forceinline__ AbsDiffMat(const AbsDiffMat& other) {} __host__ __device__ __forceinline__ AbsDiffMat(const AbsDiffMat&) {}
}; };
} }
......
...@@ -59,7 +59,7 @@ namespace arithm ...@@ -59,7 +59,7 @@ namespace arithm
{ {
S val; S val;
explicit AbsDiffScalar(S val_) : val(val_) {} __host__ explicit AbsDiffScalar(S val_) : val(val_) {}
__device__ __forceinline__ T operator ()(T a) const __device__ __forceinline__ T operator ()(T a) const
{ {
......
...@@ -62,8 +62,8 @@ namespace arithm ...@@ -62,8 +62,8 @@ namespace arithm
return vadd4(a, b); return vadd4(a, b);
} }
__device__ __forceinline__ VAdd4() {} __host__ __device__ __forceinline__ VAdd4() {}
__device__ __forceinline__ VAdd4(const VAdd4& other) {} __host__ __device__ __forceinline__ VAdd4(const VAdd4&) {}
}; };
struct VAdd2 : binary_function<uint, uint, uint> struct VAdd2 : binary_function<uint, uint, uint>
...@@ -73,8 +73,8 @@ namespace arithm ...@@ -73,8 +73,8 @@ namespace arithm
return vadd2(a, b); return vadd2(a, b);
} }
__device__ __forceinline__ VAdd2() {} __host__ __device__ __forceinline__ VAdd2() {}
__device__ __forceinline__ VAdd2(const VAdd2& other) {} __host__ __device__ __forceinline__ VAdd2(const VAdd2&) {}
}; };
template <typename T, typename D> struct AddMat : binary_function<T, T, D> template <typename T, typename D> struct AddMat : binary_function<T, T, D>
...@@ -84,8 +84,8 @@ namespace arithm ...@@ -84,8 +84,8 @@ namespace arithm
return saturate_cast<D>(a + b); return saturate_cast<D>(a + b);
} }
__device__ __forceinline__ AddMat() {} __host__ __device__ __forceinline__ AddMat() {}
__device__ __forceinline__ AddMat(const AddMat& other) {} __host__ __device__ __forceinline__ AddMat(const AddMat&) {}
}; };
} }
......
...@@ -59,7 +59,7 @@ namespace arithm ...@@ -59,7 +59,7 @@ namespace arithm
{ {
S val; S val;
explicit AddScalar(S val_) : val(val_) {} __host__ explicit AddScalar(S val_) : val(val_) {}
__device__ __forceinline__ D operator ()(T a) const __device__ __forceinline__ D operator ()(T a) const
{ {
......
...@@ -74,7 +74,7 @@ namespace arithm ...@@ -74,7 +74,7 @@ namespace arithm
float beta; float beta;
float gamma; 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 __device__ __forceinline__ D operator ()(T1 a, T2 b) const
{ {
...@@ -87,7 +87,7 @@ namespace arithm ...@@ -87,7 +87,7 @@ namespace arithm
double beta; double beta;
double gamma; 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 __device__ __forceinline__ D operator ()(T1 a, T2 b) const
{ {
......
...@@ -62,8 +62,8 @@ namespace arithm ...@@ -62,8 +62,8 @@ namespace arithm
return vcmpeq4(a, b); return vcmpeq4(a, b);
} }
__device__ __forceinline__ VCmpEq4() {} __host__ __device__ __forceinline__ VCmpEq4() {}
__device__ __forceinline__ VCmpEq4(const VCmpEq4& other) {} __host__ __device__ __forceinline__ VCmpEq4(const VCmpEq4&) {}
}; };
struct VCmpNe4 : binary_function<uint, uint, uint> struct VCmpNe4 : binary_function<uint, uint, uint>
{ {
...@@ -72,8 +72,8 @@ namespace arithm ...@@ -72,8 +72,8 @@ namespace arithm
return vcmpne4(a, b); return vcmpne4(a, b);
} }
__device__ __forceinline__ VCmpNe4() {} __host__ __device__ __forceinline__ VCmpNe4() {}
__device__ __forceinline__ VCmpNe4(const VCmpNe4& other) {} __host__ __device__ __forceinline__ VCmpNe4(const VCmpNe4&) {}
}; };
struct VCmpLt4 : binary_function<uint, uint, uint> struct VCmpLt4 : binary_function<uint, uint, uint>
{ {
...@@ -82,8 +82,8 @@ namespace arithm ...@@ -82,8 +82,8 @@ namespace arithm
return vcmplt4(a, b); return vcmplt4(a, b);
} }
__device__ __forceinline__ VCmpLt4() {} __host__ __device__ __forceinline__ VCmpLt4() {}
__device__ __forceinline__ VCmpLt4(const VCmpLt4& other) {} __host__ __device__ __forceinline__ VCmpLt4(const VCmpLt4&) {}
}; };
struct VCmpLe4 : binary_function<uint, uint, uint> struct VCmpLe4 : binary_function<uint, uint, uint>
{ {
...@@ -92,8 +92,8 @@ namespace arithm ...@@ -92,8 +92,8 @@ namespace arithm
return vcmple4(a, b); return vcmple4(a, b);
} }
__device__ __forceinline__ VCmpLe4() {} __host__ __device__ __forceinline__ VCmpLe4() {}
__device__ __forceinline__ VCmpLe4(const VCmpLe4& other) {} __host__ __device__ __forceinline__ VCmpLe4(const VCmpLe4&) {}
}; };
template <class Op, typename T> template <class Op, typename T>
......
...@@ -59,7 +59,7 @@ namespace arithm ...@@ -59,7 +59,7 @@ namespace arithm
{ {
S val; S val;
explicit DivInv(S val_) : val(val_) {} __host__ explicit DivInv(S val_) : val(val_) {}
__device__ __forceinline__ D operator ()(T a) const __device__ __forceinline__ D operator ()(T a) const
{ {
......
...@@ -91,8 +91,8 @@ namespace arithm ...@@ -91,8 +91,8 @@ namespace arithm
return b != 0 ? saturate_cast<D>(a / b) : 0; return b != 0 ? saturate_cast<D>(a / b) : 0;
} }
__device__ __forceinline__ Div() {} __host__ __device__ __forceinline__ Div() {}
__device__ __forceinline__ Div(const Div& other) {} __host__ __device__ __forceinline__ Div(const Div&) {}
}; };
template <typename T> struct Div<T, float> : binary_function<T, T, float> template <typename T> struct Div<T, float> : binary_function<T, T, float>
{ {
...@@ -101,8 +101,8 @@ namespace arithm ...@@ -101,8 +101,8 @@ namespace arithm
return b != 0 ? static_cast<float>(a) / b : 0; return b != 0 ? static_cast<float>(a) / b : 0;
} }
__device__ __forceinline__ Div() {} __host__ __device__ __forceinline__ Div() {}
__device__ __forceinline__ Div(const Div& other) {} __host__ __device__ __forceinline__ Div(const Div&) {}
}; };
template <typename T> struct Div<T, double> : binary_function<T, T, double> template <typename T> struct Div<T, double> : binary_function<T, T, double>
{ {
...@@ -111,15 +111,15 @@ namespace arithm ...@@ -111,15 +111,15 @@ namespace arithm
return b != 0 ? static_cast<double>(a) / b : 0; return b != 0 ? static_cast<double>(a) / b : 0;
} }
__device__ __forceinline__ Div() {} __host__ __device__ __forceinline__ Div() {}
__device__ __forceinline__ Div(const Div& other) {} __host__ __device__ __forceinline__ Div(const Div&) {}
}; };
template <typename T, typename S, typename D> struct DivScale : binary_function<T, T, D> template <typename T, typename S, typename D> struct DivScale : binary_function<T, T, D>
{ {
S scale; S scale;
explicit DivScale(S scale_) : scale(scale_) {} __host__ explicit DivScale(S scale_) : scale(scale_) {}
__device__ __forceinline__ D operator ()(T a, T b) const __device__ __forceinline__ D operator ()(T a, T b) const
{ {
......
...@@ -59,7 +59,7 @@ namespace arithm ...@@ -59,7 +59,7 @@ namespace arithm
{ {
S val; S val;
explicit DivScalar(S val_) : val(val_) {} __host__ explicit DivScalar(S val_) : val(val_) {}
__device__ __forceinline__ D operator ()(T a) const __device__ __forceinline__ D operator ()(T a) const
{ {
......
...@@ -94,8 +94,8 @@ namespace arithm ...@@ -94,8 +94,8 @@ namespace arithm
return saturate_cast<T>(x * x); return saturate_cast<T>(x * x);
} }
__device__ __forceinline__ Sqr() {} __host__ __device__ __forceinline__ Sqr() {}
__device__ __forceinline__ Sqr(const Sqr& other) {} __host__ __device__ __forceinline__ Sqr(const Sqr&) {}
}; };
} }
...@@ -190,8 +190,8 @@ namespace arithm ...@@ -190,8 +190,8 @@ namespace arithm
return saturate_cast<T>(f(x)); return saturate_cast<T>(f(x));
} }
__device__ __forceinline__ Exp() {} __host__ __device__ __forceinline__ Exp() {}
__device__ __forceinline__ Exp(const Exp& other) {} __host__ __device__ __forceinline__ Exp(const Exp&) {}
}; };
} }
...@@ -228,7 +228,7 @@ namespace arithm ...@@ -228,7 +228,7 @@ namespace arithm
{ {
float power; 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 __device__ __forceinline__ T operator()(T e) const
{ {
...@@ -239,7 +239,7 @@ namespace arithm ...@@ -239,7 +239,7 @@ namespace arithm
{ {
float power; 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 __device__ __forceinline__ T operator()(T e) const
{ {
...@@ -255,7 +255,7 @@ namespace arithm ...@@ -255,7 +255,7 @@ namespace arithm
{ {
float power; 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 __device__ __forceinline__ float operator()(float e) const
{ {
...@@ -266,7 +266,7 @@ namespace arithm ...@@ -266,7 +266,7 @@ namespace arithm
{ {
double power; double power;
PowOp(double power_) : power(power_) {} __host__ explicit PowOp(double power_) : power(power_) {}
__device__ __forceinline__ double operator()(double e) const __device__ __forceinline__ double operator()(double e) const
{ {
......
...@@ -65,8 +65,8 @@ namespace arithm ...@@ -65,8 +65,8 @@ namespace arithm
return vmin4(a, b); return vmin4(a, b);
} }
__device__ __forceinline__ VMin4() {} __host__ __device__ __forceinline__ VMin4() {}
__device__ __forceinline__ VMin4(const VMin4& other) {} __host__ __device__ __forceinline__ VMin4(const VMin4&) {}
}; };
struct VMin2 : binary_function<uint, uint, uint> struct VMin2 : binary_function<uint, uint, uint>
...@@ -76,8 +76,8 @@ namespace arithm ...@@ -76,8 +76,8 @@ namespace arithm
return vmin2(a, b); return vmin2(a, b);
} }
__device__ __forceinline__ VMin2() {} __host__ __device__ __forceinline__ VMin2() {}
__device__ __forceinline__ VMin2(const VMin2& other) {} __host__ __device__ __forceinline__ VMin2(const VMin2&) {}
}; };
} }
...@@ -151,8 +151,8 @@ namespace arithm ...@@ -151,8 +151,8 @@ namespace arithm
return vmax4(a, b); return vmax4(a, b);
} }
__device__ __forceinline__ VMax4() {} __host__ __device__ __forceinline__ VMax4() {}
__device__ __forceinline__ VMax4(const VMax4& other) {} __host__ __device__ __forceinline__ VMax4(const VMax4&) {}
}; };
struct VMax2 : binary_function<uint, uint, uint> struct VMax2 : binary_function<uint, uint, uint>
...@@ -162,8 +162,8 @@ namespace arithm ...@@ -162,8 +162,8 @@ namespace arithm
return vmax2(a, b); return vmax2(a, b);
} }
__device__ __forceinline__ VMax2() {} __host__ __device__ __forceinline__ VMax2() {}
__device__ __forceinline__ VMax2(const VMax2& other) {} __host__ __device__ __forceinline__ VMax2(const VMax2&) {}
}; };
} }
......
...@@ -69,8 +69,8 @@ namespace arithm ...@@ -69,8 +69,8 @@ namespace arithm
return res; return res;
} }
__device__ __forceinline__ Mul_8uc4_32f() {} __host__ __device__ __forceinline__ Mul_8uc4_32f() {}
__device__ __forceinline__ Mul_8uc4_32f(const Mul_8uc4_32f& other) {} __host__ __device__ __forceinline__ Mul_8uc4_32f(const Mul_8uc4_32f&) {}
}; };
struct Mul_16sc4_32f : binary_function<short4, float, short4> struct Mul_16sc4_32f : binary_function<short4, float, short4>
...@@ -81,8 +81,8 @@ namespace arithm ...@@ -81,8 +81,8 @@ namespace arithm
saturate_cast<short>(a.z * b), saturate_cast<short>(a.w * b)); saturate_cast<short>(a.z * b), saturate_cast<short>(a.w * b));
} }
__device__ __forceinline__ Mul_16sc4_32f() {} __host__ __device__ __forceinline__ Mul_16sc4_32f() {}
__device__ __forceinline__ Mul_16sc4_32f(const Mul_16sc4_32f& other) {} __host__ __device__ __forceinline__ Mul_16sc4_32f(const Mul_16sc4_32f&) {}
}; };
template <typename T, typename D> struct Mul : binary_function<T, T, D> template <typename T, typename D> struct Mul : binary_function<T, T, D>
...@@ -92,15 +92,15 @@ namespace arithm ...@@ -92,15 +92,15 @@ namespace arithm
return saturate_cast<D>(a * b); return saturate_cast<D>(a * b);
} }
__device__ __forceinline__ Mul() {} __host__ __device__ __forceinline__ Mul() {}
__device__ __forceinline__ Mul(const Mul& other) {} __host__ __device__ __forceinline__ Mul(const Mul&) {}
}; };
template <typename T, typename S, typename D> struct MulScale : binary_function<T, T, D> template <typename T, typename S, typename D> struct MulScale : binary_function<T, T, D>
{ {
S scale; S scale;
explicit MulScale(S scale_) : scale(scale_) {} __host__ explicit MulScale(S scale_) : scale(scale_) {}
__device__ __forceinline__ D operator ()(T a, T b) const __device__ __forceinline__ D operator ()(T a, T b) const
{ {
......
...@@ -59,7 +59,7 @@ namespace arithm ...@@ -59,7 +59,7 @@ namespace arithm
{ {
S val; S val;
explicit MulScalar(S val_) : val(val_) {} __host__ explicit MulScalar(S val_) : val(val_) {}
__device__ __forceinline__ D operator ()(T a) const __device__ __forceinline__ D operator ()(T a) const
{ {
......
...@@ -76,8 +76,8 @@ namespace reduce ...@@ -76,8 +76,8 @@ namespace reduce
return r; return r;
} }
__device__ __forceinline__ Sum() {} __host__ __device__ __forceinline__ Sum() {}
__device__ __forceinline__ Sum(const Sum&) {} __host__ __device__ __forceinline__ Sum(const Sum&) {}
}; };
struct Avg struct Avg
...@@ -100,8 +100,8 @@ namespace reduce ...@@ -100,8 +100,8 @@ namespace reduce
return r / sz; return r / sz;
} }
__device__ __forceinline__ Avg() {} __host__ __device__ __forceinline__ Avg() {}
__device__ __forceinline__ Avg(const Avg&) {} __host__ __device__ __forceinline__ Avg(const Avg&) {}
}; };
struct Min struct Min
...@@ -125,8 +125,8 @@ namespace reduce ...@@ -125,8 +125,8 @@ namespace reduce
return r; return r;
} }
__device__ __forceinline__ Min() {} __host__ __device__ __forceinline__ Min() {}
__device__ __forceinline__ Min(const Min&) {} __host__ __device__ __forceinline__ Min(const Min&) {}
}; };
struct Max struct Max
...@@ -150,8 +150,8 @@ namespace reduce ...@@ -150,8 +150,8 @@ namespace reduce
return r; return r;
} }
__device__ __forceinline__ Max() {} __host__ __device__ __forceinline__ Max() {}
__device__ __forceinline__ Max(const Max&) {} __host__ __device__ __forceinline__ Max(const Max&) {}
}; };
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
......
...@@ -62,8 +62,8 @@ namespace arithm ...@@ -62,8 +62,8 @@ namespace arithm
return vsub4(a, b); return vsub4(a, b);
} }
__device__ __forceinline__ VSub4() {} __host__ __device__ __forceinline__ VSub4() {}
__device__ __forceinline__ VSub4(const VSub4& other) {} __host__ __device__ __forceinline__ VSub4(const VSub4&) {}
}; };
struct VSub2 : binary_function<uint, uint, uint> struct VSub2 : binary_function<uint, uint, uint>
...@@ -73,8 +73,8 @@ namespace arithm ...@@ -73,8 +73,8 @@ namespace arithm
return vsub2(a, b); return vsub2(a, b);
} }
__device__ __forceinline__ VSub2() {} __host__ __device__ __forceinline__ VSub2() {}
__device__ __forceinline__ VSub2(const VSub2& other) {} __host__ __device__ __forceinline__ VSub2(const VSub2&) {}
}; };
template <typename T, typename D> struct SubMat : binary_function<T, T, D> template <typename T, typename D> struct SubMat : binary_function<T, T, D>
...@@ -84,8 +84,8 @@ namespace arithm ...@@ -84,8 +84,8 @@ namespace arithm
return saturate_cast<D>(a - b); return saturate_cast<D>(a - b);
} }
__device__ __forceinline__ SubMat() {} __host__ __device__ __forceinline__ SubMat() {}
__device__ __forceinline__ SubMat(const SubMat& other) {} __host__ __device__ __forceinline__ SubMat(const SubMat&) {}
}; };
} }
......
...@@ -59,7 +59,7 @@ namespace arithm ...@@ -59,7 +59,7 @@ namespace arithm
{ {
S val; S val;
explicit SubScalar(S val_) : val(val_) {} __host__ explicit SubScalar(S val_) : val(val_) {}
__device__ __forceinline__ D operator ()(T a) const __device__ __forceinline__ D operator ()(T a) const
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment