From 55c1720719e654f44f6162643374b877b192fc52 Mon Sep 17 00:00:00 2001 From: OrestChura <43438132+OrestChura@users.noreply.github.com> Date: Tue, 3 Sep 2019 13:22:12 +0300 Subject: [PATCH] Merge pull request #15419 from OrestChura:gapi_headers_internal_flag_issue * - headers in "infer/" and "infer/ie/" folders are included into gapi_ext_hdrs; + because of that a few #includes are required in the headers - HAVE_INF_ENGINE flag check in headers "infer/ie.hpp" and "infer/ie/util.hpp" is deleted * - the "ie/util.hpp" header is a private header now as it's used for tests; it's been moved to the scr directory to the place next to the implementation file "ie/giebackend.cpp" - the path to this header in files "ie/giebackend.cpp" and "test/infer/gapi_infer_ie_test.cpp" is updated - As it's private header now and explicitly depends on IE, the "HAVE_INF_ENGINE" flag check is returned --- modules/gapi/CMakeLists.txt | 1 + modules/gapi/include/opencv2/gapi/infer/ie.hpp | 7 +++---- modules/gapi/src/backends/ie/giebackend.cpp | 2 +- .../opencv2/gapi/infer => src/backends}/ie/util.hpp | 6 +++++- modules/gapi/test/infer/gapi_infer_ie_test.cpp | 3 ++- 5 files changed, 12 insertions(+), 7 deletions(-) rename modules/gapi/{include/opencv2/gapi/infer => src/backends}/ie/util.hpp (87%) diff --git a/modules/gapi/CMakeLists.txt b/modules/gapi/CMakeLists.txt index 3198580d19..0dc18299de 100644 --- a/modules/gapi/CMakeLists.txt +++ b/modules/gapi/CMakeLists.txt @@ -28,6 +28,7 @@ file(GLOB gapi_ext_hdrs "${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/ocl/*.hpp" "${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/fluid/*.hpp" "${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/own/*.hpp" + "${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/infer/*.hpp" ) set(gapi_srcs diff --git a/modules/gapi/include/opencv2/gapi/infer/ie.hpp b/modules/gapi/include/opencv2/gapi/infer/ie.hpp index e1c4e74503..f9f5979e15 100644 --- a/modules/gapi/include/opencv2/gapi/infer/ie.hpp +++ b/modules/gapi/include/opencv2/gapi/infer/ie.hpp @@ -7,8 +7,6 @@ #ifndef OPENCV_GAPI_INFER_IE_HPP #define OPENCV_GAPI_INFER_IE_HPP -#ifdef HAVE_INF_ENGINE - #include #include #include @@ -17,6 +15,9 @@ #include #include +#include // GAPI_EXPORTS +#include // GKernelPackage + namespace cv { namespace gapi { // FIXME: introduce a new sub-namespace for NN? @@ -101,6 +102,4 @@ protected: } // namespace gapi } // namespace cv -#endif // HAVE_INF_ENGINE - #endif // OPENCV_GAPI_INFER_HPP diff --git a/modules/gapi/src/backends/ie/giebackend.cpp b/modules/gapi/src/backends/ie/giebackend.cpp index 0aac4d6ecb..2ab41e39b5 100644 --- a/modules/gapi/src/backends/ie/giebackend.cpp +++ b/modules/gapi/src/backends/ie/giebackend.cpp @@ -28,12 +28,12 @@ #include #include -#include #include "compiler/gobjref.hpp" #include "compiler/gmodel.hpp" #include "backends/ie/giebackend.hpp" +#include "backends/ie/util.hpp" #include "api/gbackend_priv.hpp" // FIXME: Make it part of Backend SDK! diff --git a/modules/gapi/include/opencv2/gapi/infer/ie/util.hpp b/modules/gapi/src/backends/ie/util.hpp similarity index 87% rename from modules/gapi/include/opencv2/gapi/infer/ie/util.hpp rename to modules/gapi/src/backends/ie/util.hpp index ce433a4f6c..1b6534e2af 100644 --- a/modules/gapi/include/opencv2/gapi/infer/ie/util.hpp +++ b/modules/gapi/src/backends/ie/util.hpp @@ -15,6 +15,9 @@ #include "inference_engine.hpp" +#include // GAPI_EXPORTS +#include // GKernelPackage + namespace cv { namespace gapi { namespace ie { @@ -27,5 +30,6 @@ GAPI_EXPORTS InferenceEngine::Blob::Ptr to_ie(cv::Mat &blob); }}}} -#endif // HAVE_INF_ENGINE +#endif //HAVE_INF_ENGINE + #endif // OPENCV_GAPI_INFER_IE_UTIL_HPP diff --git a/modules/gapi/test/infer/gapi_infer_ie_test.cpp b/modules/gapi/test/infer/gapi_infer_ie_test.cpp index 5e1d650728..2f62ece559 100644 --- a/modules/gapi/test/infer/gapi_infer_ie_test.cpp +++ b/modules/gapi/test/infer/gapi_infer_ie_test.cpp @@ -35,7 +35,8 @@ #include #include -#include + +#include "backends/ie/util.hpp" namespace opencv_test {