diff --git a/modules/core/cuda/main.cpp b/modules/core/cuda/main.cpp index 26d483420..4f47dc7e9 100644 --- a/modules/core/cuda/main.cpp +++ b/modules/core/cuda/main.cpp @@ -25,6 +25,8 @@ using namespace std; using namespace cv; using namespace cv::gpu; +#define throw_nogpu CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support") + #include "gpumat_cuda.hpp" #ifdef HAVE_CUDA diff --git a/modules/core/include/opencv2/core/gpumat.hpp b/modules/core/include/opencv2/core/gpumat.hpp index d62c8749b..755660461 100644 --- a/modules/core/include/opencv2/core/gpumat.hpp +++ b/modules/core/include/opencv2/core/gpumat.hpp @@ -48,8 +48,6 @@ #include "opencv2/core/core.hpp" #include "opencv2/core/cuda_devptrs.hpp" -#define throw_nogpu CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support") - namespace cv { namespace gpu { //////////////////////////////// Initialization & Info //////////////////////// diff --git a/modules/core/src/gpumat.cpp b/modules/core/src/gpumat.cpp index f438dfd8b..7e4eab4a1 100644 --- a/modules/core/src/gpumat.cpp +++ b/modules/core/src/gpumat.cpp @@ -65,6 +65,8 @@ using namespace std; using namespace cv; using namespace cv::gpu; +#define throw_nogpu CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support") + #include "gpumat_cuda.hpp" typedef GpuFuncTable* (*GpuFactoryType)();