forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ie_api.h
138 lines (125 loc) · 5.95 KB
/
ie_api.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
// Copyright (C) 2018-2023 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
/**
* @brief The macro defines a symbol import/export mechanism essential for Microsoft Windows(R) OS.
* @file ie_api.h
*/
#pragma once
#if !defined(IN_OV_COMPONENT) && !defined(IE_LEGACY_HEADER_INCLUDED)
# define IE_LEGACY_HEADER_INCLUDED
# ifdef _MSC_VER
# pragma message( \
"The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html")
# else
# warning("The Inference Engine API is deprecated and will be removed in the 2024.0 release. For instructions on transitioning to the new API, please refer to https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html")
# endif
#endif
#if defined(OPENVINO_STATIC_LIBRARY) || defined(USE_STATIC_IE) || (defined(__GNUC__) && (__GNUC__ < 4))
# define INFERENCE_ENGINE_API(...) extern "C" __VA_ARGS__
# define INFERENCE_ENGINE_API_CPP(...) __VA_ARGS__
# define INFERENCE_ENGINE_API_CLASS(...) __VA_ARGS__
#else
# if defined(_WIN32) || defined(__CYGWIN__)
# 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__
# 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__
# define INFERENCE_ENGINE_API_CLASS(...) __declspec(dllimport) __VA_ARGS__
# endif
# else
# 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__
# endif
#endif
#if defined(__GNUC__)
# define INFERENCE_ENGINE_DEPRECATED(msg) __attribute__((deprecated(msg)))
# if __GNUC__ >= 6 || defined(__clang__)
# define INFERENCE_ENGINE_ENUM_DEPRECATED(msg) INFERENCE_ENGINE_DEPRECATED(msg)
# else
# define INFERENCE_ENGINE_ENUM_DEPRECATED(msg)
# endif
#elif defined(_MSC_VER)
# define INFERENCE_ENGINE_DEPRECATED(msg) __declspec(deprecated(msg))
# if _MSC_VER >= 1900 /* VS2015 */
# define INFERENCE_ENGINE_ENUM_DEPRECATED(msg) [[deprecated(msg)]]
# else
# define INFERENCE_ENGINE_ENUM_DEPRECATED(msg)
# endif
#elif defined(__INTEL_COMPILER)
# define INFERENCE_ENGINE_DEPRECATED(msg) __attribute__((deprecated(msg)))
# define INFERENCE_ENGINE_ENUM_DEPRECATED(msg) INFERENCE_ENGINE_DEPRECATED(msg)
#else
# define INFERENCE_ENGINE_DEPRECATED(msg)
# define INFERENCE_ENGINE_ENUM_DEPRECATED(msg)
#endif
#define INFERENCE_ENGINE_1_0_DEPRECATED \
INFERENCE_ENGINE_DEPRECATED("The Inference Engine API is deprecated and will be removed in the 2024.0 release. " \
"For instructions on transitioning to the new API, please refer to " \
"https://docs.openvino.ai/latest/openvino_2_0_transition_guide.html")
// Suppress warning "-Wdeprecated-declarations" / C4996
#if defined(__GNUC__)
# define IE_DO_PRAGMA(x) _Pragma(# x)
#elif defined(_MSC_VER)
# define IE_DO_PRAGMA(x) __pragma(x)
#else
# define IE_DO_PRAGMA(x)
#endif
#if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ > 405)) || defined(__clang__)
# define IE_SUPPRESS_DEPRECATED_START \
IE_DO_PRAGMA(GCC diagnostic push) \
IE_DO_PRAGMA(GCC diagnostic ignored "-Wdeprecated-declarations")
# define IE_SUPPRESS_DEPRECATED_END IE_DO_PRAGMA(GCC diagnostic pop)
#elif defined(_MSC_VER)
# define IE_SUPPRESS_DEPRECATED_START \
IE_DO_PRAGMA(warning(push)) \
IE_DO_PRAGMA(warning(disable : 4996))
# define IE_SUPPRESS_DEPRECATED_END IE_DO_PRAGMA(warning(pop))
#elif defined(__INTEL_COMPILER)
# define IE_SUPPRESS_DEPRECATED_START \
IE_DO_PRAGMA(warning(push)) \
IE_DO_PRAGMA(warning(disable : 1478)) \
IE_DO_PRAGMA(warning(disable : 1786))
# define IE_SUPPRESS_DEPRECATED_END IE_DO_PRAGMA(warning(pop))
#else
# define IE_SUPPRESS_DEPRECATED_START
# define IE_SUPPRESS_DEPRECATED_END
#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
# define _IE_SUPPRESS_DEPRECATED_END_GCC IE_SUPPRESS_DEPRECATED_END
#else
# define _IE_SUPPRESS_DEPRECATED_START_GCC
# define _IE_SUPPRESS_DEPRECATED_END_GCC
#endif
#ifndef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT
# ifdef _WIN32
# if defined(__INTEL_COMPILER) || defined(_MSC_VER) || defined(__GNUC__)
# define OPENVINO_ENABLE_UNICODE_PATH_SUPPORT
# endif
# elif defined(__clang__)
# define OPENVINO_ENABLE_UNICODE_PATH_SUPPORT
# elif defined(__GNUC__) && (__GNUC__ > 5 || (__GNUC__ == 5 && __GNUC_MINOR__ > 2))
# define OPENVINO_ENABLE_UNICODE_PATH_SUPPORT
# endif
#endif
#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT
# ifndef ENABLE_UNICODE_PATH_SUPPORT
# define ENABLE_UNICODE_PATH_SUPPORT
# endif
#endif
/**
* @def INFERENCE_PLUGIN_API(type)
* @brief Defines Inference Engine Plugin API method
* @param type A plugin type
*/
#if (defined(_WIN32) || defined(__CYGWIN__)) && defined(IMPLEMENT_INFERENCE_ENGINE_PLUGIN)
# define INFERENCE_PLUGIN_API(type) extern "C" __declspec(dllexport) type
#else
# define INFERENCE_PLUGIN_API(type) INFERENCE_ENGINE_API(type)
#endif