69d04f1ed769771839ff9b4211c9fd5af04b7def
[platform/upstream/dldt.git] / inference-engine / include / vpu / vpu_plugin_config.hpp
1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4
5 /**
6  * @brief A header that defines advanced related properties for VPU plugins.
7  * These properties should be used in SetConfig() and LoadNetwork() methods of plugins
8  *
9  * @file vpu_plugin_config.hpp
10  */
11
12 #pragma once
13
14 #include <string>
15
16 #include "ie_plugin_config.hpp"
17 #include "myriad_plugin_config.hpp"
18 #include "ie_api.h"
19
20 //
21 // Common options
22 //
23
24 #define VPU_CONFIG_KEY(name) InferenceEngine::VPUConfigParams::_CONFIG_KEY(VPU_##name)
25 #define VPU_CONFIG_VALUE(name) InferenceEngine::VPUConfigParams::VPU_##name
26
27 #define DECLARE_VPU_CONFIG_KEY(name) DECLARE_CONFIG_KEY(VPU_##name)
28 #define DECLARE_VPU_CONFIG_VALUE(name) DECLARE_CONFIG_VALUE(VPU_##name)
29
30 //
31 // Common metrics
32 //
33
34 #define VPU_METRIC(name) METRIC_KEY(VPU_##name)
35 #define DECLARE_VPU_METRIC(name, ...)  DECLARE_METRIC_KEY(VPU_##name, __VA_ARGS__)
36
37 namespace InferenceEngine {
38
39 namespace VPUConfigParams {
40
41 //
42 // Common options
43 //
44
45 /**
46  * @brief Turn on HW stages usage (applicable for MyriadX devices only).
47  * This option should be used with values: CONFIG_VALUE(YES) or CONFIG_VALUE(NO) (default)
48  */
49 DECLARE_VPU_CONFIG_KEY(HW_STAGES_OPTIMIZATION);
50
51 /**
52  * @brief The key to specify desirable log level for devices.
53  * This option should be used with values: CONFIG_VALUE(LOG_NONE) (default),
54  * CONFIG_VALUE(LOG_WARNING), CONFIG_VALUE(LOG_INFO), CONFIG_VALUE(LOG_DEBUG)
55  */
56 DECLARE_VPU_CONFIG_KEY(LOG_LEVEL);
57
58 /**
59  * @deprecated
60  * @brief The key to define normalization coefficient for the network input.
61  * This option should used with be a real number. Example "255.f"
62  */
63 INFERENCE_ENGINE_DEPRECATED
64 DECLARE_VPU_CONFIG_KEY(INPUT_NORM);
65
66 /**
67  * @deprecated
68  * @brief The flag to specify Bias value that is added to each element of the network input.
69  * This option should used with be a real number. Example "0.1f"
70  */
71 INFERENCE_ENGINE_DEPRECATED
72 DECLARE_VPU_CONFIG_KEY(INPUT_BIAS);
73
74 /**
75  * @brief The flag for adding to the profiling information the time of obtaining a tensor.
76  * This option should be used with values: CONFIG_VALUE(YES) or CONFIG_VALUE(NO) (default)
77  */
78 DECLARE_VPU_CONFIG_KEY(PRINT_RECEIVE_TENSOR_TIME);
79
80 /**
81  * @brief This option allows to pass extra configuration for executable network.
82  * By default, it is empty string, which means - no configuration.
83  * String format:
84  * <key>=<value>,<key>=<value>,...
85  * Supported parameters and options:
86  *   * file : path to XML file with configuration
87  *   * data : options related to data objects (input, output, intermediate), next parameter describes the option
88  *     * scale : SCALE factor for data range (applicable for input and intermediate data)
89  */
90 DECLARE_VPU_CONFIG_KEY(NETWORK_CONFIG);
91
92 /**
93  * @brief This option allows to to specify input output layouts for network layers.
94  * By default, this value set to VPU_CONFIG_VALUE(AUTO) value.
95  * Supported values:
96  *   VPU_CONFIG_VALUE(AUTO) executable network configured to use optimal layer layout depending on available HW
97  *   VPU_CONFIG_VALUE(NCHW) executable network forced to use NCHW input/output layouts
98  *   VPU_CONFIG_VALUE(NHWC) executable network forced to use NHWC input/output layouts
99  */
100 DECLARE_VPU_CONFIG_KEY(COMPUTE_LAYOUT);
101
102 /**
103  * @brief Supported keys definition for VPU_CONFIG_KEY(COMPUTE_LAYOUT) option.
104  */
105 DECLARE_VPU_CONFIG_VALUE(AUTO);
106 DECLARE_VPU_CONFIG_VALUE(NCHW);
107 DECLARE_VPU_CONFIG_VALUE(NHWC);
108
109 /**
110  * @brief This option allows to pass custom layers binding xml.
111  * If layer is present in such an xml, it would be used during inference even if the layer is natively supported
112  */
113 DECLARE_VPU_CONFIG_KEY(CUSTOM_LAYERS);
114
115 /**
116  * @brief Ignore statistic in IR by plugin.
117  * Plugin could use statistic present in IR in order to try to improve calculations precision.
118  * If you don't want statistic to be used enable this option.
119  * This option should be used with values: CONFIG_VALUE(YES) or CONFIG_VALUE(NO) (default)
120  */
121 DECLARE_VPU_CONFIG_KEY(IGNORE_IR_STATISTIC);
122
123 /**
124  * @brief This option allows to specify protocol.
125  */
126 DECLARE_VPU_MYRIAD_CONFIG_KEY(PROTOCOL);
127
128 /**
129  * @brief Supported keys definition for VPU_MYRIAD_CONFIG_KEY(PROTOCOL) option.
130  */
131 DECLARE_VPU_MYRIAD_CONFIG_VALUE(PCIE);
132 DECLARE_VPU_MYRIAD_CONFIG_VALUE(USB);
133
134 /**
135  * @deprecated Use VPU_MYRIAD_CONFIG_KEY(FORCE_RESET) instead.
136  */
137 INFERENCE_ENGINE_DEPRECATED
138 DECLARE_VPU_CONFIG_KEY(FORCE_RESET);
139
140 /**
141  * @deprecated Use VPU_MYRIAD_CONFIG_KEY(PLATFORM) instead.
142  */
143 INFERENCE_ENGINE_DEPRECATED
144 DECLARE_VPU_CONFIG_KEY(PLATFORM);
145
146 /**
147  * @brief Supported keys definition for DECLARE_VPU_CONFIG_KEY(PLATFORM) option.
148  */
149 INFERENCE_ENGINE_DEPRECATED
150 DECLARE_VPU_CONFIG_VALUE(2450);
151 INFERENCE_ENGINE_DEPRECATED
152 DECLARE_VPU_CONFIG_VALUE(2480);
153
154 }  // namespace VPUConfigParams
155
156 }  // namespace InferenceEngine