From b0f01945957dc4bc71fc8fd43fe3a76c30f01d99 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Wed, 8 Aug 2018 15:26:05 +0300 Subject: [PATCH] gpu(sparse_multi): fix definition without TBB --- modules/gpu/include/opencv2/gpu/gpu.hpp | 9 --------- modules/gpu/perf/perf_video.cpp | 2 +- modules/gpu/src/pyrlk.cpp | 9 +++++++++ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/gpu/include/opencv2/gpu/gpu.hpp b/modules/gpu/include/opencv2/gpu/gpu.hpp index 404825434b..78fce1b86b 100644 --- a/modules/gpu/include/opencv2/gpu/gpu.hpp +++ b/modules/gpu/include/opencv2/gpu/gpu.hpp @@ -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); diff --git a/modules/gpu/perf/perf_video.cpp b/modules/gpu/perf/perf_video.cpp index b85fca8fd4..f456d93055 100644 --- a/modules/gpu/perf/perf_video.cpp +++ b/modules/gpu/perf/perf_video.cpp @@ -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); diff --git a/modules/gpu/src/pyrlk.cpp b/modules/gpu/src/pyrlk.cpp index 052db3b61e..ec0b2c4d15 100644 --- a/modules/gpu/src/pyrlk.cpp +++ b/modules/gpu/src/pyrlk.cpp @@ -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)