diff --git a/docs/IE_PLUGIN_DG/Doxyfile b/docs/IE_PLUGIN_DG/Doxyfile index f19c746c7eb..8c275fe9f0c 100644 --- a/docs/IE_PLUGIN_DG/Doxyfile +++ b/docs/IE_PLUGIN_DG/Doxyfile @@ -2046,14 +2046,21 @@ INCLUDE_FILE_PATTERNS = # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. PREDEFINED = INFERENCE_PLUGIN_API \ + OPENVINO_PLUGIN_API \ INFERENCE_ENGINE_API \ INFERENCE_ENGINE_API_CPP \ INFERENCE_ENGINE_API_CLASS \ + OPENVINO_RUNTIME_API_C \ + OPENVINO_RUNTIME_API \ + OPENVINO_EXTERN_C \ + OPENVINO_CORE_IMPORTS \ + OPENVINO_CORE_EXPORTS \ + OPENVINO_CDECL \ + OPENVINO_STDCALL \ INFERENCE_ENGINE_DEPRECATED \ + OPENVINO_DEPRECATED \ IE_SUPPRESS_DEPRECATED_START \ IE_SUPPRESS_DEPRECATED_END \ - _IE_SUPPRESS_DEPRECATED_START_MSVC \ - _IE_SUPPRESS_DEPRECATED_END_MSVC \ _IE_SUPPRESS_DEPRECATED_START_GCC \ _IE_SUPPRESS_DEPRECATED_END_GCC \ IE_THREAD=IE_THREAD_TBB \ diff --git a/docs/doxygen/ie_docs.config b/docs/doxygen/ie_docs.config index 792d001bdcf..d8050d0e4a5 100644 --- a/docs/doxygen/ie_docs.config +++ b/docs/doxygen/ie_docs.config @@ -924,21 +924,27 @@ EXCLUDE_SYMBOLS = InferenceEngine::details \ __PRETTY_FUNCTION__ \ PRINT_COLOR_FORMAT \ PRINT_LAYOUT \ - INFERENCE_ENGINE_CDECL \ INFERENCE_PLUGIN_API \ + OPENVINO_PLUGIN_API \ INFERENCE_EXTENSION_API \ INFERENCE_ENGINE_API \ INFERENCE_ENGINE_API_CPP \ INFERENCE_ENGINE_API_CLASS \ + OPENVINO_RUNTIME_API_C \ + OPENVINO_RUNTIME_API \ + OPENVINO_EXTERN_C \ + OPENVINO_CORE_IMPORTS \ + OPENVINO_CORE_EXPORTS \ INFERENCE_ENGINE_DEPRECATED \ + OPENVINO_DEPRECATED \ + OPENVINO_CDECL \ + OPENVINO_STDCALL \ IE_SUPPRESS_DEPRECATED_START \ IE_SUPPRESS_DEPRECATED_END \ - _IE_SUPPRESS_DEPRECATED_START_MSVC \ - _IE_SUPPRESS_DEPRECATED_END_MSVC \ _IE_SUPPRESS_DEPRECATED_START_GCC \ _IE_SUPPRESS_DEPRECATED_END_GCC \ - INFERENCE_ENGINE_INTERNAL \ IE_DO_PRAGMA \ + OPENVINO_DO_PRAGMA \ parallel_* \ for_* \ splitter \ @@ -2216,18 +2222,20 @@ INCLUDE_FILE_PATTERNS = PREDEFINED = "INFERENCE_ENGINE_API_CLASS=" \ "INFERENCE_ENGINE_API_CPP=" \ "INFERENCE_ENGINE_API=" \ - "INFERENCE_ENGINE_CDECL=" \ "INFERENCE_ENGINE_DEPRECATED(x)=" \ + "OPENVINO_DEPRECATED(x)=" \ "IE_SUPPRESS_DEPRECATED_START=" \ + "OPENVINO_CDECL=" \ + "OPENVINO_STDCALL=" \ + "OPENVINO_EXTERN_C=" \ + "OPENVINO_CORE_IMPORTS=" \ + "OPENVINO_CORE_EXPORTS=" \ + "OPENVINO_RUNTIME_API_C=" \ + "OPENVINO_RUNTIME_API=" \ + "OPENVINO_PLUGIN_API=" \ "IE_SUPPRESS_DEPRECATED_END=" \ - "_IE_SUPPRESS_DEPRECATED_START_MSVC=" \ - "_IE_SUPPRESS_DEPRECATED_END_MSVC=" \ "_IE_SUPPRESS_DEPRECATED_START_GCC=" \ - "_IE_SUPPRESS_DEPRECATED_END_GCC=" \ - "INFERENCE_ENGINE_NN_BUILDER_API_CLASS=" \ - "INFERENCE_ENGINE_NN_BUILDER_DEPRECATED(x)=" \ - "INFERENCE_ENGINE_INTERNAL(x)=" \ - "INFERENCE_ENGINE_INTERNAL_CNNLAYER_CLASS(x)=" + "_IE_SUPPRESS_DEPRECATED_END_GCC=" # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The diff --git a/docs/doxygen/ie_plugin_api.config b/docs/doxygen/ie_plugin_api.config index 5b498c5e575..470d2dd845a 100644 --- a/docs/doxygen/ie_plugin_api.config +++ b/docs/doxygen/ie_plugin_api.config @@ -62,15 +62,21 @@ EXPAND_ONLY_PREDEF = YES PREDEFINED = "INFERENCE_ENGINE_API=" \ "INFERENCE_ENGINE_API_CPP=" \ "INFERENCE_ENGINE_API_CLASS=" \ + "OPENVINO_RUNTIME_API_C=" \ + "OPENVINO_RUNTIME_API=" \ + "OPENVINO_EXTERN_C=" \ + "OPENVINO_CORE_IMPORTS=" \ + "OPENVINO_CORE_EXPORTS=" \ "INFERENCE_ENGINE_DEPRECATED=" \ + "OPENVINO_DEPRECATED=" \ "inference_engine_transformations_EXPORTS" \ "TRANSFORMATIONS_API=" \ "NGRAPH_HELPER_DLL_EXPORT=" \ "NGRAPH_HELPER_DLL_IMPORT=" \ + "OPENVINO_CDECL=" \ + "OPENVINO_STDCALL=" \ "IE_SUPPRESS_DEPRECATED_START=" \ "IE_SUPPRESS_DEPRECATED_END=" \ - "_IE_SUPPRESS_DEPRECATED_START_MSVC=" \ - "_IE_SUPPRESS_DEPRECATED_END_MSVC=" \ "_IE_SUPPRESS_DEPRECATED_START_GCC=" \ "_IE_SUPPRESS_DEPRECATED_END_GCC=" \ "IE_THREAD=IE_THREAD_TBB" \ diff --git a/inference-engine/src/cldnn_engine/cldnn_config.cpp b/inference-engine/src/cldnn_engine/cldnn_config.cpp index 533e32271bd..88cccd9ba2f 100644 --- a/inference-engine/src/cldnn_engine/cldnn_config.cpp +++ b/inference-engine/src/cldnn_engine/cldnn_config.cpp @@ -15,11 +15,11 @@ #ifdef _WIN32 # include -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT # define mkdir(dir, mode) _wmkdir(dir) #else # define mkdir(dir, mode) _mkdir(dir) -#endif // ENABLE_UNICODE_PATH_SUPPORT +#endif // OPENVINO_ENABLE_UNICODE_PATH_SUPPORT #endif // _WIN32 using namespace InferenceEngine; @@ -27,7 +27,7 @@ using namespace InferenceEngine; namespace CLDNNPlugin { static void createDirectory(std::string _path) { -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) std::wstring widepath = ov::util::string_to_wstring(_path.c_str()); const wchar_t* path = widepath.c_str(); #else diff --git a/inference-engine/src/inference_engine/include/ie/ie_api.h b/inference-engine/src/inference_engine/include/ie/ie_api.h index 988258f8fe5..5f4826d66e3 100644 --- a/inference-engine/src/inference_engine/include/ie/ie_api.h +++ b/inference-engine/src/inference_engine/include/ie/ie_api.h @@ -13,21 +13,18 @@ # define INFERENCE_ENGINE_API(...) extern "C" __VA_ARGS__ # define INFERENCE_ENGINE_API_CPP(...) __VA_ARGS__ # define INFERENCE_ENGINE_API_CLASS(...) __VA_ARGS__ -# define INFERENCE_ENGINE_CDECL __attribute__((cdecl)) #else # if defined(_WIN32) -# define INFERENCE_ENGINE_CDECL # ifdef IMPLEMENT_INFERENCE_ENGINE_API # define INFERENCE_ENGINE_API(...) extern "C" __declspec(dllexport) __VA_ARGS__ __cdecl -# define INFERENCE_ENGINE_API_CPP(...) __declspec(dllexport) __VA_ARGS__ __cdecl +# define INFERENCE_ENGINE_API_CPP(...) __declspec(dllexport) __VA_ARGS__ # define INFERENCE_ENGINE_API_CLASS(...) __declspec(dllexport) __VA_ARGS__ # else # define INFERENCE_ENGINE_API(...) extern "C" __declspec(dllimport) __VA_ARGS__ __cdecl -# define INFERENCE_ENGINE_API_CPP(...) __declspec(dllimport) __VA_ARGS__ __cdecl +# define INFERENCE_ENGINE_API_CPP(...) __declspec(dllimport) __VA_ARGS__ # define INFERENCE_ENGINE_API_CLASS(...) __declspec(dllimport) __VA_ARGS__ # endif # else -# define INFERENCE_ENGINE_CDECL __attribute__((cdecl)) # define INFERENCE_ENGINE_API(...) extern "C" __attribute__((visibility("default"))) __VA_ARGS__ # define INFERENCE_ENGINE_API_CPP(...) __attribute__((visibility("default"))) __VA_ARGS__ # define INFERENCE_ENGINE_API_CLASS(...) __attribute__((visibility("default"))) __VA_ARGS__ @@ -44,12 +41,6 @@ # define INFERENCE_ENGINE_DEPRECATED(msg) #endif -#if defined IMPLEMENT_INFERENCE_ENGINE_API || defined IMPLEMENT_INFERENCE_ENGINE_PLUGIN -# define INFERENCE_ENGINE_INTERNAL(msg) -#else -# define INFERENCE_ENGINE_INTERNAL(msg) INFERENCE_ENGINE_DEPRECATED(msg) -#endif - // Suppress warning "-Wdeprecated-declarations" / C4996 #if defined(_MSC_VER) # define IE_DO_PRAGMA(x) __pragma(x) @@ -80,14 +71,6 @@ IE_DO_PRAGMA(warning(disable : 1786)) # define IE_SUPPRESS_DEPRECATED_END #endif -#ifdef _WIN32 -# define _IE_SUPPRESS_DEPRECATED_START_MSVC IE_SUPPRESS_DEPRECATED_START -# define _IE_SUPPRESS_DEPRECATED_END_MSVC IE_SUPPRESS_DEPRECATED_END -#else -# define _IE_SUPPRESS_DEPRECATED_START_MSVC -# define _IE_SUPPRESS_DEPRECATED_END_MSVC -#endif - #if defined __GNUC__ && (__GNUC__ <= 4 || (__GNUC__ == 5 && __GNUC_MINOR__ <= 5) || \ (defined __i386__ || defined __arm__ || defined __aarch64__)) # define _IE_SUPPRESS_DEPRECATED_START_GCC IE_SUPPRESS_DEPRECATED_START @@ -107,6 +90,10 @@ IE_DO_PRAGMA(warning(disable : 1786)) # endif #endif +#ifdef ENABLE_UNICODE_PATH_SUPPORT +# define OPENVINO_ENABLE_UNICODE_PATH_SUPPORT +#endif + /** * @def INFERENCE_PLUGIN_API(type) * @brief Defines Inference Engine Plugin API method diff --git a/inference-engine/src/inference_engine/include/openvino/runtime/common.hpp b/inference-engine/src/inference_engine/include/openvino/runtime/common.hpp index f9c075e8381..33748156028 100644 --- a/inference-engine/src/inference_engine/include/openvino/runtime/common.hpp +++ b/inference-engine/src/inference_engine/include/openvino/runtime/common.hpp @@ -13,6 +13,33 @@ #include #include +#include "openvino/core/visibility.hpp" + +#ifdef USE_STATIC_IE // defined if we are building or calling OpenVINO Runtime as a static library +# define OPENVINO_RUNTIME_API_C(...) OPENVINO_EXTERN_C __VA_ARGS__ +# define OPENVINO_RUNTIME_API +#else +# ifdef IMPLEMENT_INFERENCE_ENGINE_API // defined if we are building the OpenVINO runtime DLL (instead of using it) +# define OPENVINO_RUNTIME_API_C(...) OPENVINO_EXTERN_C OPENVINO_CORE_EXPORTS __VA_ARGS__ OPENVINO_CDECL +# define OPENVINO_RUNTIME_API OPENVINO_CORE_EXPORTS +# else +# define OPENVINO_RUNTIME_API_C(...) OPENVINO_EXTERN_C OPENVINO_CORE_IMPORTS __VA_ARGS__ OPENVINO_CDECL +# define OPENVINO_RUNTIME_API OPENVINO_CORE_IMPORTS +# endif // IMPLEMENT_INFERENCE_ENGINE_API +#endif // USE_STATIC_IE + +/** + * @def OPENVINO_PLUGIN_API(type) + * @brief Defines OpenVINO Runtime Plugin API method + * @param type A plugin type + */ + +#ifdef IMPLEMENT_INFERENCE_ENGINE_PLUGIN +# define OPENVINO_PLUGIN_API(type) OPENVINO_EXTERN_C OPENVINO_CORE_EXPORTS type +#else +# define OPENVINO_PLUGIN_API(type) OPENVINO_EXTERN_C type +#endif + namespace InferenceEngine {} namespace ov { diff --git a/inference-engine/src/inference_engine/include/openvino/runtime/core.hpp b/inference-engine/src/inference_engine/include/openvino/runtime/core.hpp index 2c0efb929eb..cdb523184ba 100644 --- a/inference-engine/src/inference_engine/include/openvino/runtime/core.hpp +++ b/inference-engine/src/inference_engine/include/openvino/runtime/core.hpp @@ -38,7 +38,7 @@ namespace runtime { * * It can throw exceptions safely for the application, where it is properly handled. */ -class INFERENCE_ENGINE_API_CLASS(Core) { +class OPENVINO_RUNTIME_API Core { class Impl; std::shared_ptr _impl; @@ -61,7 +61,7 @@ public: */ std::map get_versions(const std::string& deviceName) const; -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT /** * @brief Reads models from IR and ONNX formats * @param modelPath path to model diff --git a/inference-engine/src/inference_engine/include/openvino/runtime/executable_network.hpp b/inference-engine/src/inference_engine/include/openvino/runtime/executable_network.hpp index f3bf860ad1c..92a706e3253 100644 --- a/inference-engine/src/inference_engine/include/openvino/runtime/executable_network.hpp +++ b/inference-engine/src/inference_engine/include/openvino/runtime/executable_network.hpp @@ -33,7 +33,7 @@ class Core; /** * @brief This is an interface of an executable network */ -class INFERENCE_ENGINE_API_CLASS(ExecutableNetwork) { +class OPENVINO_RUNTIME_API ExecutableNetwork { std::shared_ptr _so; std::shared_ptr _impl; diff --git a/inference-engine/src/inference_engine/include/openvino/runtime/infer_request.hpp b/inference-engine/src/inference_engine/include/openvino/runtime/infer_request.hpp index 5f58c43d31c..6dd5a143ab6 100644 --- a/inference-engine/src/inference_engine/include/openvino/runtime/infer_request.hpp +++ b/inference-engine/src/inference_engine/include/openvino/runtime/infer_request.hpp @@ -32,7 +32,7 @@ class ExecutableNetwork; * * It can throw exceptions safely for the application, where it is properly handled. */ -class INFERENCE_ENGINE_API_CLASS(InferRequest) { +class OPENVINO_RUNTIME_API InferRequest { std::shared_ptr _so; std::shared_ptr _impl; diff --git a/inference-engine/src/inference_engine/include/openvino/runtime/remote_context.hpp b/inference-engine/src/inference_engine/include/openvino/runtime/remote_context.hpp index 6cd2dd2fbed..8faead4db45 100644 --- a/inference-engine/src/inference_engine/include/openvino/runtime/remote_context.hpp +++ b/inference-engine/src/inference_engine/include/openvino/runtime/remote_context.hpp @@ -32,7 +32,7 @@ class Core; * Such context represents a scope on the device within which executable * networks and remote memory blobs can exist, function and exchange data. */ -class INFERENCE_ENGINE_API_CLASS(RemoteContext) { +class OPENVINO_RUNTIME_API RemoteContext { std::shared_ptr _so; std::shared_ptr _impl; diff --git a/inference-engine/src/inference_engine/include/openvino/runtime/variable_state.hpp b/inference-engine/src/inference_engine/include/openvino/runtime/variable_state.hpp index 49e07c3c2d2..93144180488 100644 --- a/inference-engine/src/inference_engine/include/openvino/runtime/variable_state.hpp +++ b/inference-engine/src/inference_engine/include/openvino/runtime/variable_state.hpp @@ -10,9 +10,6 @@ #pragma once -#include -#include - #include #include @@ -31,7 +28,7 @@ class InferRequest; /** * @brief VariableState class */ -class INFERENCE_ENGINE_API_CLASS(VariableState) { +class OPENVINO_RUNTIME_API VariableState { std::shared_ptr _so; std::shared_ptr _impl; diff --git a/inference-engine/src/inference_engine/src/file_utils.cpp b/inference-engine/src/inference_engine/src/file_utils.cpp index a794a396cd0..6a073f1d2c8 100644 --- a/inference-engine/src/inference_engine/src/file_utils.cpp +++ b/inference-engine/src/inference_engine/src/file_utils.cpp @@ -20,7 +20,7 @@ # include # include # include -# ifdef ENABLE_UNICODE_PATH_SUPPORT +# ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT # include # include # endif @@ -67,7 +67,7 @@ #endif long long FileUtils::fileSize(const char* charfilepath) { -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) std::wstring widefilename = ov::util::string_to_wstring(charfilepath); const wchar_t* fileName = widefilename.c_str(); #elif defined(__ANDROID__) || defined(ANDROID) @@ -169,7 +169,7 @@ static std::string getIELibraryPathA() { #endif // _WIN32 } -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT std::wstring getIELibraryPathW() { # ifdef _WIN32 @@ -189,10 +189,10 @@ std::wstring getIELibraryPathW() { # endif } -#endif // ENABLE_UNICODE_PATH_SUPPORT +#endif // OPENVINO_ENABLE_UNICODE_PATH_SUPPORT std::string getIELibraryPath() { -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT return ov::util::wstring_to_string(getIELibraryPathW()); #else return getIELibraryPathA(); diff --git a/inference-engine/src/inference_engine/src/ie_core.cpp b/inference-engine/src/inference_engine/src/ie_core.cpp index 446c7f8028d..87a0e30181e 100644 --- a/inference-engine/src/inference_engine/src/ie_core.cpp +++ b/inference-engine/src/inference_engine/src/ie_core.cpp @@ -981,7 +981,7 @@ std::map Core::GetVersions(const std::string& deviceName) return _impl->GetVersions(deviceName); } -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT CNNNetwork Core::ReadNetwork(const std::wstring& modelPath, const std::wstring& binPath) const { return ReadNetwork(ov::util::wstring_to_string(modelPath), ov::util::wstring_to_string(binPath)); @@ -1245,7 +1245,7 @@ std::map Core::get_versions(const std::string& deviceN OV_CORE_CALL_STATEMENT(return _impl->GetVersions(deviceName)) } -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT std::shared_ptr Core::read_model(const std::wstring& modelPath, const std::wstring& binPath) const { OV_CORE_CALL_STATEMENT( return _impl->ReadNetwork(ov::util::wstring_to_string(modelPath), ov::util::wstring_to_string(binPath)) diff --git a/inference-engine/src/inference_engine/src/ie_network_reader.cpp b/inference-engine/src/inference_engine/src/ie_network_reader.cpp index 2227d524e81..c9ca81450d0 100644 --- a/inference-engine/src/inference_engine/src/ie_network_reader.cpp +++ b/inference-engine/src/inference_engine/src/ie_network_reader.cpp @@ -171,7 +171,7 @@ CNNNetwork details::ReadNetwork(const std::string& modelPath, registerReaders(); // Fix unicode name -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) std::wstring model_path = ov::util::string_to_wstring(modelPath.c_str()); #else std::string model_path = modelPath; @@ -207,7 +207,7 @@ CNNNetwork details::ReadNetwork(const std::string& modelPath, } if (!bPath.empty()) { // Open weights file -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) std::wstring weights_path = ov::util::string_to_wstring(bPath.c_str()); #else std::string weights_path = bPath; @@ -251,7 +251,7 @@ CNNNetwork details::ReadNetwork(const std::string& modelPath, } if (!binPath.empty()) { -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) const std::wstring& weights_path = ov::util::string_to_wstring(binPath.c_str()); #else const std::string& weights_path = binPath; diff --git a/inference-engine/src/inference_engine/src/os/lin/lin_shared_object_loader.cpp b/inference-engine/src/inference_engine/src/os/lin/lin_shared_object_loader.cpp index 052bbfbb1fe..e35fcf53757 100644 --- a/inference-engine/src/inference_engine/src/os/lin/lin_shared_object_loader.cpp +++ b/inference-engine/src/inference_engine/src/os/lin/lin_shared_object_loader.cpp @@ -27,11 +27,11 @@ std::shared_ptr load_shared_object(const char* path) { return shared_object; } -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT std::shared_ptr load_shared_object(const wchar_t* path) { return load_shared_object(ov::util::wstring_to_string(path).c_str()); } -#endif // ENABLE_UNICODE_PATH_SUPPORT +#endif // OPENVINO_ENABLE_UNICODE_PATH_SUPPORT void* get_symbol(const std::shared_ptr& shared_object, const char* symbol_name) { if (!shared_object) { @@ -57,9 +57,9 @@ struct SharedObjectLoader::Impl { explicit Impl(const char* pluginName) : shared_object{ov::runtime::load_shared_object(pluginName)} {} -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT explicit Impl(const wchar_t* pluginName) : Impl(ov::util::wstring_to_string(pluginName).c_str()) {} -#endif // ENABLE_UNICODE_PATH_SUPPORT +#endif // OPENVINO_ENABLE_UNICODE_PATH_SUPPORT void* get_symbol(const char* symbolName) const { return ov::runtime::get_symbol(shared_object, symbolName); @@ -70,7 +70,7 @@ SharedObjectLoader::SharedObjectLoader(const std::shared_ptr& shared_objec _impl.reset(new Impl(shared_object)); } -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT SharedObjectLoader::SharedObjectLoader(const wchar_t* pluginName) { _impl.reset(new Impl(pluginName)); } diff --git a/inference-engine/src/inference_engine/src/os/win/win_shared_object_loader.cpp b/inference-engine/src/inference_engine/src/os/win/win_shared_object_loader.cpp index 5e36e2f04cf..4ec932d021a 100644 --- a/inference-engine/src/inference_engine/src/os/win/win_shared_object_loader.cpp +++ b/inference-engine/src/inference_engine/src/os/win/win_shared_object_loader.cpp @@ -122,7 +122,7 @@ std::shared_ptr load_shared_object(const char* path) { }}; } -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT std::shared_ptr load_shared_object(const wchar_t* path) { void* shared_object = nullptr; using GetDllDirectoryW_Fnc = DWORD(*)(DWORD, LPWSTR); @@ -193,9 +193,9 @@ struct SharedObjectLoader::Impl { explicit Impl(const char* pluginName) : shared_object{ov::runtime::load_shared_object(pluginName)} {} -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT explicit Impl(const wchar_t* pluginName) : shared_object{ov::runtime::load_shared_object(pluginName)} {} -#endif // ENABLE_UNICODE_PATH_SUPPORT +#endif // OPENVINO_ENABLE_UNICODE_PATH_SUPPORT void* get_symbol(const char* symbolName) const { return ov::runtime::get_symbol(shared_object, symbolName); @@ -211,7 +211,7 @@ SharedObjectLoader::~SharedObjectLoader() {} SharedObjectLoader::SharedObjectLoader(const char * pluginName) { _impl = std::make_shared(pluginName); } -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT SharedObjectLoader::SharedObjectLoader(const wchar_t* pluginName) { _impl = std::make_shared(pluginName); } diff --git a/inference-engine/src/legacy_api/include/legacy/ie_layers.h b/inference-engine/src/legacy_api/include/legacy/ie_layers.h index 7eb2c474597..bcf62343c61 100644 --- a/inference-engine/src/legacy_api/include/legacy/ie_layers.h +++ b/inference-engine/src/legacy_api/include/legacy/ie_layers.h @@ -24,6 +24,20 @@ #include #include +#if defined IMPLEMENT_INFERENCE_ENGINE_API || defined IMPLEMENT_INFERENCE_ENGINE_PLUGIN +# define INFERENCE_ENGINE_INTERNAL(msg) +#else +# define INFERENCE_ENGINE_INTERNAL(msg) INFERENCE_ENGINE_DEPRECATED(msg) +#endif + +#ifdef _WIN32 +# define _IE_SUPPRESS_DEPRECATED_START_MSVC IE_SUPPRESS_DEPRECATED_START +# define _IE_SUPPRESS_DEPRECATED_END_MSVC IE_SUPPRESS_DEPRECATED_END +#else +# define _IE_SUPPRESS_DEPRECATED_START_MSVC +# define _IE_SUPPRESS_DEPRECATED_END_MSVC +#endif + #if defined IMPLEMENT_INFERENCE_ENGINE_API || defined IMPLEMENT_INFERENCE_ENGINE_PLUGIN # define INFERENCE_ENGINE_INTERNAL_CNNLAYER_CLASS(...) INFERENCE_ENGINE_API_CLASS(__VA_ARGS__) #else diff --git a/inference-engine/src/plugin_api/file_utils.h b/inference-engine/src/plugin_api/file_utils.h index cad183071b2..cbde9d156d6 100644 --- a/inference-engine/src/plugin_api/file_utils.h +++ b/inference-engine/src/plugin_api/file_utils.h @@ -52,7 +52,7 @@ INFERENCE_ENGINE_API_CPP(bool) directoryExists(const std::string& path); */ INFERENCE_ENGINE_API(long long) fileSize(const char *fileName); -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT /** * @brief Returns file size for file with UNICODE path name @@ -66,7 +66,7 @@ inline long long fileSize(const wchar_t* fileName) { return fileSize(::ov::util::wstring_to_string(fileName).c_str()); } -#endif // ENABLE_UNICODE_PATH_SUPPORT +#endif // OPENVINO_ENABLE_UNICODE_PATH_SUPPORT /** * @brief Function to get the size of a file. The function supports UNICODE path @@ -150,7 +150,7 @@ namespace InferenceEngine { */ INFERENCE_ENGINE_API_CPP(std::string) getIELibraryPath(); -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT /** * @brief Returns a unicode path to Inference Engine library @@ -169,6 +169,6 @@ inline ::ov::util::FilePath getInferenceEngineLibraryPath() { return getIELibraryPath(); } -#endif // ENABLE_UNICODE_PATH_SUPPORT +#endif // OPENVINO_ENABLE_UNICODE_PATH_SUPPORT } // namespace InferenceEngine diff --git a/inference-engine/src/plugin_api/shared_object.hpp b/inference-engine/src/plugin_api/shared_object.hpp index 1b839687ef0..b21d3a7c87c 100644 --- a/inference-engine/src/plugin_api/shared_object.hpp +++ b/inference-engine/src/plugin_api/shared_object.hpp @@ -20,14 +20,14 @@ namespace runtime { */ INFERENCE_ENGINE_API_CPP(std::shared_ptr) load_shared_object(const char* path); -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT /** * @brief Loads a library with the wide char name specified. * @param path Full or relative path to the plugin library * @return Reference to shared object */ INFERENCE_ENGINE_API_CPP(std::shared_ptr) load_shared_object(const wchar_t* path); -#endif // ENABLE_UNICODE_PATH_SUPPORT +#endif // OPENVINO_ENABLE_UNICODE_PATH_SUPPORT /** * @brief Searches for a function symbol in the loaded module * @param shared_object shared object reference diff --git a/inference-engine/src/plugin_api/xml_parse_utils.h b/inference-engine/src/plugin_api/xml_parse_utils.h index af70ff03bd6..8c1aa02a931 100644 --- a/inference-engine/src/plugin_api/xml_parse_utils.h +++ b/inference-engine/src/plugin_api/xml_parse_utils.h @@ -254,7 +254,7 @@ struct parse_result { * @return The parse_result. */ inline parse_result ParseXml(const char* file_path) { -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT std::wstring wFilePath = ov::util::string_to_wstring(file_path); const wchar_t* resolvedFilepath = wFilePath.c_str(); #else diff --git a/inference-engine/src/readers/ir_reader_v7/ie_cnn_net_reader_impl.cpp b/inference-engine/src/readers/ir_reader_v7/ie_cnn_net_reader_impl.cpp index d7c1d2d9f66..e522940bb71 100644 --- a/inference-engine/src/readers/ir_reader_v7/ie_cnn_net_reader_impl.cpp +++ b/inference-engine/src/readers/ir_reader_v7/ie_cnn_net_reader_impl.cpp @@ -71,7 +71,7 @@ namespace { void readAllFile(const std::string& string_file_name, void* buffer, size_t maxSize) { std::ifstream inputFile; -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) std::wstring file_name = ov::util::string_to_wstring(string_file_name.c_str()); #else std::string file_name = string_file_name; diff --git a/inference-engine/src/readers/ir_reader_v7/ie_ir_reader.cpp b/inference-engine/src/readers/ir_reader_v7/ie_ir_reader.cpp index 9ce2c29f1f9..470885257f8 100644 --- a/inference-engine/src/readers/ir_reader_v7/ie_ir_reader.cpp +++ b/inference-engine/src/readers/ir_reader_v7/ie_ir_reader.cpp @@ -4,6 +4,7 @@ #include +#include "openvino/runtime/common.hpp" #include #include #include @@ -41,6 +42,6 @@ CNNNetwork IRReader::read(std::istream& model, const Blob::CPtr& weights, const return CNNNetwork(parser.parse(root, weights)); } -INFERENCE_PLUGIN_API(void) InferenceEngine::CreateReader(std::shared_ptr& reader) { +OPENVINO_PLUGIN_API(void) InferenceEngine::CreateReader(std::shared_ptr& reader) { reader = std::make_shared(); } diff --git a/inference-engine/src/readers/reader_api/ie_reader.hpp b/inference-engine/src/readers/reader_api/ie_reader.hpp index 9b023e84824..b63757a4c9c 100644 --- a/inference-engine/src/readers/reader_api/ie_reader.hpp +++ b/inference-engine/src/readers/reader_api/ie_reader.hpp @@ -4,6 +4,7 @@ #pragma once +#include "openvino/runtime/common.hpp" #include #include #include @@ -57,6 +58,6 @@ protected: * @brief Creates the default instance of the reader * @return Reader interface */ -INFERENCE_PLUGIN_API(void) CreateReader(std::shared_ptr& reader); +OPENVINO_PLUGIN_API(void) CreateReader(std::shared_ptr& reader); } // namespace InferenceEngine diff --git a/inference-engine/tests/functional/inference_engine/ngraph_reader/net_reader_test.cpp b/inference-engine/tests/functional/inference_engine/ngraph_reader/net_reader_test.cpp index c9868fc01df..5ff3bfb3a18 100644 --- a/inference-engine/tests/functional/inference_engine/ngraph_reader/net_reader_test.cpp +++ b/inference-engine/tests/functional/inference_engine/ngraph_reader/net_reader_test.cpp @@ -16,7 +16,7 @@ #include "network_utils.hpp" -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT # define GTEST_COUT std::cerr << "[ ] [ INFO ] " # include #endif @@ -71,7 +71,7 @@ TEST_P(NetReaderTest, ReadNetworkTwiceSeparately) { IE_SUPPRESS_DEPRECATED_END } -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT TEST_P(NetReaderTest, ReadCorrectModelWithWeightsUnicodePath) { GTEST_COUT << "params.modelPath: '" << _modelPath << "'" << std::endl; diff --git a/inference-engine/tests/functional/inference_engine/onnx_reader/onnx_reader_external_data.cpp b/inference-engine/tests/functional/inference_engine/onnx_reader/onnx_reader_external_data.cpp index 395274a627d..5471f0ea9a3 100644 --- a/inference-engine/tests/functional/inference_engine/onnx_reader/onnx_reader_external_data.cpp +++ b/inference-engine/tests/functional/inference_engine/onnx_reader/onnx_reader_external_data.cpp @@ -76,7 +76,7 @@ TEST(ONNX_Reader_Tests, ImportModelWithExternalDataFromStringException) { } } -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) TEST(ONNX_Reader_Tests, ImportModelWithExternalDataFromWstringNamedFile) { InferenceEngine::Core ie; std::string win_dir_path = CommonTestUtils::getModelFromTestModelZoo( diff --git a/inference-engine/tests/functional/inference_engine/ov_variable_state_test.cpp b/inference-engine/tests/functional/inference_engine/ov_variable_state_test.cpp index e29e881fa01..088fe120f18 100644 --- a/inference-engine/tests/functional/inference_engine/ov_variable_state_test.cpp +++ b/inference-engine/tests/functional/inference_engine/ov_variable_state_test.cpp @@ -4,6 +4,8 @@ #include +#include "ie_blob.h" + #include #include diff --git a/inference-engine/tests/functional/inference_engine/paddle_reader/read_paddle_model_test.cpp b/inference-engine/tests/functional/inference_engine/paddle_reader/read_paddle_model_test.cpp index b3c21d19cc4..8bb7b222bc1 100644 --- a/inference-engine/tests/functional/inference_engine/paddle_reader/read_paddle_model_test.cpp +++ b/inference-engine/tests/functional/inference_engine/paddle_reader/read_paddle_model_test.cpp @@ -47,7 +47,7 @@ TEST(PDPD_Reader_Tests, ImportBasicModelToCore) { ASSERT_TRUE(res.valid) << res.message; } -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) TEST(PDPD_Reader_Tests, ImportBasicModelToCoreWstring) { std::string win_dir_path{ PADDLE_TEST_MODELS "relu.pdmodel" }; std::wstring wmodel = CommonTestUtils::addUnicodePostfixToPath(win_dir_path, diff --git a/inference-engine/tests/functional/plugin/gpu/behavior/cache.cpp b/inference-engine/tests/functional/plugin/gpu/behavior/cache.cpp index a79e7f0a7db..f26724e9f6f 100644 --- a/inference-engine/tests/functional/plugin/gpu/behavior/cache.cpp +++ b/inference-engine/tests/functional/plugin/gpu/behavior/cache.cpp @@ -49,7 +49,7 @@ TEST_F(CompiledKernelsCacheTest, CanCreateCacheDirAndDumpBinaries) { } } -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT TEST_F(CompiledKernelsCacheTest, CanCreateCacheDirAndDumpBinariesUnicodePath) { std::shared_ptr ie = PluginCache::get().ie(); @@ -83,4 +83,4 @@ TEST_F(CompiledKernelsCacheTest, CanCreateCacheDirAndDumpBinariesUnicodePath) { } } -#endif // ENABLE_UNICODE_PATH_SUPPORT +#endif // OPENVINO_ENABLE_UNICODE_PATH_SUPPORT diff --git a/inference-engine/tests/functional/plugin/shared/include/behavior/core_integration.hpp b/inference-engine/tests/functional/plugin/shared/include/behavior/core_integration.hpp index 99525798c40..be8d312fcb9 100644 --- a/inference-engine/tests/functional/plugin/shared/include/behavior/core_integration.hpp +++ b/inference-engine/tests/functional/plugin/shared/include/behavior/core_integration.hpp @@ -21,7 +21,7 @@ #include #include -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT #include #define GTEST_COUT std::cerr << "[ ] [ INFO ] " #include @@ -263,7 +263,7 @@ TEST(IEClassBasicTest, smoke_createMockEngineConfigThrows) { #endif -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT TEST_P(IEClassBasicTestP, smoke_registerPluginsXMLUnicodePath) { SKIP_IF_CURRENT_TEST_IS_DISABLED() @@ -310,7 +310,7 @@ TEST_P(IEClassBasicTestP, smoke_registerPluginsXMLUnicodePath) { CommonTestUtils::removeFile(pluginXML); } -#endif // ENABLE_UNICODE_PATH_SUPPORT +#endif // OPENVINO_ENABLE_UNICODE_PATH_SUPPORT // // GetVersions() diff --git a/inference-engine/tests/functional/plugin/shared/include/behavior/ov_core_integration.hpp b/inference-engine/tests/functional/plugin/shared/include/behavior/ov_core_integration.hpp index f1f8a1aaf8a..383222ee710 100644 --- a/inference-engine/tests/functional/plugin/shared/include/behavior/ov_core_integration.hpp +++ b/inference-engine/tests/functional/plugin/shared/include/behavior/ov_core_integration.hpp @@ -21,7 +21,7 @@ #include "common_test_utils/unicode_utils.hpp" #include "ngraph_functions/subgraph_builders.hpp" -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT # include # define GTEST_COUT std::cerr << "[ ] [ INFO ] " # include @@ -258,7 +258,7 @@ TEST(OVClassBasicTest, smoke_createMockEngineConfigThrows) { #endif -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT TEST_P(OVClassBasicTestP, smoke_registerPluginsXMLUnicodePath) { SKIP_IF_CURRENT_TEST_IS_DISABLED() @@ -305,7 +305,7 @@ TEST_P(OVClassBasicTestP, smoke_registerPluginsXMLUnicodePath) { CommonTestUtils::removeFile(pluginXML); } -#endif // ENABLE_UNICODE_PATH_SUPPORT +#endif // OPENVINO_ENABLE_UNICODE_PATH_SUPPORT // // GetVersions() diff --git a/inference-engine/tests/ie_test_utils/common_test_utils/unicode_utils.cpp b/inference-engine/tests/ie_test_utils/common_test_utils/unicode_utils.cpp index 22a19fa089d..bdbc74c49fe 100644 --- a/inference-engine/tests/ie_test_utils/common_test_utils/unicode_utils.cpp +++ b/inference-engine/tests/ie_test_utils/common_test_utils/unicode_utils.cpp @@ -5,7 +5,7 @@ #include #include "unicode_utils.hpp" -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT namespace CommonTestUtils { @@ -22,4 +22,4 @@ const std::vector test_unicode_postfix_vector = { } // namespace CommonTestUtils -#endif // ENABLE_UNICODE_PATH_SUPPORT +#endif // OPENVINO_ENABLE_UNICODE_PATH_SUPPORT diff --git a/inference-engine/tests/ie_test_utils/common_test_utils/unicode_utils.hpp b/inference-engine/tests/ie_test_utils/common_test_utils/unicode_utils.hpp index 7cb7242c96a..6494f0a7f2d 100644 --- a/inference-engine/tests/ie_test_utils/common_test_utils/unicode_utils.hpp +++ b/inference-engine/tests/ie_test_utils/common_test_utils/unicode_utils.hpp @@ -13,7 +13,7 @@ #include "common_utils.hpp" #include "w_dirent.h" -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT namespace CommonTestUtils { @@ -161,4 +161,4 @@ inline bool directoryExists(const std::wstring &path) { extern const std::vector test_unicode_postfix_vector; } // namespace CommonTestUtils -#endif // ENABLE_UNICODE_PATH_SUPPORT +#endif // OPENVINO_ENABLE_UNICODE_PATH_SUPPORT diff --git a/inference-engine/tests/ie_test_utils/unit_test_utils/mocks/mock_engine/mock_plugin.cpp b/inference-engine/tests/ie_test_utils/unit_test_utils/mocks/mock_engine/mock_plugin.cpp index e6cefc75ea2..fb83ff57c13 100644 --- a/inference-engine/tests/ie_test_utils/unit_test_utils/mocks/mock_engine/mock_plugin.cpp +++ b/inference-engine/tests/ie_test_utils/unit_test_utils/mocks/mock_engine/mock_plugin.cpp @@ -7,6 +7,7 @@ #include #include +#include "openvino/runtime/common.hpp" #include "mock_plugin.hpp" #include "description_buffer.hpp" @@ -132,17 +133,17 @@ std::string MockPlugin::GetName() const noexcept { InferenceEngine::IInferencePlugin *__target = nullptr; -INFERENCE_PLUGIN_API(void) CreatePluginEngine(std::shared_ptr& plugin) { +OPENVINO_PLUGIN_API(void) CreatePluginEngine(std::shared_ptr& plugin) { IInferencePlugin *p = nullptr; std::swap(__target, p); plugin = std::make_shared(p); } -INFERENCE_PLUGIN_API(InferenceEngine::IInferencePlugin*) +OPENVINO_PLUGIN_API(InferenceEngine::IInferencePlugin*) CreatePluginEngineProxy(InferenceEngine::IInferencePlugin *target) { return new MockPlugin(target); } -INFERENCE_PLUGIN_API(void) InjectProxyEngine(InferenceEngine::IInferencePlugin *target) { +OPENVINO_PLUGIN_API(void) InjectProxyEngine(InferenceEngine::IInferencePlugin *target) { __target = target; } diff --git a/inference-engine/thirdparty/clDNN/runtime/kernels_cache.cpp b/inference-engine/thirdparty/clDNN/runtime/kernels_cache.cpp index 48347183028..74cf5cf2816 100644 --- a/inference-engine/thirdparty/clDNN/runtime/kernels_cache.cpp +++ b/inference-engine/thirdparty/clDNN/runtime/kernels_cache.cpp @@ -30,18 +30,18 @@ #include #endif -#ifndef ENABLE_UNICODE_PATH_SUPPORT +#ifndef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT # ifdef _WIN32 # if defined __INTEL_COMPILER || defined _MSC_VER -# define ENABLE_UNICODE_PATH_SUPPORT +# define OPENVINO_ENABLE_UNICODE_PATH_SUPPORT # endif # elif defined(__GNUC__) && (__GNUC__ > 5 || (__GNUC__ == 5 && __GNUC_MINOR__ > 2)) || defined(__clang__) -# define ENABLE_UNICODE_PATH_SUPPORT +# define OPENVINO_ENABLE_UNICODE_PATH_SUPPORT # endif #endif #ifndef _WIN32 -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT #include #include #endif @@ -55,7 +55,7 @@ namespace { std::mutex cacheAccessMutex; -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) std::wstring multiByteCharToWString(const char* str) { #ifdef _WIN32 int strSize = static_cast(std::strlen(str)); @@ -69,12 +69,12 @@ std::wstring multiByteCharToWString(const char* str) { return result; #endif // _WIN32 } -#endif // defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#endif // defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) static std::vector loadBinaryFromFile(std::string path) { std::lock_guard lock(cacheAccessMutex); -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) std::wstring widefilename = multiByteCharToWString(path.c_str()); const wchar_t* filename = widefilename.c_str(); FILE *fp = _wfopen(filename, L"rb"); @@ -101,7 +101,7 @@ static std::vector loadBinaryFromFile(std::string path) { } static void saveBinaryToFile(std::string path, const std::vector buffer) { std::lock_guard lock(cacheAccessMutex); -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) std::wstring widefilename = multiByteCharToWString(path.c_str()); const wchar_t* filename = widefilename.c_str(); #else diff --git a/ngraph/core/include/ngraph/ngraph_visibility.hpp b/ngraph/core/include/ngraph/ngraph_visibility.hpp index caeaa3f3bce..c19bc8f5591 100644 --- a/ngraph/core/include/ngraph/ngraph_visibility.hpp +++ b/ngraph/core/include/ngraph/ngraph_visibility.hpp @@ -6,3 +6,7 @@ #include "openvino/core/core_visibility.hpp" #define NGRAPH_API OPENVINO_API + +#ifdef ENABLE_UNICODE_PATH_SUPPORT +# define OPENVINO_ENABLE_UNICODE_PATH_SUPPORT +#endif diff --git a/ngraph/core/include/ngraph/visibility.hpp b/ngraph/core/include/ngraph/visibility.hpp index af6a1451bf1..45c3aa0e5c9 100644 --- a/ngraph/core/include/ngraph/visibility.hpp +++ b/ngraph/core/include/ngraph/visibility.hpp @@ -4,6 +4,5 @@ #include -#define NGRAPH_HELPER_DLL_IMPORT CORE_HELPER_DLL_IMPORT -#define NGRAPH_HELPER_DLL_EXPORT CORE_HELPER_DLL_EXPORT -#define NGRAPH_HELPER_DLL_LOCAL CORE_HELPER_DLL_LOCAL +#define NGRAPH_HELPER_DLL_IMPORT OPENVINO_CORE_IMPORTS +#define NGRAPH_HELPER_DLL_EXPORT OPENVINO_CORE_EXPORTS diff --git a/ngraph/core/include/openvino/core/core_visibility.hpp b/ngraph/core/include/openvino/core/core_visibility.hpp index 85adf6c1307..82f60293a69 100644 --- a/ngraph/core/include/openvino/core/core_visibility.hpp +++ b/ngraph/core/include/openvino/core/core_visibility.hpp @@ -16,20 +16,11 @@ #ifdef NGRAPH_STATIC_LIBRARY // defined if we are building or calling NGRAPH as a static library # define OPENVINO_API +# define OPENVINO_API #else # ifdef ngraph_EXPORTS // defined if we are building the NGRAPH DLL (instead of using it) -# define OPENVINO_API CORE_HELPER_DLL_EXPORT +# define OPENVINO_API OPENVINO_CORE_EXPORTS # else -# define OPENVINO_API CORE_HELPER_DLL_IMPORT +# define OPENVINO_API OPENVINO_CORE_IMPORTS # endif // ngraph_EXPORTS #endif // NGRAPH_STATIC_LIBRARY - -#ifndef ENABLE_UNICODE_PATH_SUPPORT -# ifdef _WIN32 -# if defined __INTEL_COMPILER || defined _MSC_VER -# define ENABLE_UNICODE_PATH_SUPPORT -# endif -# elif defined(__GNUC__) && (__GNUC__ > 5 || (__GNUC__ == 5 && __GNUC_MINOR__ > 2)) || defined(__clang__) -# define ENABLE_UNICODE_PATH_SUPPORT -# endif -#endif diff --git a/ngraph/core/include/openvino/core/variant.hpp b/ngraph/core/include/openvino/core/variant.hpp index 86595a57eb2..84efc94311b 100644 --- a/ngraph/core/include/openvino/core/variant.hpp +++ b/ngraph/core/include/openvino/core/variant.hpp @@ -85,7 +85,7 @@ inline std::shared_ptr make_variant(const char (&s)[N]) { return std::dynamic_pointer_cast>(std::make_shared>(s)); } -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) template inline std::shared_ptr make_variant(const wchar_t (&s)[N]) { return std::dynamic_pointer_cast>(std::make_shared>(s)); diff --git a/ngraph/core/include/openvino/core/visibility.hpp b/ngraph/core/include/openvino/core/visibility.hpp index 44cd9f4001e..476b0826fdd 100644 --- a/ngraph/core/include/openvino/core/visibility.hpp +++ b/ngraph/core/include/openvino/core/visibility.hpp @@ -4,16 +4,40 @@ // https://gcc.gnu.org/wiki/Visibility // Generic helper definitions for shared library support -#if defined _WIN32 || defined __CYGWIN__ -# define CORE_HELPER_DLL_IMPORT __declspec(dllimport) -# define CORE_HELPER_DLL_EXPORT __declspec(dllexport) -# define CORE_HELPER_DLL_LOCAL -#elif defined(__GNUC__) && __GNUC__ >= 4 -# define CORE_HELPER_DLL_IMPORT __attribute__((visibility("default"))) -# define CORE_HELPER_DLL_EXPORT __attribute__((visibility("default"))) -# define CORE_HELPER_DLL_LOCAL __attribute__((visibility("hidden"))) -#else -# define CORE_HELPER_DLL_IMPORT -# define CORE_HELPER_DLL_EXPORT -# define CORE_HELPER_DLL_LOCAL + +#ifndef OPENVINO_EXTERN_C +# ifdef __cplusplus +# define OPENVINO_EXTERN_C extern "C" +# else +# define OPENVINO_EXTERN_C +# endif +#endif + +#if defined _WIN32 +# define OPENVINO_CDECL __cdecl +# define OPENVINO_STDCALL __stdcall +#else +# define OPENVINO_CDECL +# define OPENVINO_STDCALL +#endif + +#ifndef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT +# ifdef _WIN32 +# if defined __INTEL_COMPILER || defined _MSC_VER +# define OPENVINO_ENABLE_UNICODE_PATH_SUPPORT +# endif +# elif defined(__GNUC__) && (__GNUC__ > 5 || (__GNUC__ == 5 && __GNUC_MINOR__ > 2)) || defined(__clang__) +# define OPENVINO_ENABLE_UNICODE_PATH_SUPPORT +# endif +#endif + +#if defined _WIN32 || defined __CYGWIN__ +# define OPENVINO_CORE_IMPORTS __declspec(dllimport) +# define OPENVINO_CORE_EXPORTS __declspec(dllexport) +#elif defined(__GNUC__) && __GNUC__ >= 4 +# define OPENVINO_CORE_IMPORTS __attribute__((visibility("default"))) +# define OPENVINO_CORE_EXPORTS __attribute__((visibility("default"))) +#else +# define OPENVINO_CORE_IMPORTS +# define OPENVINO_CORE_EXPORTS #endif diff --git a/ngraph/core/src/file_util.cpp b/ngraph/core/src/file_util.cpp index d54db2bd201..14d9a3dc45d 100644 --- a/ngraph/core/src/file_util.cpp +++ b/ngraph/core/src/file_util.cpp @@ -50,7 +50,7 @@ void file_util::convert_path_win_style(std::string& path) { ov::util::convert_path_win_style(path); } -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT std::string file_util::wstring_to_string(const std::wstring& wstr) { return ov::util::wstring_to_string(wstr); @@ -59,4 +59,4 @@ std::string file_util::wstring_to_string(const std::wstring& wstr) { std::wstring file_util::multi_byte_char_to_wstring(const char* str) { return ov::util::string_to_wstring(str); } -#endif // ENABLE_UNICODE_PATH_SUPPORT +#endif // OPENVINO_ENABLE_UNICODE_PATH_SUPPORT diff --git a/ngraph/frontend/frontend_manager/include/frontend_manager/parameters.hpp b/ngraph/frontend/frontend_manager/include/frontend_manager/parameters.hpp index 58b6a58f4c4..21dfbac1257 100644 --- a/ngraph/frontend/frontend_manager/include/frontend_manager/parameters.hpp +++ b/ngraph/frontend/frontend_manager/include/frontend_manager/parameters.hpp @@ -35,7 +35,7 @@ public: VariantWrapper(const value_type& value) : VariantImpl(value) {} }; -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) template <> class FRONTEND_API VariantWrapper : public VariantImpl { public: diff --git a/ngraph/frontend/frontend_manager/src/utils.cpp b/ngraph/frontend/frontend_manager/src/utils.cpp index e21ad514921..c9b87b93c7e 100644 --- a/ngraph/frontend/frontend_manager/src/utils.cpp +++ b/ngraph/frontend/frontend_manager/src/utils.cpp @@ -11,7 +11,7 @@ # include # include # include -# ifdef ENABLE_UNICODE_PATH_SUPPORT +# ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT # include # include # endif diff --git a/ngraph/frontend/ir/src/frontend.cpp b/ngraph/frontend/ir/src/frontend.cpp index d047dbd33c3..a8f80709f9f 100644 --- a/ngraph/frontend/ir/src/frontend.cpp +++ b/ngraph/frontend/ir/src/frontend.cpp @@ -64,7 +64,7 @@ bool FrontEndIR::supported_impl(const std::vector>& var if (ov::is_type>(model_variant)) { const auto& path = ov::as_type_ptr>(model_variant)->get(); local_model_stream.open(path, std::ios::in | std::ifstream::binary); -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) } else if (ov::is_type>(model_variant)) { const auto& path = ov::as_type_ptr>(model_variant)->get(); local_model_stream.open(path, std::ios::in | std::ifstream::binary); @@ -109,7 +109,7 @@ InputModel::Ptr FrontEndIR::load_impl(const std::vector return nullptr; }; -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) std::wstring weights_path, model_path; #else std::string weights_path, model_path; @@ -119,13 +119,13 @@ InputModel::Ptr FrontEndIR::load_impl(const std::vector const auto& model_variant = variants.at(0); if (ov::is_type>(model_variant)) { const auto& tmp_path = ov::as_type_ptr>(model_variant)->get(); -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) model_path = ov::util::string_to_wstring(tmp_path.c_str()); #else model_path = tmp_path; #endif local_model_stream.open(model_path, std::ios::in | std::ifstream::binary); -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) } else if (ov::is_type>(model_variant)) { model_path = ov::as_type_ptr>(model_variant)->get(); local_model_stream.open(model_path, std::ios::in | std::ifstream::binary); @@ -141,12 +141,12 @@ InputModel::Ptr FrontEndIR::load_impl(const std::vector const auto& variant = variants.at(variant_id); if (ov::is_type>(variant)) { const auto& tmp_path = ov::as_type_ptr>(variant)->get(); -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) weights_path = ov::util::string_to_wstring(tmp_path.c_str()); #else weights_path = tmp_path; #endif -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) } else if (ov::is_type>(variant)) { weights_path = ov::as_type_ptr>(variant)->get(); #endif @@ -163,7 +163,7 @@ InputModel::Ptr FrontEndIR::load_impl(const std::vector if (pos != model_path.npos) weights_path = model_path.substr(0, pos); -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) weights_path += L".bin"; #else weights_path += ".bin"; @@ -177,7 +177,7 @@ InputModel::Ptr FrontEndIR::load_impl(const std::vector std::ifstream bin_stream; bin_stream.open(weights_path, std::ios::binary); if (!bin_stream.is_open()) -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) IR_THROW("Weights file " + ov::util::wstring_to_string(weights_path) + " cannot be opened!"); #else IR_THROW("Weights file " + weights_path + " cannot be opened!"); diff --git a/ngraph/frontend/onnx/frontend/src/core/transform.cpp b/ngraph/frontend/onnx/frontend/src/core/transform.cpp index c22157d8452..fa4b5b4b8a5 100644 --- a/ngraph/frontend/onnx/frontend/src/core/transform.cpp +++ b/ngraph/frontend/onnx/frontend/src/core/transform.cpp @@ -107,7 +107,7 @@ void ngraph::onnx_import::transform::update_external_data_paths(ONNX_NAMESPACE:: const auto santized_external_data_relative_path = file_util::sanitize_path(external_data_relative_path); auto external_data_full_path = file_util::path_join(model_dir_path, santized_external_data_relative_path); -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) file_util::convert_path_win_style(external_data_full_path); #endif diff --git a/ngraph/frontend/onnx/frontend/src/editor.cpp b/ngraph/frontend/onnx/frontend/src/editor.cpp index c2741e68f46..f3761ebd42c 100644 --- a/ngraph/frontend/onnx/frontend/src/editor.cpp +++ b/ngraph/frontend/onnx/frontend/src/editor.cpp @@ -198,7 +198,7 @@ struct onnx_editor::ONNXModelEditor::Impl { Impl(std::istream& model_stream) : m_model_proto{std::make_shared(onnx_common::parse_from_istream(model_stream))} {} -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) Impl(const std::wstring& model_path) : m_model_proto{std::make_shared(onnx_common::parse_from_file(model_path))} {} #endif @@ -210,7 +210,7 @@ onnx_editor::ONNXModelEditor::ONNXModelEditor(const std::string& model_path) delete impl; }} {} -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) onnx_editor::ONNXModelEditor::ONNXModelEditor(const std::wstring& model_path) : m_model_path{file_util::wstring_to_string(model_path)}, m_pimpl{new ONNXModelEditor::Impl{model_path}, [](Impl* impl) { diff --git a/ngraph/frontend/onnx/frontend/src/editor.hpp b/ngraph/frontend/onnx/frontend/src/editor.hpp index bfda345efe3..a1ba6bf810e 100644 --- a/ngraph/frontend/onnx/frontend/src/editor.hpp +++ b/ngraph/frontend/onnx/frontend/src/editor.hpp @@ -31,7 +31,7 @@ public: /// /// \param model_path Path to the file containing the model. ONNXModelEditor(const std::string& model_path); -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) ONNXModelEditor(const std::wstring& model_path); #endif diff --git a/ngraph/frontend/onnx/frontend/src/frontend.cpp b/ngraph/frontend/onnx/frontend/src/frontend.cpp index 0a8136db8a6..801d4c29cff 100644 --- a/ngraph/frontend/onnx/frontend/src/frontend.cpp +++ b/ngraph/frontend/onnx/frontend/src/frontend.cpp @@ -41,7 +41,7 @@ InputModel::Ptr FrontEndONNX::load_impl(const std::vector(variants[0])->get(); return std::make_shared(path); } -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) if (ov::is_type(variants[0])) { const auto path = ov::as_type_ptr(variants[0])->get(); return std::make_shared(path); @@ -53,7 +53,7 @@ InputModel::Ptr FrontEndONNX::load_impl(const std::vector(variants[1])->get(); return std::make_shared(*stream, path); } -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) if (variants.size() > 1 && ov::is_type(variants[1])) { const auto path = ov::as_type_ptr(variants[1])->get(); return std::make_shared(*stream, path); @@ -115,7 +115,7 @@ bool FrontEndONNX::supported_impl(const std::vector>& v const auto path = ov::as_type_ptr(variants[0])->get(); model_stream.open(path, std::ios::in | std::ifstream::binary); } -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) else if (ov::is_type(variants[0])) { const auto path = ov::as_type_ptr(variants[0])->get(); model_stream.open(path, std::ios::in | std::ifstream::binary); diff --git a/ngraph/frontend/onnx/frontend/src/input_model.cpp b/ngraph/frontend/onnx/frontend/src/input_model.cpp index 1e46766b35d..a793b70ef16 100644 --- a/ngraph/frontend/onnx/frontend/src/input_model.cpp +++ b/ngraph/frontend/onnx/frontend/src/input_model.cpp @@ -17,7 +17,7 @@ NGRAPH_SUPPRESS_DEPRECATED_START InputModelONNX::InputModelONNX(const std::string& path) : m_editor{std::make_shared(path)} {} -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) InputModelONNX::InputModelONNX(const std::wstring& path) : m_editor{std::make_shared(path)} {} #endif diff --git a/ngraph/frontend/onnx/frontend/src/input_model.hpp b/ngraph/frontend/onnx/frontend/src/input_model.hpp index ae838f5b5e3..c36d9ddf415 100644 --- a/ngraph/frontend/onnx/frontend/src/input_model.hpp +++ b/ngraph/frontend/onnx/frontend/src/input_model.hpp @@ -13,7 +13,7 @@ namespace frontend { class InputModelONNX : public InputModel { public: InputModelONNX(const std::string& path); -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) InputModelONNX(const std::wstring& path); #endif InputModelONNX(std::istream& model_stream); diff --git a/ngraph/frontend/onnx/frontend/src/utils/tensor_external_data.cpp b/ngraph/frontend/onnx/frontend/src/utils/tensor_external_data.cpp index 71f51ff1e2e..19343d8bbb7 100644 --- a/ngraph/frontend/onnx/frontend/src/utils/tensor_external_data.cpp +++ b/ngraph/frontend/onnx/frontend/src/utils/tensor_external_data.cpp @@ -30,7 +30,7 @@ TensorExternalData::TensorExternalData(const ONNX_NAMESPACE::TensorProto& tensor std::string TensorExternalData::load_external_data() const { NGRAPH_SUPPRESS_DEPRECATED_START -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) std::wstring path = ov::util::string_to_wstring(m_data_location); #else std::string path = m_data_location; diff --git a/ngraph/frontend/onnx/onnx_common/include/onnx_common/parser.hpp b/ngraph/frontend/onnx/onnx_common/include/onnx_common/parser.hpp index 7310f150c5b..1e98ce21702 100644 --- a/ngraph/frontend/onnx/onnx_common/include/onnx_common/parser.hpp +++ b/ngraph/frontend/onnx/onnx_common/include/onnx_common/parser.hpp @@ -18,7 +18,7 @@ namespace onnx_common { /// /// \return The parsed in-memory representation of the ONNX model ONNX_NAMESPACE::ModelProto parse_from_file(const std::string& file_path); -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) ONNX_NAMESPACE::ModelProto parse_from_file(const std::wstring& file_path); #endif diff --git a/ngraph/frontend/onnx/onnx_common/src/parser.cpp b/ngraph/frontend/onnx/onnx_common/src/parser.cpp index 3cb7f17ebd1..430c569d399 100644 --- a/ngraph/frontend/onnx/onnx_common/src/parser.cpp +++ b/ngraph/frontend/onnx/onnx_common/src/parser.cpp @@ -26,7 +26,7 @@ ONNX_NAMESPACE::ModelProto parse_from_file(const std::string& file_path) { return model_proto; } -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) ONNX_NAMESPACE::ModelProto parse_from_file(const std::wstring& file_path) { std::ifstream file_stream{file_path, std::ios::in | std::ios::binary}; diff --git a/ngraph/frontend/paddlepaddle/include/paddlepaddle_frontend/model.hpp b/ngraph/frontend/paddlepaddle/include/paddlepaddle_frontend/model.hpp index 8fd431ecbd4..83f63e38751 100644 --- a/ngraph/frontend/paddlepaddle/include/paddlepaddle_frontend/model.hpp +++ b/ngraph/frontend/paddlepaddle/include/paddlepaddle_frontend/model.hpp @@ -22,7 +22,7 @@ class PDPD_API InputModelPDPD : public InputModel { public: explicit InputModelPDPD(const std::string& path); -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) explicit InputModelPDPD(const std::wstring& path); #endif explicit InputModelPDPD(const std::vector& streams); diff --git a/ngraph/frontend/paddlepaddle/src/frontend.cpp b/ngraph/frontend/paddlepaddle/src/frontend.cpp index 08e9d2c7adf..157908b47f8 100644 --- a/ngraph/frontend/paddlepaddle/src/frontend.cpp +++ b/ngraph/frontend/paddlepaddle/src/frontend.cpp @@ -122,7 +122,7 @@ std::istream* variant_to_stream_ptr(const std::shared_ptr& variant, std const auto& model_path = ov::as_type_ptr>(variant)->get(); ext_stream.open(model_path, std::ios::in | std::ifstream::binary); } -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) else if (ov::is_type>(variant)) { const auto& model_path = ov::as_type_ptr>(variant)->get(); ext_stream.open(model_path, std::ios::in | std::ifstream::binary); @@ -219,7 +219,7 @@ bool FrontEndPDPD::supported_impl(const std::vector>& v // but it will complicate the check, while it should be as quick as possible return model_str && model_str.is_open(); } -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) else if (ov::is_type>(variants[0])) { std::wstring suffix = L".pdmodel"; std::wstring model_path = ov::as_type_ptr>(variants[0])->get(); @@ -248,7 +248,7 @@ InputModel::Ptr FrontEndPDPD::load_impl(const std::vector>(variants[0])->get(); return std::make_shared(m_path); } -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) else if (ov::is_type>(variants[0])) { std::wstring m_path = ov::as_type_ptr>(variants[0])->get(); return std::make_shared(m_path); diff --git a/ngraph/frontend/paddlepaddle/src/model.cpp b/ngraph/frontend/paddlepaddle/src/model.cpp index 4ba7aaa7888..d811681fd6f 100644 --- a/ngraph/frontend/paddlepaddle/src/model.cpp +++ b/ngraph/frontend/paddlepaddle/src/model.cpp @@ -14,7 +14,7 @@ #include "node_context.hpp" #include "pdpd_utils.hpp" -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) # include # include #endif @@ -148,7 +148,7 @@ std::basic_string get_const_path(const std::basic_string& folder_with_weig return folder_with_weights + pdpd::get_path_sep() + name; } -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) template <> std::basic_string get_const_path(const std::basic_string& folder, const std::string& name) { std::wstring_convert> converter; @@ -174,7 +174,7 @@ std::basic_string get_model_path(const std::basic_string& path, std::ifstr return model_file; } -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) template <> std::basic_string get_model_path(const std::basic_string& path, std::ifstream* weights_stream) { std::wstring model_file{path}; @@ -403,7 +403,7 @@ void InputModelPDPD::InputModelPDPDImpl::setTensorValue(Place::Ptr place, const InputModelPDPD::InputModelPDPD(const std::string& path) : _impl{std::make_shared(path, *this)} {} -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) InputModelPDPD::InputModelPDPD(const std::wstring& path) : _impl{std::make_shared(path, *this)} {} #endif diff --git a/ngraph/frontend/paddlepaddle/src/pdpd_utils.hpp b/ngraph/frontend/paddlepaddle/src/pdpd_utils.hpp index cdbc630668e..7133f96fa7a 100644 --- a/ngraph/frontend/paddlepaddle/src/pdpd_utils.hpp +++ b/ngraph/frontend/paddlepaddle/src/pdpd_utils.hpp @@ -11,7 +11,7 @@ namespace frontend { namespace pdpd { #ifdef _WIN32 const char PATH_SEPARATOR = '\\'; -# if defined(ENABLE_UNICODE_PATH_SUPPORT) +# if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) const wchar_t WPATH_SEPARATOR = L'\\'; # endif #else @@ -23,7 +23,7 @@ inline std::basic_string get_path_sep() { return std::basic_string{PATH_SEPARATOR}; } -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) template <> inline std::basic_string get_path_sep() { return std::basic_string{WPATH_SEPARATOR}; diff --git a/openvino/util/include/openvino/util/file_util.hpp b/openvino/util/include/openvino/util/file_util.hpp index f8d2014cba9..ee0f62a261a 100644 --- a/openvino/util/include/openvino/util/file_util.hpp +++ b/openvino/util/include/openvino/util/file_util.hpp @@ -9,13 +9,13 @@ #include #include -#ifndef ENABLE_UNICODE_PATH_SUPPORT +#ifndef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT # ifdef _WIN32 # if defined __INTEL_COMPILER || defined _MSC_VER -# define ENABLE_UNICODE_PATH_SUPPORT +# define OPENVINO_ENABLE_UNICODE_PATH_SUPPORT # endif # elif defined(__GNUC__) && (__GNUC__ > 5 || (__GNUC__ == 5 && __GNUC_MINOR__ > 2)) || defined(__clang__) -# define ENABLE_UNICODE_PATH_SUPPORT +# define OPENVINO_ENABLE_UNICODE_PATH_SUPPORT # endif #endif @@ -76,7 +76,7 @@ struct FileTraits { } }; -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT /** * @brief Conversion from wide character string to a single-byte chain. * @param wstr A wide-char string @@ -128,7 +128,7 @@ bool directory_exists(const std::string& path); * @return file size */ inline uint64_t file_size(const char* path) { -#if defined(ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) +#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32) std::wstring widefilename = ov::util::string_to_wstring(path); const wchar_t* file_name = widefilename.c_str(); #elif defined(__ANDROID__) || defined(ANDROID) @@ -144,7 +144,7 @@ inline uint64_t file_size(const char* path) { return in.tellg(); } -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT /** * @brief Returns file size for file @@ -155,7 +155,7 @@ inline uint64_t file_size(const std::wstring& path) { return file_size(wstring_to_string(path).c_str()); } -#endif // ENABLE_UNICODE_PATH_SUPPORT +#endif // OPENVINO_ENABLE_UNICODE_PATH_SUPPORT /** * @brief Returns file size for file @@ -190,7 +190,7 @@ void convert_path_win_style(std::string& path); std::string get_ov_lib_path(); -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT using FilePath = std::wstring; @@ -214,9 +214,9 @@ inline FilePath to_file_path(const std::string& path) { return path; } -#endif // ENABLE_UNICODE_PATH_SUPPORT +#endif // OPENVINO_ENABLE_UNICODE_PATH_SUPPORT -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT /** * @brief Returns a unicode path to openvino libraries @@ -234,7 +234,7 @@ inline std::string get_ov_library_path() { return get_ov_lib_path(); } -#endif // ENABLE_UNICODE_PATH_SUPPORT +#endif // OPENVINO_ENABLE_UNICODE_PATH_SUPPORT template ::value || std::is_same::value)>::type> diff --git a/openvino/util/src/file_util.cpp b/openvino/util/src/file_util.cpp index f3b1653d0a2..9b0bf1a553f 100644 --- a/openvino/util/src/file_util.cpp +++ b/openvino/util/src/file_util.cpp @@ -37,7 +37,7 @@ # include # include -# ifdef ENABLE_UNICODE_PATH_SUPPORT +# ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT # include # include # endif @@ -229,7 +229,7 @@ void ov::util::convert_path_win_style(std::string& path) { std::replace(path.begin(), path.end(), '/', '\\'); } -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT std::string ov::util::wstring_to_string(const std::wstring& wstr) { # ifdef _WIN32 int size_needed = WideCharToMultiByte(CP_UTF8, 0, &wstr[0], (int)wstr.size(), NULL, 0, NULL, NULL); @@ -340,14 +340,14 @@ static std::string get_ov_library_path_a() { } // namespace std::string ov::util::get_ov_lib_path() { -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT return ov::util::wstring_to_string(ov::util::get_ov_lib_path_w()); #else return get_ov_library_path_a(); #endif } -#ifdef ENABLE_UNICODE_PATH_SUPPORT +#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT std::wstring ov::util::get_ov_lib_path_w() { # ifdef _WIN32 @@ -369,4 +369,4 @@ std::wstring ov::util::get_ov_lib_path_w() { # endif } -#endif // ENABLE_UNICODE_PATH_SUPPORT +#endif // OPENVINO_ENABLE_UNICODE_PATH_SUPPORT