File tree Expand file tree Collapse file tree 6 files changed +35
-4
lines changed Expand file tree Collapse file tree 6 files changed +35
-4
lines changed Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ static SUPPORTED_MODULES: [SupportedModule; 73] = [
139
139
SupportedModule :: XStereo ,
140
140
] ;
141
141
142
- static SUPPORTED_INHERENT_FEATURES : [ & str ; 2 ] = [ "hfloat" , "opencl" ] ;
142
+ static SUPPORTED_INHERENT_FEATURES : [ & str ; 3 ] = [ "hfloat" , "opencl" , "cuda "] ;
143
143
144
144
/// The contents of these vars will be present in the debug log, but will not cause the source rebuild
145
145
static DEBUG_ENV_VARS : [ & str ; 1 ] = [ "PATH" ] ;
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ pub use vector::*;
20
20
mod affine3;
21
21
mod data_type;
22
22
mod directx;
23
+ #[ cfg( ocvrs_has_inherent_feature_cuda) ]
23
24
mod gpumat;
24
25
mod inplace;
25
26
mod input_output_array;
Original file line number Diff line number Diff line change 9
9
#include < opencv2/core/va_intel.hpp>
10
10
#include < opencv2/core/directx.hpp>
11
11
#endif
12
- #include < opencv2/core/cuda.hpp>
12
+ #ifdef HAVE_CUDA
13
+ #include < opencv2/core/cuda.hpp>
14
+ #endif
13
15
#if (CV_VERSION_MAJOR == 3 && CV_VERSION_MINOR == 4 && CV_VERSION_REVISION >= 4) /* 3.4.4+ */ \
14
16
|| (CV_VERSION_MAJOR == 4 ) /* 4.0+ */ \
15
17
|| (CV_VERSION_MAJOR == 5 ) /* 5.0+ */
Original file line number Diff line number Diff line change 1
1
#include " ocvrs_common.hpp"
2
2
#include < opencv2/photo.hpp>
3
- #include < opencv2/photo/cuda.hpp>
3
+ #ifdef HAVE_CUDA
4
+ #include < opencv2/photo/cuda.hpp>
5
+ #endif
Original file line number Diff line number Diff line change
1
+ #include " ocvrs_common.hpp"
2
+
3
+ #ifndef HAVE_CUDA
4
+ // <opencv2/stitching.hpp> unconditionally includes a bunch of CUDA stuff without a proper way to disable it. That creates an
5
+ // issue as we don't generate GpuMat when HAVE_CUDA is not defined. A workaround is a couple of hacks that prevent the forced
6
+ // inclusion of <opencv2/core/cuda.hpp> and generation of functions that have GpuMat arguments.
7
+
8
+ // prevent forced inclusion of the <opencv2/core/cuda.hpp> header
9
+ #define OPENCV_CORE_CUDA_HPP
10
+
11
+ // generate a minimal stub for GpuMat so that C++ code compiles, but because of the missing export macro the bindings for the
12
+ // functions using this type will not be generated
13
+ namespace cv {
14
+ namespace cuda {
15
+ class GpuMat {
16
+ public:
17
+ void upload (InputArray arr);
18
+ void download (OutputArray dst) const ;
19
+ };
20
+ }
21
+ }
22
+ #endif
23
+
24
+ #include < opencv2/stitching.hpp>
Original file line number Diff line number Diff line change 1
1
#include " ocvrs_common.hpp"
2
2
#include < opencv2/xfeatures2d.hpp>
3
- #include < opencv2/xfeatures2d/cuda.hpp>
3
+ #ifdef HAVE_CUDA
4
+ #include < opencv2/xfeatures2d/cuda.hpp>
5
+ #endif
You can’t perform that action at this time.
0 commit comments