Commit e86f0aae authored by Marina Kolpakova's avatar Marina Kolpakova

fixed hundreds of "anonymous" warnings for gpu module.

parent ffa44fb1
...@@ -5,8 +5,11 @@ ocv_module_include_directories(${ZLIB_INCLUDE_DIR}) ...@@ -5,8 +5,11 @@ ocv_module_include_directories(${ZLIB_INCLUDE_DIR})
if(HAVE_CUDA) if(HAVE_CUDA)
file(GLOB lib_cuda "src/cuda/*.cu") file(GLOB lib_cuda "src/cuda/*.cu")
source_group("Cuda" FILES "${lib_cuda}") source_group("Cuda" FILES "${lib_cuda}")
include_directories(AFTER SYSTEM ${CUDA_INCLUDE_DIRS})
ocv_include_directories(${CUDA_INCLUDE_DIRS} "${OpenCV_SOURCE_DIR}/modules/gpu/src" "${OpenCV_SOURCE_DIR}/modules/gpu/src/cuda") ocv_include_directories("${OpenCV_SOURCE_DIR}/modules/gpu/src" "${OpenCV_SOURCE_DIR}/modules/gpu/src/cuda")
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef)
OCV_CUDA_COMPILE(cuda_objs ${lib_cuda}) OCV_CUDA_COMPILE(cuda_objs ${lib_cuda})
set(cuda_link_libs ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY}) set(cuda_link_libs ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY})
......
...@@ -30,7 +30,9 @@ if (HAVE_CUDA) ...@@ -30,7 +30,9 @@ if (HAVE_CUDA)
set(ncv_files ${ncv_srcs} ${ncv_hdrs} ${ncv_cuda}) set(ncv_files ${ncv_srcs} ${ncv_hdrs} ${ncv_cuda})
source_group("Src\\NVidia" FILES ${ncv_files}) source_group("Src\\NVidia" FILES ${ncv_files})
ocv_include_directories("src/nvidia" "src/nvidia/core" "src/nvidia/NPP_staging" ${CUDA_INCLUDE_DIRS}) include_directories(AFTER SYSTEM ${CUDA_INCLUDE_DIRS})
ocv_include_directories("src/nvidia" "src/nvidia/core" "src/nvidia/NPP_staging")
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef)
#set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-keep") #set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-keep")
#set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler;/EHsc-;") #set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} "-Xcompiler;/EHsc-;")
......
...@@ -87,7 +87,9 @@ namespace cv { namespace gpu { namespace device ...@@ -87,7 +87,9 @@ namespace cv { namespace gpu { namespace device
__device__ __forceinline__ bool operator()(int y, int x) const __device__ __forceinline__ bool operator()(int y, int x) const
{ {
return true; return true;
} }
__device__ __forceinline__ MaskTrue(){}
__device__ __forceinline__ MaskTrue(const MaskTrue& mask_){}
}; };
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
...@@ -1795,6 +1797,9 @@ namespace cv { namespace gpu { namespace device ...@@ -1795,6 +1797,9 @@ namespace cv { namespace gpu { namespace device
return 0; return 0;
} }
__device__ __forceinline__ SumReductor(const SumReductor& other){}
__device__ __forceinline__ SumReductor(){}
__device__ __forceinline__ S operator ()(volatile S a, volatile S b) const __device__ __forceinline__ S operator ()(volatile S a, volatile S b) const
{ {
return a + b; return a + b;
...@@ -1813,6 +1818,9 @@ namespace cv { namespace gpu { namespace device ...@@ -1813,6 +1818,9 @@ namespace cv { namespace gpu { namespace device
return 0; return 0;
} }
__device__ __forceinline__ AvgReductor(const AvgReductor& other){}
__device__ __forceinline__ AvgReductor(){}
__device__ __forceinline__ S operator ()(volatile S a, volatile S b) const __device__ __forceinline__ S operator ()(volatile S a, volatile S b) const
{ {
return a + b; return a + b;
...@@ -1831,6 +1839,9 @@ namespace cv { namespace gpu { namespace device ...@@ -1831,6 +1839,9 @@ namespace cv { namespace gpu { namespace device
return numeric_limits<S>::max(); return numeric_limits<S>::max();
} }
__device__ __forceinline__ MinReductor(const MinReductor& other){}
__device__ __forceinline__ MinReductor(){}
template <typename T> __device__ __forceinline__ T operator ()(volatile T a, volatile T b) const template <typename T> __device__ __forceinline__ T operator ()(volatile T a, volatile T b) const
{ {
return saturate_cast<T>(::min(a, b)); return saturate_cast<T>(::min(a, b));
...@@ -1853,6 +1864,9 @@ namespace cv { namespace gpu { namespace device ...@@ -1853,6 +1864,9 @@ namespace cv { namespace gpu { namespace device
return numeric_limits<S>::min(); return numeric_limits<S>::min();
} }
__device__ __forceinline__ MaxReductor(const MaxReductor& other){}
__device__ __forceinline__ MaxReductor(){}
template <typename T> __device__ __forceinline__ int operator ()(volatile T a, volatile T b) const template <typename T> __device__ __forceinline__ int operator ()(volatile T a, volatile T b) const
{ {
return ::max(a, b); return ::max(a, b);
......
...@@ -116,7 +116,7 @@ namespace cv { namespace gpu { namespace device ...@@ -116,7 +116,7 @@ namespace cv { namespace gpu { namespace device
template <int N> __device__ float icvCalcHaarPatternSum(const float src[][5], int oldSize, int newSize, int y, int x) template <int N> __device__ float icvCalcHaarPatternSum(const float src[][5], int oldSize, int newSize, int y, int x)
{ {
#if __CUDA_ARCH__ >= 200 #if __CUDA_ARCH__ && __CUDA_ARCH__ >= 200
typedef double real_t; typedef double real_t;
#else #else
typedef float real_t; typedef float real_t;
...@@ -248,7 +248,7 @@ namespace cv { namespace gpu { namespace device ...@@ -248,7 +248,7 @@ namespace cv { namespace gpu { namespace device
template <typename Mask> template <typename Mask>
__global__ void icvFindMaximaInLayer(const PtrStepf det, const PtrStepf trace, int4* maxPosBuffer, unsigned int* maxCounter) __global__ void icvFindMaximaInLayer(const PtrStepf det, const PtrStepf trace, int4* maxPosBuffer, unsigned int* maxCounter)
{ {
#if __CUDA_ARCH__ >= 110 #if __CUDA_ARCH__ && __CUDA_ARCH__ >= 110
extern __shared__ float N9[]; extern __shared__ float N9[];
...@@ -371,7 +371,7 @@ namespace cv { namespace gpu { namespace device ...@@ -371,7 +371,7 @@ namespace cv { namespace gpu { namespace device
float* featureX, float* featureY, int* featureLaplacian, int* featureOctave, float* featureSize, float* featureHessian, float* featureX, float* featureY, int* featureLaplacian, int* featureOctave, float* featureSize, float* featureHessian,
unsigned int* featureCounter) unsigned int* featureCounter)
{ {
#if __CUDA_ARCH__ >= 110 #if __CUDA_ARCH__ && __CUDA_ARCH__ >= 110
const int4 maxPos = maxPosBuffer[blockIdx.x]; const int4 maxPos = maxPosBuffer[blockIdx.x];
......
...@@ -231,7 +231,7 @@ __device__ Ncv32u d_outMaskPosition; ...@@ -231,7 +231,7 @@ __device__ Ncv32u d_outMaskPosition;
__device__ void compactBlockWriteOutAnchorParallel(Ncv32u threadPassFlag, Ncv32u threadElem, Ncv32u *vectorOut) __device__ void compactBlockWriteOutAnchorParallel(Ncv32u threadPassFlag, Ncv32u threadElem, Ncv32u *vectorOut)
{ {
#if __CUDA_ARCH__ >= 110 #if __CUDA_ARCH__ && __CUDA_ARCH__ >= 110
__shared__ Ncv32u shmem[NUM_THREADS_ANCHORSPARALLEL * 2]; __shared__ Ncv32u shmem[NUM_THREADS_ANCHORSPARALLEL * 2];
__shared__ Ncv32u numPassed; __shared__ Ncv32u numPassed;
...@@ -587,7 +587,7 @@ __global__ void applyHaarClassifierClassifierParallel(Ncv32u *d_IImg, Ncv32u IIm ...@@ -587,7 +587,7 @@ __global__ void applyHaarClassifierClassifierParallel(Ncv32u *d_IImg, Ncv32u IIm
} }
else else
{ {
#if __CUDA_ARCH__ >= 110 #if __CUDA_ARCH__ && __CUDA_ARCH__ >= 110
if (bPass && !threadIdx.x) if (bPass && !threadIdx.x)
{ {
Ncv32u outMaskOffset = atomicAdd(&d_outMaskPosition, 1); Ncv32u outMaskOffset = atomicAdd(&d_outMaskPosition, 1);
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#ifndef _ncvruntimetemplates_hpp_ #ifndef _ncvruntimetemplates_hpp_
#define _ncvruntimetemplates_hpp_ #define _ncvruntimetemplates_hpp_
#if _MSC_VER >= 1200 #if defined _MSC_VER &&_MSC_VER >= 1200
#pragma warning( disable: 4800 ) #pragma warning( disable: 4800 )
#endif #endif
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
namespace cv { namespace gpu { namespace device namespace cv { namespace gpu { namespace device
{ {
#if __CUDA_ARCH__ >= 200 #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 200
// for Fermi memory space is detected automatically // for Fermi memory space is detected automatically
template <typename T> struct ForceGlob template <typename T> struct ForceGlob
......
...@@ -114,6 +114,11 @@ namespace cv { namespace gpu { namespace device ...@@ -114,6 +114,11 @@ namespace cv { namespace gpu { namespace device
return dst; return dst;
} }
__device__ __forceinline__ RGB2RGB()
: unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>(){}
__device__ __forceinline__ RGB2RGB(const RGB2RGB& other_)
:unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>(){}
}; };
template <> struct RGB2RGB<uchar, 4, 4, 2> : unary_function<uint, uint> template <> struct RGB2RGB<uchar, 4, 4, 2> : unary_function<uint, uint>
...@@ -129,6 +134,9 @@ namespace cv { namespace gpu { namespace device ...@@ -129,6 +134,9 @@ namespace cv { namespace gpu { namespace device
return dst; return dst;
} }
__device__ __forceinline__ RGB2RGB():unary_function<uint, uint>(){}
__device__ __forceinline__ RGB2RGB(const RGB2RGB& other_):unary_function<uint, uint>(){}
}; };
} }
...@@ -184,6 +192,8 @@ namespace cv { namespace gpu { namespace device ...@@ -184,6 +192,8 @@ namespace cv { namespace gpu { namespace device
{ {
return RGB2RGB5x5Converter<green_bits, bidx>::cvt(src); return RGB2RGB5x5Converter<green_bits, bidx>::cvt(src);
} }
__device__ __forceinline__ RGB2RGB5x5():unary_function<uchar3, ushort>(){}
__device__ __forceinline__ RGB2RGB5x5(const RGB2RGB5x5& other_):unary_function<uchar3, ushort>(){}
}; };
template<int bidx, int green_bits> struct RGB2RGB5x5<4, bidx,green_bits> : unary_function<uint, ushort> template<int bidx, int green_bits> struct RGB2RGB5x5<4, bidx,green_bits> : unary_function<uint, ushort>
{ {
...@@ -191,6 +201,9 @@ namespace cv { namespace gpu { namespace device ...@@ -191,6 +201,9 @@ namespace cv { namespace gpu { namespace device
{ {
return RGB2RGB5x5Converter<green_bits, bidx>::cvt(src); return RGB2RGB5x5Converter<green_bits, bidx>::cvt(src);
} }
__device__ __forceinline__ RGB2RGB5x5():unary_function<uint, ushort>(){}
__device__ __forceinline__ RGB2RGB5x5(const RGB2RGB5x5& other_):unary_function<uint, ushort>(){}
}; };
} }
...@@ -252,7 +265,11 @@ namespace cv { namespace gpu { namespace device ...@@ -252,7 +265,11 @@ namespace cv { namespace gpu { namespace device
RGB5x52RGBConverter<green_bits, bidx>::cvt(src, dst); RGB5x52RGBConverter<green_bits, bidx>::cvt(src, dst);
return dst; return dst;
} }
__device__ __forceinline__ RGB5x52RGB():unary_function<ushort, uchar3>(){}
__device__ __forceinline__ RGB5x52RGB(const RGB5x52RGB& other_):unary_function<ushort, uchar3>(){}
}; };
template <int bidx, int green_bits> struct RGB5x52RGB<4, bidx, green_bits> : unary_function<ushort, uint> template <int bidx, int green_bits> struct RGB5x52RGB<4, bidx, green_bits> : unary_function<ushort, uint>
{ {
__device__ __forceinline__ uint operator()(ushort src) const __device__ __forceinline__ uint operator()(ushort src) const
...@@ -261,6 +278,8 @@ namespace cv { namespace gpu { namespace device ...@@ -261,6 +278,8 @@ namespace cv { namespace gpu { namespace device
RGB5x52RGBConverter<green_bits, bidx>::cvt(src, dst); RGB5x52RGBConverter<green_bits, bidx>::cvt(src, dst);
return dst; return dst;
} }
__device__ __forceinline__ RGB5x52RGB():unary_function<ushort, uint>(){}
__device__ __forceinline__ RGB5x52RGB(const RGB5x52RGB& other_):unary_function<ushort, uint>(){}
}; };
} }
...@@ -289,6 +308,8 @@ namespace cv { namespace gpu { namespace device ...@@ -289,6 +308,8 @@ namespace cv { namespace gpu { namespace device
return dst; return dst;
} }
__device__ __forceinline__ Gray2RGB():unary_function<T, typename TypeVec<T, dcn>::vec_type>(){}
__device__ __forceinline__ Gray2RGB(const Gray2RGB& other_):unary_function<T, typename TypeVec<T, dcn>::vec_type>(){}
}; };
template <> struct Gray2RGB<uchar, 4> : unary_function<uchar, uint> template <> struct Gray2RGB<uchar, 4> : unary_function<uchar, uint>
{ {
...@@ -302,6 +323,8 @@ namespace cv { namespace gpu { namespace device ...@@ -302,6 +323,8 @@ namespace cv { namespace gpu { namespace device
return dst; return dst;
} }
__device__ __forceinline__ Gray2RGB():unary_function<uchar, uint>(){}
__device__ __forceinline__ Gray2RGB(const Gray2RGB& other_):unary_function<uchar, uint>(){}
}; };
} }
...@@ -340,6 +363,8 @@ namespace cv { namespace gpu { namespace device ...@@ -340,6 +363,8 @@ namespace cv { namespace gpu { namespace device
{ {
return Gray2RGB5x5Converter<green_bits>::cvt(src); return Gray2RGB5x5Converter<green_bits>::cvt(src);
} }
__device__ __forceinline__ Gray2RGB5x5():unary_function<uchar, ushort>(){}
__device__ __forceinline__ Gray2RGB5x5(const Gray2RGB5x5& other_):unary_function<uchar, ushort>(){}
}; };
} }
...@@ -471,6 +496,8 @@ namespace cv { namespace gpu { namespace device ...@@ -471,6 +496,8 @@ namespace cv { namespace gpu { namespace device
RGB2YUVConvert<bidx>(&src.x, dst); RGB2YUVConvert<bidx>(&src.x, dst);
return dst; return dst;
} }
__device__ __forceinline__ RGB2YUV():unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>(){}
__device__ __forceinline__ RGB2YUV(const RGB2YUV& other_):unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>(){}
}; };
} }
...@@ -535,7 +562,10 @@ namespace cv { namespace gpu { namespace device ...@@ -535,7 +562,10 @@ namespace cv { namespace gpu { namespace device
return dst; return dst;
} }
__device__ __forceinline__ YUV2RGB():unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>(){}
__device__ __forceinline__ YUV2RGB(const YUV2RGB& other_):unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>(){}
}; };
template <int bidx> struct YUV2RGB<uchar, 4, 4, bidx> : unary_function<uint, uint> template <int bidx> struct YUV2RGB<uchar, 4, 4, bidx> : unary_function<uint, uint>
{ {
__device__ __forceinline__ uint operator ()(uint src) const __device__ __forceinline__ uint operator ()(uint src) const
...@@ -605,7 +635,10 @@ namespace cv { namespace gpu { namespace device ...@@ -605,7 +635,10 @@ namespace cv { namespace gpu { namespace device
RGB2YCrCbConvert<bidx>(&src.x, dst); RGB2YCrCbConvert<bidx>(&src.x, dst);
return dst; return dst;
} }
__device__ __forceinline__ RGB2YCrCb():unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>(){}
__device__ __forceinline__ RGB2YCrCb(const RGB2YCrCb& other_):unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>(){}
}; };
template <int bidx> struct RGB2YCrCb<uchar, 4, 4, bidx> : unary_function<uint, uint> template <int bidx> struct RGB2YCrCb<uchar, 4, 4, bidx> : unary_function<uint, uint>
{ {
__device__ __forceinline__ uint operator ()(uint src) const __device__ __forceinline__ uint operator ()(uint src) const
...@@ -676,7 +709,10 @@ namespace cv { namespace gpu { namespace device ...@@ -676,7 +709,10 @@ namespace cv { namespace gpu { namespace device
return dst; return dst;
} }
__device__ __forceinline__ YCrCb2RGB():unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>(){}
__device__ __forceinline__ YCrCb2RGB(const YCrCb2RGB& other_):unary_function<typename TypeVec<T, scn>::vec_type, typename TypeVec<T, dcn>::vec_type>(){}
}; };
template <int bidx> struct YCrCb2RGB<uchar, 4, 4, bidx> : unary_function<uint, uint> template <int bidx> struct YCrCb2RGB<uchar, 4, 4, bidx> : unary_function<uint, uint>
{ {
__device__ __forceinline__ uint operator ()(uint src) const __device__ __forceinline__ uint operator ()(uint src) const
...@@ -1331,6 +1367,7 @@ namespace cv { namespace gpu { namespace device ...@@ -1331,6 +1367,7 @@ namespace cv { namespace gpu { namespace device
{ {
return HLS2RGBConvert<bidx, hr>(src); return HLS2RGBConvert<bidx, hr>(src);
} }
}; };
} }
......
...@@ -84,7 +84,7 @@ namespace cv { namespace gpu { namespace device ...@@ -84,7 +84,7 @@ namespace cv { namespace gpu { namespace device
} }
template<> __device__ __forceinline__ uchar saturate_cast<uchar>(double v) template<> __device__ __forceinline__ uchar saturate_cast<uchar>(double v)
{ {
#if __CUDA_ARCH__ >= 130 #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 130
int iv = __double2int_rn(v); int iv = __double2int_rn(v);
return saturate_cast<uchar>(iv); return saturate_cast<uchar>(iv);
#else #else
...@@ -120,7 +120,7 @@ namespace cv { namespace gpu { namespace device ...@@ -120,7 +120,7 @@ namespace cv { namespace gpu { namespace device
} }
template<> __device__ __forceinline__ schar saturate_cast<schar>(double v) template<> __device__ __forceinline__ schar saturate_cast<schar>(double v)
{ {
#if __CUDA_ARCH__ >= 130 #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 130
int iv = __double2int_rn(v); int iv = __double2int_rn(v);
return saturate_cast<schar>(iv); return saturate_cast<schar>(iv);
#else #else
...@@ -151,7 +151,7 @@ namespace cv { namespace gpu { namespace device ...@@ -151,7 +151,7 @@ namespace cv { namespace gpu { namespace device
} }
template<> __device__ __forceinline__ ushort saturate_cast<ushort>(double v) template<> __device__ __forceinline__ ushort saturate_cast<ushort>(double v)
{ {
#if __CUDA_ARCH__ >= 130 #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 130
int iv = __double2int_rn(v); int iv = __double2int_rn(v);
return saturate_cast<ushort>(iv); return saturate_cast<ushort>(iv);
#else #else
...@@ -178,7 +178,7 @@ namespace cv { namespace gpu { namespace device ...@@ -178,7 +178,7 @@ namespace cv { namespace gpu { namespace device
} }
template<> __device__ __forceinline__ short saturate_cast<short>(double v) template<> __device__ __forceinline__ short saturate_cast<short>(double v)
{ {
#if __CUDA_ARCH__ >= 130 #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 130
int iv = __double2int_rn(v); int iv = __double2int_rn(v);
return saturate_cast<short>(iv); return saturate_cast<short>(iv);
#else #else
...@@ -192,7 +192,7 @@ namespace cv { namespace gpu { namespace device ...@@ -192,7 +192,7 @@ namespace cv { namespace gpu { namespace device
} }
template<> __device__ __forceinline__ int saturate_cast<int>(double v) template<> __device__ __forceinline__ int saturate_cast<int>(double v)
{ {
#if __CUDA_ARCH__ >= 130 #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 130
return __double2int_rn(v); return __double2int_rn(v);
#else #else
return saturate_cast<int>((float)v); return saturate_cast<int>((float)v);
...@@ -205,7 +205,7 @@ namespace cv { namespace gpu { namespace device ...@@ -205,7 +205,7 @@ namespace cv { namespace gpu { namespace device
} }
template<> __device__ __forceinline__ uint saturate_cast<uint>(double v) template<> __device__ __forceinline__ uint saturate_cast<uint>(double v)
{ {
#if __CUDA_ARCH__ >= 130 #if defined __CUDA_ARCH__ && __CUDA_ARCH__ >= 130
return __double2uint_rn(v); return __double2uint_rn(v);
#else #else
return saturate_cast<uint>((float)v); return saturate_cast<uint>((float)v);
...@@ -213,4 +213,4 @@ namespace cv { namespace gpu { namespace device ...@@ -213,4 +213,4 @@ namespace cv { namespace gpu { namespace device
} }
}}} }}}
#endif /* __OPENCV_GPU_SATURATE_CAST_HPP__ */ #endif /* __OPENCV_GPU_SATURATE_CAST_HPP__ */
\ No newline at end of file
...@@ -50,14 +50,14 @@ ...@@ -50,14 +50,14 @@
namespace cv { namespace gpu { namespace device namespace cv { namespace gpu { namespace device
{ {
template <typename T, typename D, typename UnOp, typename Mask> template <typename T, typename D, typename UnOp, typename Mask>
static inline void transform(DevMem2D_<T> src, DevMem2D_<D> dst, UnOp op, Mask mask, cudaStream_t stream) static inline void transform(DevMem2D_<T> src, DevMem2D_<D> dst, UnOp op, const Mask& mask, cudaStream_t stream)
{ {
typedef TransformFunctorTraits<UnOp> ft; typedef TransformFunctorTraits<UnOp> ft;
transform_detail::TransformDispatcher<VecTraits<T>::cn == 1 && VecTraits<D>::cn == 1 && ft::smart_shift != 1>::call(src, dst, op, mask, stream); transform_detail::TransformDispatcher<VecTraits<T>::cn == 1 && VecTraits<D>::cn == 1 && ft::smart_shift != 1>::call(src, dst, op, mask, stream);
} }
template <typename T1, typename T2, typename D, typename BinOp, typename Mask> template <typename T1, typename T2, typename D, typename BinOp, typename Mask>
static inline void transform(DevMem2D_<T1> src1, DevMem2D_<T2> src2, DevMem2D_<D> dst, BinOp op, Mask mask, cudaStream_t stream) static inline void transform(DevMem2D_<T1> src1, DevMem2D_<T2> src2, DevMem2D_<D> dst, BinOp op, const Mask& mask, cudaStream_t stream)
{ {
typedef TransformFunctorTraits<BinOp> ft; typedef TransformFunctorTraits<BinOp> ft;
transform_detail::TransformDispatcher<VecTraits<T1>::cn == 1 && VecTraits<T2>::cn == 1 && VecTraits<D>::cn == 1 && ft::smart_shift != 1>::call(src1, src2, dst, op, mask, stream); transform_detail::TransformDispatcher<VecTraits<T1>::cn == 1 && VecTraits<T2>::cn == 1 && VecTraits<D>::cn == 1 && ft::smart_shift != 1>::call(src1, src2, dst, op, mask, stream);
......
...@@ -70,6 +70,7 @@ namespace cv { namespace gpu { namespace device ...@@ -70,6 +70,7 @@ namespace cv { namespace gpu { namespace device
struct SingleMask struct SingleMask
{ {
explicit __host__ __device__ __forceinline__ SingleMask(PtrStepb mask_) : mask(mask_) {} explicit __host__ __device__ __forceinline__ SingleMask(PtrStepb mask_) : mask(mask_) {}
__host__ __device__ __forceinline__ SingleMask(const SingleMask& mask_): mask(mask_.mask){}
__device__ __forceinline__ bool operator()(int y, int x) const __device__ __forceinline__ bool operator()(int y, int x) const
{ {
...@@ -81,7 +82,10 @@ namespace cv { namespace gpu { namespace device ...@@ -81,7 +82,10 @@ namespace cv { namespace gpu { namespace device
struct SingleMaskChannels struct SingleMaskChannels
{ {
__host__ __device__ __forceinline__ SingleMaskChannels(PtrStepb mask_, int channels_) : mask(mask_), channels(channels_) {} __host__ __device__ __forceinline__ SingleMaskChannels(PtrStepb mask_, int channels_)
: mask(mask_), channels(channels_) {}
__host__ __device__ __forceinline__ SingleMaskChannels(const SingleMaskChannels& mask_)
:mask(mask_.mask), channels(mask_.channels){}
__device__ __forceinline__ bool operator()(int y, int x) const __device__ __forceinline__ bool operator()(int y, int x) const
{ {
...@@ -94,7 +98,11 @@ namespace cv { namespace gpu { namespace device ...@@ -94,7 +98,11 @@ namespace cv { namespace gpu { namespace device
struct MaskCollection struct MaskCollection
{ {
explicit __host__ __device__ __forceinline__ MaskCollection(PtrStepb* maskCollection_) : maskCollection(maskCollection_) {} explicit __host__ __device__ __forceinline__ MaskCollection(PtrStepb* maskCollection_)
: maskCollection(maskCollection_) {}
__device__ __forceinline__ MaskCollection(const MaskCollection& masks_)
: maskCollection(masks_.maskCollection), curMask(masks_.curMask){}
__device__ __forceinline__ void next() __device__ __forceinline__ void next()
{ {
...@@ -117,6 +125,9 @@ namespace cv { namespace gpu { namespace device ...@@ -117,6 +125,9 @@ namespace cv { namespace gpu { namespace device
struct WithOutMask struct WithOutMask
{ {
__device__ __forceinline__ WithOutMask(){}
__device__ __forceinline__ WithOutMask(const WithOutMask& mask){}
__device__ __forceinline__ void next() const __device__ __forceinline__ void next() const
{ {
} }
......
...@@ -11,7 +11,9 @@ ...@@ -11,7 +11,9 @@
#ifndef _ncvtest_hpp_ #ifndef _ncvtest_hpp_
#define _ncvtest_hpp_ #define _ncvtest_hpp_
#pragma warning( disable : 4201 4408 4127 4100) #if defined _MSC_VER
# pragma warning( disable : 4201 4408 4127 4100)
#endif
#include <string> #include <string>
#include <vector> #include <vector>
...@@ -36,6 +38,7 @@ class INCVTest ...@@ -36,6 +38,7 @@ class INCVTest
public: public:
virtual bool executeTest(NCVTestReport &report) = 0; virtual bool executeTest(NCVTestReport &report) = 0;
virtual std::string getName() const = 0; virtual std::string getName() const = 0;
virtual ~INCVTest(){}
}; };
......
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