From af95395fe718e9443f880b14d41af4c0262048ac Mon Sep 17 00:00:00 2001 From: TolyaTalamanov Date: Wed, 7 Jun 2023 15:42:54 +0100 Subject: [PATCH] Fix ifdef condition --- modules/gapi/src/backends/ov/govbackend.cpp | 6 +++--- modules/gapi/src/backends/ov/govbackend.hpp | 4 ++-- modules/gapi/src/backends/ov/util.hpp | 4 ++-- modules/gapi/test/infer/gapi_infer_ov_tests.cpp | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/gapi/src/backends/ov/govbackend.cpp b/modules/gapi/src/backends/ov/govbackend.cpp index 65f76a9ca1..46eccd2bbd 100644 --- a/modules/gapi/src/backends/ov/govbackend.cpp +++ b/modules/gapi/src/backends/ov/govbackend.cpp @@ -10,7 +10,7 @@ // (cv::gapi::ov::backend() is still there and is defined always) #include "backends/ov/govbackend.hpp" -#ifdef HAVE_INF_ENGINE +#if defined HAVE_INF_ENGINE && INF_ENGINE_RELEASE >= 2022010000 #include "backends/ov/util.hpp" #include "api/gbackend_priv.hpp" // FIXME: Make it part of Backend SDK! @@ -991,11 +991,11 @@ void cv::gimpl::ov::GOVExecutable::run(cv::gimpl::GIslandExecutable::IInput &in } } -#else // HAVE_INF_ENGINE +#else // HAVE_INF_ENGINE && INF_ENGINE_RELEASE >= 2022010000 cv::gapi::GBackend cv::gapi::ov::backend() { // Still provide this symbol to avoid linking issues util::throw_error(std::runtime_error("G-API has been compiled without OpenVINO support")); } -#endif // HAVE_INF_ENGINE +#endif // HAVE_INF_ENGINE && INF_ENGINE_RELEASE >= 2022010000 diff --git a/modules/gapi/src/backends/ov/govbackend.hpp b/modules/gapi/src/backends/ov/govbackend.hpp index 85e584e7f3..0ac858dc52 100644 --- a/modules/gapi/src/backends/ov/govbackend.hpp +++ b/modules/gapi/src/backends/ov/govbackend.hpp @@ -10,7 +10,7 @@ // Include anyway - cv::gapi::ov::backend() still needs to be defined #include "opencv2/gapi/infer/ov.hpp" -#ifdef HAVE_INF_ENGINE +#if defined HAVE_INF_ENGINE && INF_ENGINE_RELEASE >= 2022010000 #include @@ -62,5 +62,5 @@ public: }}} -#endif // HAVE_INF_ENGINE +#endif // HAVE_INF_ENGINE && INF_ENGINE_RELEASE >= 2022010000 #endif // OPENCV_GAPI_GOVBACKEND_HPP diff --git a/modules/gapi/src/backends/ov/util.hpp b/modules/gapi/src/backends/ov/util.hpp index 07e6c08f6b..ea2aeb60a6 100644 --- a/modules/gapi/src/backends/ov/util.hpp +++ b/modules/gapi/src/backends/ov/util.hpp @@ -7,7 +7,7 @@ #ifndef OPENCV_GAPI_INFER_OV_UTIL_HPP #define OPENCV_GAPI_INFER_OV_UTIL_HPP -#ifdef HAVE_INF_ENGINE +#if defined HAVE_INF_ENGINE && INF_ENGINE_RELEASE >= 2022010000 // NOTE: This file is not included by default in infer/ov.hpp // and won't be. infer/ov.hpp doesn't depend on OV headers itself. @@ -30,6 +30,6 @@ GAPI_EXPORTS int to_ocv(const ::ov::element::Type &type); }}}} -#endif // HAVE_INF_ENGINE +#endif // HAVE_INF_ENGINE && INF_ENGINE_RELEASE >= 2022010000 #endif // OPENCV_GAPI_INFER_OV_UTIL_HPP diff --git a/modules/gapi/test/infer/gapi_infer_ov_tests.cpp b/modules/gapi/test/infer/gapi_infer_ov_tests.cpp index ecf5ab1a8c..ef63f9e8f6 100644 --- a/modules/gapi/test/infer/gapi_infer_ov_tests.cpp +++ b/modules/gapi/test/infer/gapi_infer_ov_tests.cpp @@ -4,7 +4,7 @@ // // Copyright (C) 2023 Intel Corporation -#ifdef HAVE_INF_ENGINE +#if defined HAVE_INF_ENGINE && INF_ENGINE_RELEASE >= 2022010000 #include "../test_precomp.hpp" @@ -537,4 +537,4 @@ TEST(TestAgeGenderOV, InferTensorWithPreproc) { } // namespace opencv_test -#endif // HAVE_INF_ENGINE +#endif // HAVE_INF_ENGINE && INF_ENGINE_RELEASE >= 2022010000 -- GitLab