Skip to content

Commit d3b0380

Browse files
committed
xfeatures2d: fix CUDA nonfree build
1 parent 1e096c6 commit d3b0380

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

modules/xfeatures2d/src/surf.cuda.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -47,31 +47,15 @@
4747
using namespace cv;
4848
using namespace cv::cuda;
4949

50-
#if (!defined (HAVE_CUDA) || !defined (HAVE_OPENCV_CUDAARITHM))
51-
52-
cv::cuda::SURF_CUDA::SURF_CUDA() { throw_no_cuda(); }
53-
cv::cuda::SURF_CUDA::SURF_CUDA(double, int, int, bool, float, bool) { throw_no_cuda(); }
54-
int cv::cuda::SURF_CUDA::descriptorSize() const { throw_no_cuda(); }
55-
void cv::cuda::SURF_CUDA::uploadKeypoints(const std::vector<KeyPoint>&, GpuMat&) { throw_no_cuda(); }
56-
void cv::cuda::SURF_CUDA::downloadKeypoints(const GpuMat&, std::vector<KeyPoint>&) { throw_no_cuda(); }
57-
void cv::cuda::SURF_CUDA::downloadDescriptors(const GpuMat&, std::vector<float>&) { throw_no_cuda(); }
58-
void cv::cuda::SURF_CUDA::operator()(const GpuMat&, const GpuMat&, GpuMat&) { throw_no_cuda(); }
59-
void cv::cuda::SURF_CUDA::operator()(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, bool) { throw_no_cuda(); }
60-
void cv::cuda::SURF_CUDA::operator()(const GpuMat&, const GpuMat&, std::vector<KeyPoint>&) { throw_no_cuda(); }
61-
void cv::cuda::SURF_CUDA::operator()(const GpuMat&, const GpuMat&, std::vector<KeyPoint>&, GpuMat&, bool) { throw_no_cuda(); }
62-
void cv::cuda::SURF_CUDA::operator()(const GpuMat&, const GpuMat&, std::vector<KeyPoint>&, std::vector<float>&, bool) { throw_no_cuda(); }
63-
void cv::cuda::SURF_CUDA::releaseMemory() { throw_no_cuda(); }
64-
65-
#else // !defined (HAVE_CUDA)
66-
67-
#if (!defined (OPENCV_ENABLE_NONFREE))
50+
#ifndef OPENCV_ENABLE_NONFREE
6851
#define throw_no_nonfree CV_Error(Error::StsNotImplemented, \
6952
"This algorithm is patented and is excluded in this configuration; " \
7053
"Set OPENCV_ENABLE_NONFREE CMake option and rebuild the library");
7154

7255
cv::cuda::SURF_CUDA::SURF_CUDA() { throw_no_nonfree }
7356
cv::cuda::SURF_CUDA::SURF_CUDA(double, int, int, bool, float, bool) { throw_no_nonfree }
7457
int cv::cuda::SURF_CUDA::descriptorSize() const { throw_no_nonfree }
58+
int cv::cuda::SURF_CUDA::defaultNorm() const { throw_no_nonfree }
7559
void cv::cuda::SURF_CUDA::uploadKeypoints(const std::vector<KeyPoint>&, GpuMat&) { throw_no_nonfree }
7660
void cv::cuda::SURF_CUDA::downloadKeypoints(const GpuMat&, std::vector<KeyPoint>&) { throw_no_nonfree }
7761
void cv::cuda::SURF_CUDA::downloadDescriptors(const GpuMat&, std::vector<float>&) { throw_no_nonfree }
@@ -82,6 +66,23 @@ void cv::cuda::SURF_CUDA::operator()(const GpuMat&, const GpuMat&, std::vector<K
8266
void cv::cuda::SURF_CUDA::operator()(const GpuMat&, const GpuMat&, std::vector<KeyPoint>&, std::vector<float>&, bool) { throw_no_nonfree }
8367
void cv::cuda::SURF_CUDA::releaseMemory() { throw_no_nonfree }
8468

69+
70+
#elif (!defined (HAVE_CUDA) || !defined (HAVE_OPENCV_CUDAARITHM))
71+
72+
cv::cuda::SURF_CUDA::SURF_CUDA() { throw_no_cuda(); }
73+
cv::cuda::SURF_CUDA::SURF_CUDA(double, int, int, bool, float, bool) { throw_no_cuda(); }
74+
int cv::cuda::SURF_CUDA::descriptorSize() const { throw_no_cuda(); }
75+
int cv::cuda::SURF_CUDA::defaultNorm() const { throw_no_cuda(); }
76+
void cv::cuda::SURF_CUDA::uploadKeypoints(const std::vector<KeyPoint>&, GpuMat&) { throw_no_cuda(); }
77+
void cv::cuda::SURF_CUDA::downloadKeypoints(const GpuMat&, std::vector<KeyPoint>&) { throw_no_cuda(); }
78+
void cv::cuda::SURF_CUDA::downloadDescriptors(const GpuMat&, std::vector<float>&) { throw_no_cuda(); }
79+
void cv::cuda::SURF_CUDA::operator()(const GpuMat&, const GpuMat&, GpuMat&) { throw_no_cuda(); }
80+
void cv::cuda::SURF_CUDA::operator()(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, bool) { throw_no_cuda(); }
81+
void cv::cuda::SURF_CUDA::operator()(const GpuMat&, const GpuMat&, std::vector<KeyPoint>&) { throw_no_cuda(); }
82+
void cv::cuda::SURF_CUDA::operator()(const GpuMat&, const GpuMat&, std::vector<KeyPoint>&, GpuMat&, bool) { throw_no_cuda(); }
83+
void cv::cuda::SURF_CUDA::operator()(const GpuMat&, const GpuMat&, std::vector<KeyPoint>&, std::vector<float>&, bool) { throw_no_cuda(); }
84+
void cv::cuda::SURF_CUDA::releaseMemory() { throw_no_cuda(); }
85+
8586
#else // OPENCV_ENABLE_NONFREE
8687

8788
namespace cv { namespace cuda { namespace device
@@ -450,7 +451,6 @@ void cv::cuda::SURF_CUDA::releaseMemory()
450451
maxPosBuffer.release();
451452
}
452453

453-
#endif // !defined (HAVE_CUDA)
454454
#endif // !defined (OPENCV_ENABLE_NONFREE)
455455
#endif
456456

0 commit comments

Comments
 (0)