gpu(sparse_multi): fix definition without TBB

pull/12181/head
Alexander Alekhin 6 years ago
parent 8484c8af7c
commit b0f0194595
  1. 9
      modules/gpu/include/opencv2/gpu/gpu.hpp
  2. 2
      modules/gpu/perf/perf_video.cpp
  3. 9
      modules/gpu/src/pyrlk.cpp

@ -60,10 +60,6 @@
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
#if !defined(HAVE_TBB)
#define throw_notbb() CV_Error(CV_StsNotImplemented, "The library is compiled without TBB support")
#endif
namespace cv { namespace gpu {
//////////////////////////////// CudaMem ////////////////////////////////
@ -1828,13 +1824,8 @@ public:
void sparse(const GpuMat& prevImg, const GpuMat& nextImg, const GpuMat& prevPts, GpuMat& nextPts,
GpuMat& status, GpuMat* err = 0);
#if !defined(HAVE_TBB)
void sparse_multi(const GpuMat&, const GpuMat&, const GpuMat&, GpuMat&,
GpuMat&, Stream&, GpuMat*) {throw_notbb();}
#else
void sparse_multi(const GpuMat& prevImg, const GpuMat& nextImg, const GpuMat& prevPts, GpuMat& nextPts,
GpuMat& status, Stream& stream, GpuMat* err = 0);
#endif
void dense(const GpuMat& prevImg, const GpuMat& nextImg, GpuMat& u, GpuMat& v, GpuMat* err = 0);

@ -306,7 +306,7 @@ PERF_TEST_P(ImagePair_Gray_NPts_WinSz_Levels_Iters, Video_PyrLKOpticalFlowSparse
//////////////////////////////////////////////////////
// PyrLKOpticalFlowSparseMulti
#ifdef HAVE_TBB
#if defined(HAVE_TBB) && defined(HAVE_CUDA)
DEF_PARAM_TEST(ImagePair_Gray_NPts_WinSz_Levels_Iters, pair_string, bool, int, int, int, int);

@ -53,6 +53,7 @@ using namespace cv::gpu;
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
cv::gpu::PyrLKOpticalFlow::PyrLKOpticalFlow() { throw_nogpu(); }
void cv::gpu::PyrLKOpticalFlow::sparse(const GpuMat&, const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, GpuMat*) { throw_nogpu(); }
void cv::gpu::PyrLKOpticalFlow::dense(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, GpuMat*) { throw_nogpu(); }
@ -71,6 +72,7 @@ namespace pyrlk
#if !defined(HAVE_TBB)
#define throw_notbb() CV_Error(CV_StsNotImplemented, "The library is compiled without TBB support")
void loadConstants_multi(int2, int, int, cudaStream_t) { throw_notbb(); }
void sparse1_multi(PtrStepSzf, PtrStepSzf, const float2*, float2*, uchar*, float*, int,
int, dim3, dim3, cudaStream_t, int) { throw_notbb(); }
@ -326,6 +328,13 @@ void cv::gpu::PyrLKOpticalFlow::sparse_multi(const GpuMat& prevImg,
index_vector_use[index] = true;
s_PyrLKOpticalFlow_ConditionVariable.notify_one();
}
#else
void cv::gpu::PyrLKOpticalFlow::sparse_multi(const GpuMat& /*prevImg*/,
const GpuMat& /*nextImg*/, const GpuMat& /*prevPts*/, GpuMat& /*nextPts*/,
GpuMat& /*status*/, Stream& /*stream*/, GpuMat* /*err*/)
{
throw_notbb();
}
#endif
void cv::gpu::PyrLKOpticalFlow::dense(const GpuMat& prevImg, const GpuMat& nextImg, GpuMat& u, GpuMat& v, GpuMat* err)

Loading…
Cancel
Save