ie_c_api.h
Go to the documentation of this file.
1 // Copyright (C) 2018-2020 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 /**
6  * @file ie_c_api.h
7  * C API of Inference Engine bridge unlocks using of OpenVINO Inference Engine
8  * library and all its plugins in native applications disabling usage
9  * of C++ API. The scope of API covers significant part of C++ API and includes
10  * an ability to read model from the disk, modify input and output information
11  * to correspond their runtime representation like data types or memory layout,
12  * load in-memory model to Inference Engine on different devices including
13  * heterogeneous and multi-device modes, manage memory where input and output
14  * is allocated and manage inference flow.
15 **/
16 
17 #ifndef IE_C_API_H
18 #define IE_C_API_H
19 
20 #include <stdint.h>
21 #include <stdio.h>
22 
23 #ifdef __cplusplus
24  #define INFERENCE_ENGINE_C_API_EXTERN extern "C"
25 #else
26  #define INFERENCE_ENGINE_C_API_EXTERN
27 #endif
28 
29 #if defined(__GNUC__) && (__GNUC__ < 4)
30  #define INFERENCE_ENGINE_C_API(...) INFERENCE_ENGINE_C_API_EXTERN __VA_ARGS__
31  #define IE_NODISCARD
32 #else
33  #if defined(_WIN32)
34  #define INFERENCE_ENGINE_C_API_CALLBACK __cdecl
35  #ifdef inference_engine_c_api_EXPORTS
36  #define INFERENCE_ENGINE_C_API(...) INFERENCE_ENGINE_C_API_EXTERN __declspec(dllexport) __VA_ARGS__ __cdecl
37  #else
38  #define INFERENCE_ENGINE_C_API(...) INFERENCE_ENGINE_C_API_EXTERN __declspec(dllimport) __VA_ARGS__ __cdecl
39  #endif
40  #define IE_NODISCARD
41  #else
42  #define INFERENCE_ENGINE_C_API(...) INFERENCE_ENGINE_C_API_EXTERN __attribute__((visibility("default"))) __VA_ARGS__
43  #define IE_NODISCARD __attribute__((warn_unused_result))
44  #endif
45 #endif
46 
47 #ifndef INFERENCE_ENGINE_C_API_CALLBACK
48  #define INFERENCE_ENGINE_C_API_CALLBACK
49 #endif
50 
51 typedef struct ie_core ie_core_t;
52 typedef struct ie_network ie_network_t;
53 typedef struct ie_executable ie_executable_network_t;
54 typedef struct ie_infer_request ie_infer_request_t;
55 typedef struct ie_blob ie_blob_t;
56 
57 /**
58  * @struct ie_version
59  * @brief Represents an API version information that reflects the set of supported features
60  */
61 typedef struct ie_version {
62  char *api_version; //!< A string representing Inference Engine version
63 } ie_version_t;
64 
65 /**
66  * @struct ie_core_version
67  * @brief Represents version information that describes devices and the inference engine runtime library
68  */
69 typedef struct ie_core_version {
70  size_t major; //!< A major version
71  size_t minor; //!< A minor version
72  const char *device_name; //!< A device name
73  const char *build_number; //!< A build number
74  const char *description; //!< A device description
76 
77 /**
78  * @struct ie_core_versions
79  * @brief Represents all versions information that describes all devices and the inference engine runtime library
80  */
81 typedef struct ie_core_versions {
82  ie_core_version_t *versions; //!< An array of device versions
83  size_t num_vers; //!< A number of versions in the array
85 
86 /**
87  * @struct ie_config
88  * @brief Represents configuration information that describes devices
89  */
90 typedef struct ie_config {
91  const char *name; //!< A configuration key
92  const char *value; //!< A configuration value
93  struct ie_config *next; //!< A pointer to the next configuration value
94 } ie_config_t;
95 
96 /**
97  * @struct ie_param
98  * @brief metric and config parameters.
99  */
100 typedef struct ie_param {
101  union {
102  char *params;
103  unsigned int number;
104  unsigned int range_for_async_infer_request[3];
105  unsigned int range_for_streams[2];
106  };
107 } ie_param_t;
108 
109 /**
110  * @struct ie_param_config
111  * @brief Represents configuration parameter information
112  */
113 typedef struct ie_param_config {
114  char *name;
115  ie_param_t *param;
117 
118 /**
119  * @struct desc
120  * @brief Represents detailed information for an error
121  */
122 typedef struct desc {
123  char msg[256]; //!< A description message
124 } desc_t;
125 
126 /**
127  * @struct dimensions
128  * @brief Represents dimensions for input or output data
129  */
130 typedef struct dimensions {
131  size_t ranks; //!< A runk representing a number of dimensions
132  size_t dims[8]; //!< An array of dimensions
133 } dimensions_t;
134 
135 /**
136  * @enum layout_e
137  * @brief Layouts that the inference engine supports
138  */
139 typedef enum {
140  ANY = 0, //!< "ANY" layout
141 
142  // I/O data layouts
143  NCHW = 1, //!< "NCHW" layout
144  NHWC = 2, //!< "NHWC" layout
145  NCDHW = 3, //!< "NCDHW" layout
146  NDHWC = 4, //!< "NDHWC" layout
147 
148  // weight layouts
149  OIHW = 64, //!< "OIHW" layout
150 
151  // Scalar
152  SCALAR = 95, //!< "SCALAR" layout
153 
154  // bias layouts
155  C = 96, //!< "C" layout
156 
157  // Single image layout (for mean image)
158  CHW = 128, //!< "CHW" layout
159 
160  // 2D
161  HW = 192, //!< "HW" layout
162  NC = 193, //!< "NC" layout
163  CN = 194, //!< "CN" layout
164 
165  BLOCKED = 200, //!< "BLOCKED" layout
166 } layout_e;
167 
168 /**
169  * @enum precision_e
170  * @brief Precisions that the inference engine supports
171  */
172 typedef enum {
173  UNSPECIFIED = 255, /**< Unspecified value. Used by default */
174  MIXED = 0, /**< Mixed value. Can be received from network. No applicable for tensors */
175  FP32 = 10, /**< 32bit floating point value */
176  FP16 = 11, /**< 16bit floating point value */
177  FP64 = 13, /**< 64bit floating point value */
178  Q78 = 20, /**< 16bit specific signed fixed point precision */
179  I16 = 30, /**< 16bit signed integer value */
180  U8 = 40, /**< 8bit unsigned integer value */
181  I8 = 50, /**< 8bit signed integer value */
182  U16 = 60, /**< 16bit unsigned integer value */
183  I32 = 70, /**< 32bit signed integer value */
184  I64 = 72, /**< 64bit signed integer value */
185  U64 = 73, /**< 64bit unsigned integer value */
186  U32 = 74, /**< 32bit unsigned integer value */
187  BIN = 71, /**< 1bit integer value */
188  CUSTOM = 80 /**< custom precision has it's own name and size of elements */
190 
191 /**
192  * @struct tensor_desc
193  * @brief Represents detailed information for a tensor
194  */
195 typedef struct tensor_desc {
196  layout_e layout;
197  dimensions_t dims;
198  precision_e precision;
199 } tensor_desc_t;
200 
201 /**
202  * @enum colorformat_e
203  * @brief Extra information about input color format for preprocessing
204  */
205 typedef enum {
206  RAW = 0u, //!< Plain blob (default), no extra color processing required
207  RGB, //!< RGB color format
208  BGR, //!< BGR color format, default in DLDT
209  RGBX, //!< RGBX color format with X ignored during inference
210  BGRX, //!< BGRX color format with X ignored during inference
211  NV12, //!< NV12 color format represented as compound Y+UV blob
212  I420, //!< I420 color format represented as compound Y+U+V blob
213 } colorformat_e;
214 
215 /**
216  * @enum resize_alg_e
217  * @brief Represents the list of supported resize algorithms.
218  */
219 typedef enum {
220  NO_RESIZE = 0, //!< "No resize" mode
221  RESIZE_BILINEAR, //!< "Bilinear resize" mode
222  RESIZE_AREA //!< "Area resize" mode
224 
225 /**
226  * @enum IEStatusCode
227  * @brief This enum contains codes for all possible return values of the interface functions
228  */
229 typedef enum {
230  OK = 0,
231  GENERAL_ERROR = -1,
232  NOT_IMPLEMENTED = -2,
233  NETWORK_NOT_LOADED = -3,
234  PARAMETER_MISMATCH = -4,
235  NOT_FOUND = -5,
236  OUT_OF_BOUNDS = -6,
237  /*
238  * @brief exception not of std::exception derived type was thrown
239  */
240  UNEXPECTED = -7,
241  REQUEST_BUSY = -8,
242  RESULT_NOT_READY = -9,
243  NOT_ALLOCATED = -10,
244  INFER_NOT_STARTED = -11,
245  NETWORK_NOT_READ = -12
246 } IEStatusCode;
247 
248 /**
249  * @struct roi_t
250  * @brief This structure describes roi data.
251  */
252 typedef struct roi {
253  size_t id; //!< ID of a roi
254  size_t posX; //!< W upper left coordinate of roi
255  size_t posY; //!< H upper left coordinate of roi
256  size_t sizeX; //!< W size of roi
257  size_t sizeY; //!< H size of roi
258 } roi_t;
259 
260 /**
261  * @struct input_shape
262  * @brief Represents shape for input data
263  */
264 typedef struct input_shape {
265  char *name;
266  dimensions_t shape;
267 } input_shape_t;
268 
269 /**
270  * @struct input_shapes
271  * @brief Represents shapes for all input data
272  */
273 typedef struct input_shapes {
274  input_shape_t *shapes;
275  size_t shape_num;
277 
278 /**
279  * @struct ie_blob_buffer
280  * @brief Represents copied data from the given blob.
281  */
282 typedef struct ie_blob_buffer {
283  union {
284  void *buffer; //!< buffer can be written
285  const void *cbuffer; //!< cbuffer is read-only
286  };
288 
289 /**
290  * @struct ie_complete_call_back
291  * @brief Completion callback definition about the function and args
292  */
293 typedef struct ie_complete_call_back {
294  void (INFERENCE_ENGINE_C_API_CALLBACK *completeCallBackFunc)(void *args);
295  void *args;
297 
298 /**
299  * @struct ie_available_devices
300  * @brief Represent all available devices.
301  */
302 typedef struct ie_available_devices {
303  char **devices;
304  size_t num_devices;
306 
307 /**
308  * @brief Returns number of version that is exported. Use the ie_version_free() to free memory.
309  * @return Version number of the API.
310  */
311 INFERENCE_ENGINE_C_API(ie_version_t) ie_c_api_version(void);
312 
313 /**
314  * @brief Release the memory allocated by ie_c_api_version.
315  * @param version A pointer to the ie_version_t to free memory.
316  */
317 INFERENCE_ENGINE_C_API(void) ie_version_free(ie_version_t *version);
318 
319 /**
320  * @brief Release the memory allocated by ie_param_t.
321  * @param param A pointer to the ie_param_t to free memory.
322  */
323 INFERENCE_ENGINE_C_API(void) ie_param_free(ie_param_t *param);
324 
325 // Core
326 
327 /**
328  * @defgroup Core Core
329  * Set of functions dedicated to working with registered plugins and loading
330  * network to the registered devices.
331  * @{
332  */
333 
334 /**
335  * @brief Constructs Inference Engine Core instance using XML configuration file with devices description.
336  * See RegisterPlugins for more details. Use the ie_core_free() method to free memory.
337  * @ingroup Core
338  * @param xml_config_file A path to .xml file with devices to load from. If XML configuration file is not specified,
339  * then default Inference Engine devices are loaded from the default plugin.xml file.
340  * @param core A pointer to the newly created ie_core_t.
341  * @return Status code of the operation: OK(0) for success.
342  */
343 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_core_create(const char *xml_config_file, ie_core_t **core);
344 
345 /**
346  * @brief Releases memory occupied by core.
347  * @ingroup Core
348  * @param core A pointer to the core to free memory.
349  */
350 INFERENCE_ENGINE_C_API(void) ie_core_free(ie_core_t **core);
351 
352 /**
353  * @brief Gets version information of the device specified. Use the ie_core_versions_free() method to free memory.
354  * @ingroup Core
355  * @param core A pointer to ie_core_t instance.
356  * @param device_name Name to identify device.
357  * @param versions A pointer to versions corresponding to device_name.
358  * @return Status code of the operation: OK(0) for success.
359  */
360 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_core_get_versions(const ie_core_t *core, const char *device_name, ie_core_versions_t *versions);
361 
362 /**
363  * @brief Releases memory occupied by ie_core_versions.
364  * @ingroup Core
365  * @param vers A pointer to the ie_core_versions to free memory.
366  */
367 INFERENCE_ENGINE_C_API(void) ie_core_versions_free(ie_core_versions_t *vers);
368 
369 /**
370  * @brief Reads the model from the .xml and .bin files of the IR. Use the ie_network_free() method to free memory.
371  * @ingroup Core
372  * @param core A pointer to ie_core_t instance.
373  * @param xml .xml file's path of the IR.
374  * @param weights_file .bin file's path of the IR, if path is empty, will try to read bin file with the same name as xml and
375  * if bin file with the same name was not found, will load IR without weights.
376  * @param network A pointer to the newly created network.
377  * @return Status code of the operation: OK(0) for success.
378  */
379 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_core_read_network(ie_core_t *core, const char *xml, const char *weights_file, ie_network_t **network);
380 
381 /**
382  * @brief Reads the model from an xml string and a blob of the bin part of the IR. Use the ie_network_free() method to free memory.
383  * @ingroup Core
384  * @param core A pointer to ie_core_t instance.
385  * @param xml_content Xml content of the IR.
386  * @param xml_content_size Number of bytes in the xml content of the IR.
387  * @param weight_blob Blob containing the bin part of the IR.
388  * @param network A pointer to the newly created network.
389  * @return Status code of the operation: OK(0) for success.
390  */
391 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_core_read_network_from_memory(ie_core_t *core, const uint8_t *xml_content, size_t xml_content_size,
392  const ie_blob_t *weight_blob, ie_network_t **network);
393 
394 /**
395  * @brief Creates an executable network from a network object. Users can create as many networks as they need and use
396  * them simultaneously (up to the limitation of the hardware resources). Use the ie_exec_network_free() method to free memory.
397  * @ingroup Core
398  * @param core A pointer to ie_core_t instance.
399  * @param network A pointer to ie_network instance.
400  * @param device_name Name of device to load network to.
401  * @param config Device configuration.
402  * @param exe_network A pointer to the newly created executable network.
403  * @return Status code of the operation: OK(0) for success.
404  */
405 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_core_load_network(ie_core_t *core, const ie_network_t *network, const char *device_name, \
406  const ie_config_t *config, ie_executable_network_t **exe_network);
407 
408 /**
409  * @brief Sets configuration for device.
410  * @ingroup Core
411  * @param core A pointer to ie_core_t instance.
412  * @param ie_core_config Device configuration.
413  * @param device_name An optional name of a device. If device name is not specified,
414  * the config is set for all the registered devices.
415  * @return Status code of the operation: OK(0) for success.
416  */
417 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_core_set_config(ie_core_t *core, const ie_config_t *ie_core_config, const char *device_name);
418 
419 /**
420  * @brief Registers a new device and a plugin which implement this device inside Inference Engine.
421  * @ingroup Core
422  * @param core A pointer to ie_core_t instance.
423  * @param plugin_name A name of a plugin. Depending on a platform, plugin_name is wrapped with
424  * a shared library suffix and a prefix to identify a full name of the library.
425  * @param device_name A device name to register plugin for. If not specified, the method registers
426  * a plugin with the default name.
427  * @return Status code of the operation: OK(0) for success.
428  */
429 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_core_register_plugin(ie_core_t *core, const char *plugin_name, const char *device_name);
430 
431 /**
432  * @brief Registers plugins specified in an ".xml" configuration file.
433  * @ingroup Core
434  * @param core A pointer to ie_core_t instance.
435  * @param xml_config_file A full path to ".xml" file containing plugins configuration.
436  * @return Status code of the operation: OK(0) for success.
437  */
438 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_core_register_plugins(ie_core_t *core, const char *xml_config_file);
439 
440 /**
441  * @brief Unregisters a plugin with a specified device name.
442  * @ingroup Core
443  * @param core A pointer to ie_core_t instance.
444  * @param device_name A device name of the device to unregister.
445  * @return Status code of the operation: OK(0) for success.
446  */
447 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_core_unregister_plugin(ie_core_t *core, const char *device_name);
448 
449 /**
450  * @brief Loads extension library to the device with a specified device name.
451  * @ingroup Core
452  * @param core A pointer to ie_core_t instance.
453  * @param extension_path Path to the extensions library file to load to a device.
454  * @param device_name A device name of a device to load the extensions to.
455  * @return Status code of the operation: OK(0) for success.
456  */
457 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_core_add_extension(ie_core_t *core, const char *extension_path, const char *device_name);
458 
459 /**
460  * @brief Gets general runtime metric for dedicated hardware. The method is needed to request common device properties
461  * which are executable network agnostic. It can be device name, temperature, other devices-specific values.
462  * @ingroup Core
463  * @param core A pointer to ie_core_t instance.
464  * @param device_name A name of a device to get a metric value.
465  * @param metric_name A metric name to request.
466  * @param param_result A metric value corresponding to the metric_name.
467  * @return Status code of the operation: OK(0) for success.
468  */
469 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_core_get_metric(const ie_core_t *core, const char *device_name, const char *metric_name, ie_param_t *param_result);
470 
471 /**
472  * @brief Gets configuration dedicated to device behaviour. The method is targeted to extract information
473  * which can be set via SetConfig method.
474  * @ingroup Core
475  * @param core A pointer to ie_core_t instance.
476  * @param device_name A name of a device to get a configuration value.
477  * @param config_name Name of a configuration.
478  * @param param_result A configuration value corresponding to the config_name.
479  * @return Status code of the operation: OK(0) for success.
480  */
481 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_core_get_config(const ie_core_t *core, const char *device_name, const char *config_name, ie_param_t *param_result);
482 
483 /**
484  * @brief Gets available devices for neural network inference.
485  * @ingroup Core
486  * @param core A pointer to ie_core_t instance.
487  * @param avai_devices The devices are returned as { CPU, FPGA.0, FPGA.1, MYRIAD }
488  * If there more than one device of specific type, they are enumerated with .# suffix
489  * @return Status code of the operation: OK(0) for success.
490  */
491 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_core_get_available_devices(const ie_core_t *core, ie_available_devices_t *avai_devices);
492 
493 /**
494  * @brief Releases memory occpuied by ie_available_devices_t
495  * @ingroup Core
496  * @param avai_devices A pointer to the ie_available_devices_t to free memory.
497  */
498 INFERENCE_ENGINE_C_API(void) ie_core_available_devices_free(ie_available_devices_t *avai_devices);
499 
500 /** @} */ // end of Core
501 
502 // ExecutableNetwork
503 
504 /**
505  * @defgroup ExecutableNetwork ExecutableNetwork
506  * Set of functions representing of neural networks been loaded to device.
507  * @{
508  */
509 
510 /**
511  * @brief Releases memory occupied by ExecutableNetwork.
512  * @ingroup ExecutableNetwork
513  * @param ie_exec_network A pointer to the ExecutableNetwork to free memory.
514  */
515 INFERENCE_ENGINE_C_API(void) ie_exec_network_free(ie_executable_network_t **ie_exec_network);
516 
517 /**
518  * @brief Creates an inference request instance used to infer the network. The created request has allocated input
519  * and output blobs (that can be changed later). Use the ie_infer_request_free() method to free memory.
520  * @ingroup ExecutableNetwork
521  * @param ie_exec_network A pointer to ie_executable_network_t instance.
522  * @param request A pointer to the newly created ie_infer_request_t instance
523  * @return Status code of the operation: OK(0) for success.
524  */
525 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_exec_network_create_infer_request(ie_executable_network_t *ie_exec_network, ie_infer_request_t **request);
526 
527 /**
528  * @brief Gets general runtime metric for an executable network. It can be network name, actual device ID on which executable network is running
529  * or all other properties which cannot be changed dynamically.
530  * @ingroup ExecutableNetwork
531  * @param ie_exec_network A pointer to ie_executable_network_t instance.
532  * @param metric_name A metric name to request.
533  * @param param_result A metric value corresponding to the metric_name.
534  * @return Status code of the operation: OK(0) for success.
535  */
536 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_exec_network_get_metric(const ie_executable_network_t *ie_exec_network, \
537  const char *metric_name, ie_param_t *param_result);
538 
539 /**
540  * @brief Sets configuration for current executable network. Currently, the method can be used
541  * when the network run on the Multi device and the configuration parameter is only can be "MULTI_DEVICE_PRIORITIES"
542  * @ingroup ExecutableNetwork
543  * @param ie_exec_network A pointer to ie_executable_network_t instance.
544  * @param param_config A pointer to device configuration..
545  * @return Status code of the operation: OK(0) for success.
546  */
547 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_exec_network_set_config(ie_executable_network_t *ie_exec_network, const ie_config_t *param_config);
548 
549 /**
550  * @brief Gets configuration for current executable network. The method is responsible to
551  * extract information which affects executable network execution.
552  * @ingroup ExecutableNetwork
553  * @param ie_exec_network A pointer to ie_executable_network_t instance.
554  * @param metric_config A configuration parameter name to request.
555  * @param param_result A configuration value corresponding to a configuration parameter name.
556  * @return Status code of the operation: OK(0) for success.
557  */
558 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_exec_network_get_config(const ie_executable_network_t *ie_exec_network, \
559  const char *metric_config, ie_param_t *param_result);
560 
561 /** @} */ // end of ExecutableNetwork
562 
563 // InferRequest
564 
565 /**
566  * @defgroup InferRequest InferRequest
567  * Set of functions responsible for dedicated inference for certain
568  * ExecutableNetwork.
569  * @{
570  */
571 
572 /**
573  * @brief Releases memory occupied by ie_infer_request_t instance.
574  * @ingroup InferRequest
575  * @param infer_request A pointer to the ie_infer_request_t to free memory.
576  */
577 INFERENCE_ENGINE_C_API(void) ie_infer_request_free(ie_infer_request_t **infer_request);
578 
579 /**
580  * @brief Gets input/output data for inference
581  * @ingroup InferRequest
582  * @param infer_request A pointer to ie_infer_request_t instance.
583  * @param name Name of input or output blob.
584  * @param blob A pointer to input or output blob. The type of Blob must match the network input precision and size.
585  * @return Status code of the operation: OK(0) for success.
586  */
587 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_infer_request_get_blob(ie_infer_request_t *infer_request, const char *name, ie_blob_t **blob);
588 
589 /**
590  * @brief Sets input/output data to inference.
591  * @ingroup InferRequest
592  * @param infer_request A pointer to ie_infer_request_t instance.
593  * @param name Name of input or output blob.
594  * @param blob Reference to input or output blob. The type of a blob must match the network input precision and size.
595  * @return Status code of the operation: OK(0) for success.
596  */
597 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_infer_request_set_blob(ie_infer_request_t *infer_request, const char *name, const ie_blob_t *blob);
598 
599 /**
600  * @brief Starts synchronous inference of the infer request and fill outputs.
601  * @ingroup InferRequest
602  * @param infer_request A pointer to ie_infer_request_t instance.
603  * @return Status code of the operation: OK(0) for success.
604  */
605 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_infer_request_infer(ie_infer_request_t *infer_request);
606 
607 /**
608  * @brief Starts asynchronous inference of the infer request and fill outputs.
609  * @ingroup InferRequest
610  * @param infer_request A pointer to ie_infer_request_t instance.
611  * @return Status code of the operation: OK(0) for success.
612  */
613 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_infer_request_infer_async(ie_infer_request_t *infer_request);
614 
615 /**
616  * @brief Sets a callback function that will be called on success or failure of asynchronous request
617  * @ingroup InferRequest
618  * @param infer_request A pointer to ie_infer_request_t instance.
619  * @param callback A function to be called.
620  * @return Status code of the operation: OK(0) for success.
621  */
622 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_infer_set_completion_callback(ie_infer_request_t *infer_request, ie_complete_call_back_t *callback);
623 
624 /**
625  * @brief Waits for the result to become available. Blocks until specified timeout elapses or the result becomes available, whichever comes first.
626  * @ingroup InferRequest
627  * @param infer_request A pointer to ie_infer_request_t instance.
628  * @param timeout Maximum duration in milliseconds to block for
629  * @note There are special cases when timeout is equal some value of the WaitMode enum:
630  * * 0 - Immediately returns the inference status. It does not block or interrupt execution.
631  * * -1 - waits until inference result becomes available
632  * @return Status code of the operation: OK(0) for success.
633  */
634 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_infer_request_wait(ie_infer_request_t *infer_request, const int64_t timeout);
635 
636 /**
637  * @brief Sets new batch size for certain infer request when dynamic batching is enabled in executable network that created this request.
638  * @ingroup InferRequest
639  * @param infer_request A pointer to ie_infer_request_t instance.
640  * @param size New batch size to be used by all the following inference calls for this request.
641  * @return Status code of the operation: OK(0) for success.
642  */
643 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_infer_request_set_batch(ie_infer_request_t *infer_request, const size_t size);
644 
645 /** @} */ // end of InferRequest
646 
647 // Network
648 
649 /**
650  * @defgroup Network Network
651  * Set of functions managing network been read from the IR before loading
652  * of it to the device.
653  * @{
654  */
655 
656 /**
657  * @brief When network is loaded into the Infernece Engine, it is not required anymore and should be released
658  * @ingroup Network
659  * @param network The pointer to the instance of the ie_network_t to free.
660  */
661 INFERENCE_ENGINE_C_API(void) ie_network_free(ie_network_t **network);
662 
663 /**
664  * @brief Get name of network.
665  * @ingroup Network
666  * @param network A pointer to the instance of the ie_network_t to get a name from.
667  * @param name Name of the network.
668  * @return Status code of the operation: OK(0) for success.
669  */
670 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_network_get_name(const ie_network_t *network, char **name);
671 
672 /**
673  * @brief Gets number of inputs for the network.
674  * @ingroup Network
675  * @param network A pointer to the instance of the ie_network_t to get number of input information.
676  * @param size_result A number of the instance's input information.
677  * @return Status code of the operation: OK(0) for success.
678  */
679 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_network_get_inputs_number(const ie_network_t *network, size_t *size_result);
680 
681 /**
682  * @brief Gets name corresponding to the "number". Use the ie_network_name_free() method to free memory.
683  * @ingroup Network
684  * @param network A pointer to theinstance of the ie_network_t to get input information.
685  * @param number An id of input information .
686  * @param name Input name corresponding to the number.
687  * @return status Status code of the operation: OK(0) for success.
688  */
689 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_network_get_input_name(const ie_network_t *network, size_t number, char **name);
690 
691 /**
692  * @brief Gets a precision of the input data provided by user.
693  * @ingroup Network
694  * @param network A pointer to ie_network_t instance.
695  * @param input_name Name of input data.
696  * @param prec_result A pointer to the precision used for input blob creation.
697  * @return Status code of the operation: OK(0) for success.
698  */
699 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_network_get_input_precision(const ie_network_t *network, const char *input_name, precision_e *prec_result);
700 
701 /**
702  * @brief Changes the precision of the input data provided by the user.
703  * This function should be called before loading the network to the device.
704  * @ingroup Network
705  * @param network A pointer to ie_network_t instance.
706  * @param input_name Name of input data.
707  * @param p A new precision of the input data to set (eg. precision_e.FP16).
708  * @return Status code of the operation: OK(0) for success.
709  */
710 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_network_set_input_precision(ie_network_t *network, const char *input_name, const precision_e p);
711 
712 /**
713  * @brief Gets a layout of the input data.
714  * @ingroup Network
715  * @param network A pointer to ie_network_t instance.
716  * @param input_name Name of input data.
717  * @param layout_result A pointer to the layout used for input blob creation.
718  * @return Status code of the operation: OK(0) for success.
719  */
720 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_network_get_input_layout(const ie_network_t *network, const char *input_name, layout_e *layout_result);
721 
722 /**
723  * @brief Changes the layout of the input data named "input_name".
724  * This function should be called before loading the network to the device.
725  * @ingroup Network
726  * @param network A pointer to ie_network_t instance.
727  * @param input_name Name of input data.
728  * @param l A new layout of the input data to set.
729  * @return Status code of the operation: OK(0) for success.
730  */
731 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_network_set_input_layout(ie_network_t *network, const char *input_name, const layout_e l);
732 
733 /**
734  * @brief Gets dimensions/shape of the input data with reversed order.
735  * @ingroup Network
736  * @param network A pointer to ie_network_t instance.
737  * @param input_name Name of input data.
738  * @param dims_result A pointer to the dimensions used for input blob creation.
739  * @return Status code of the operation: OK(0) for success.
740  */
741 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_network_get_input_dims(const ie_network_t *network, const char *input_name, dimensions_t *dims_result);
742 
743 /**
744  * @brief Gets pre-configured resize algorithm.
745  * @ingroup Network
746  * @param network A pointer to ie_network_t instance.
747  * @param input_name Name of input data.
748  * @param resize_alg_result The pointer to the resize algorithm used for input blob creation.
749  * @return Status code of the operation: OK(0) for success.
750  */
751 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_network_get_input_resize_algorithm(const ie_network_t *network, const char *input_name, resize_alg_e *resize_alg_result);
752 
753 /**
754  * @brief Sets resize algorithm to be used during pre-processing
755  * @ingroup Network
756  * @param network A pointer to ie_network_t instance.
757  * @param input_name Name of input data.
758  * @param resize_algo Resize algorithm.
759  * @return Status code of the operation: OK(0) for success.
760  */
761 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_network_set_input_resize_algorithm(ie_network_t *network, const char *input_name, const resize_alg_e resize_algo);
762 
763 /**
764  * @brief Gets color format of the input data.
765  * @ingroup Network
766  * @param network A pointer to ie_network_t instance.
767  * @param input_name Name of input data.
768  * @param colformat_result The pointer to the color format used for input blob creation.
769  * @return Status code of the operation: OK(0) for success.
770  */
771 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_network_get_color_format(const ie_network_t *network, const char *input_name, colorformat_e *colformat_result);
772 
773 /**
774  * @brief Changes the color format of the input data.
775  * @ingroup Network
776  * @param network A pointer to ie_network_t instance.
777  * @param input_name Name of input data.
778  * @param color_format Color format of the input data.
779  * @return Status code of the operation: OK(0) for success.
780  */
781 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_network_set_color_format(ie_network_t *network, const char *input_name, const colorformat_e color_format);
782 
783 /**
784  * @brief Helper method collect all input shapes with input names of corresponding input data.
785  * Use the ie_network_input_shapes_free() method to free memory.
786  * @ingroup Network
787  * @param network A pointer to the instance of the ie_network_t to get input shapes.
788  * @param shapes A pointer to the input_shapes.
789  * @return Status code of the operation: OK(0) for success.
790  */
791 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_network_get_input_shapes(ie_network_t *network, input_shapes_t *shapes);
792 
793 /**
794  * @brief Run shape inference with new input shapes for the network.
795  * @ingroup Network
796  * @param network A pointer to the instance of the ie_network_t to reshape.
797  * @param shapes A new input shapes to set for the network.
798  * @return Status code of the operation: OK(0) for success.
799  */
800 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_network_reshape(ie_network_t *network, const input_shapes_t shapes);
801 
802 /**
803  * @brief Gets number of output for the network.
804  * @ingroup Network
805  * @param network A pointer to the instance of the ie_network_t to get number of output information.
806  * @param size_result A number of the network's output information.
807  * @return Status code of the operation: OK(0) for success.
808  */
809 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_network_get_outputs_number(const ie_network_t *network, size_t *size_result);
810 
811 /**
812  * @brief Gets name corresponding to the "number". Use the ie_network_name_free() method to free memory.
813  * @ingroup Network
814  * @param network A pointer to theinstance of the ie_network_t to get output information.
815  * @param number An id of output information .
816  * @param name Output name corresponding to the number.
817  * @return Status code of the operation: OK(0) for success.
818  */
819 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_network_get_output_name(const ie_network_t *network, const size_t number, char **name);
820 
821 /**
822  * @brief Gets a precision of the output data named "output_name".
823  * @ingroup Network
824  * @param network A pointer to ie_network_t instance.
825  * @param output_name Name of output data.
826  * @param prec_result A pointer to the precision used for output blob creation.
827  * @return Status code of the operation: OK(0) for success.
828  */
829 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_network_get_output_precision(const ie_network_t *network, const char *output_name, precision_e *prec_result);
830 
831 /**
832  * @brief Changes the precision of the output data named "output_name".
833  * @ingroup Network
834  * @param network A pointer to ie_network_t instance.
835  * @param output_name Name of output data.
836  * @param p A new precision of the output data to set (eg. precision_e.FP16).
837  * @return Status code of the operation: OK(0) for success.
838  */
839 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_network_set_output_precision(ie_network_t *network, const char *output_name, const precision_e p);
840 
841 /**
842  * @brief Gets a layout of the output data.
843  * @ingroup Network
844  * @param network A pointer to ie_network_t instance.
845  * @param output_name Name of output data.
846  * @param layout_result A pointer to the layout used for output blob creation.
847  * @return Status code of the operation: OK(0) for success.
848  */
849 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_network_get_output_layout(const ie_network_t *network, const char *output_name, layout_e *layout_result);
850 
851 /**
852  * @brief Changes the layout of the output data named "output_name".
853  * @ingroup Network
854  * @param network A pointer to ie_network_t instance.
855  * @param output_name Name of output data.
856  * @param l A new layout of the output data to set.
857  * @return Status code of the operation: OK(0) for success.
858  */
859 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_network_set_output_layout(ie_network_t *network, const char *output_name, const layout_e l);
860 
861 /**
862  * @brief Gets dimensions/shape of the output data with reversed order.
863  * @ingroup Network
864  * @param network A pointer to ie_network_t instance.
865  * @param output_name Name of output data.
866  * @param dims_result A pointer to the dimensions used for output blob creation.
867  * @return Status code of the operation: OK(0) for success.
868  */
869 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_network_get_output_dims(const ie_network_t *network, const char *output_name, dimensions_t *dims_result);
870 
871 /**
872  * @brief Releases memory occupied by input_shapes.
873  * @ingroup Network
874  * @param inputShapes A pointer to the input_shapes to free memory.
875  */
876 INFERENCE_ENGINE_C_API(void) ie_network_input_shapes_free(input_shapes_t *inputShapes);
877 
878 /**
879  * @brief Releases momory occupied by input_name or output_name.
880  * @ingroup Network
881  * @param name A pointer to the input_name or output_name to free memory.
882  */
883 INFERENCE_ENGINE_C_API(void) ie_network_name_free(char **name);
884 
885 /** @} */ // end of InferRequest
886 
887 // Blob
888 
889 /**
890  * @defgroup Blob Blob
891  * Set of functions allowing to research memory from infer requests or make new
892  * memory objects to be passed to InferRequests.
893  * @{
894  */
895 
896 /**
897  * @brief Creates a blob with the specified dimensions, layout and to allocate memory.
898  * @ingroup Blob
899  * @param tensorDesc Tensor descriptor for Blob creation.
900  * @param blob A pointer to the newly created blob.
901  * @return Status code of the operation: OK(0) for success.
902  */
903 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_blob_make_memory(const tensor_desc_t *tensorDesc, ie_blob_t **blob);
904 
905 /**
906  * @brief Creates a blob with the given tensor descriptor from the pointer to the pre-allocated memory.
907  * @ingroup Blob
908  * @param tensorDesc Tensor descriptor for Blob creation.
909  * @param ptr Pointer to the pre-allocated memory.
910  * @param size Length of the pre-allocated array.
911  * @param blob A pointer to the newly created blob.
912  * @return Status code of the operation: OK(0) for success.
913  */
914 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_blob_make_memory_from_preallocated(const tensor_desc_t *tensorDesc, void *ptr, size_t size, ie_blob_t **blob);
915 
916 /**
917  * @brief Creates a blob describing given roi_t instance based on the given blob with pre-allocated memory.
918  * @ingroup Blob
919  * @param inputBlob original blob with pre-allocated memory.
920  * @param roi A roi_tinstance inside of the original blob.
921  * @param blob A pointer to the newly created blob.
922  * @return Status code of the operation: OK(0) for success.
923  */
924 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_blob_make_memory_with_roi(const ie_blob_t *inputBlob, const roi_t *roi, ie_blob_t **blob);
925 
926 /**
927  * @brief Creates a NV12 blob from two planes Y and UV.
928  * @ingroup Blob
929  * @param y A pointer to the ie_blob_t instance that represents Y plane in NV12 color format.
930  * @param uv A pointer to the ie_blob_t instance that represents UV plane in NV12 color format.
931  * @param nv12Blob A pointer to the newly created blob.
932  * @return Status code of the operation: OK(0) for success.
933 */
934 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_blob_make_memory_nv12(const ie_blob_t *y, const ie_blob_t *uv, ie_blob_t **nv12Blob);
935 
936 /**
937  * @brief Creates I420 blob from three planes Y, U and V.
938  * @ingroup Blob
939  * @param y A pointer to the ie_blob_t instance that represents Y plane in I420 color format.
940  * @param u A pointer to the ie_blob_t instance that represents U plane in I420 color format.
941  * @param v A pointer to the ie_blob_t instance that represents V plane in I420 color format.
942  * @param i420Blob A pointer to the newly created blob.
943  * @return Status code of the operation: OK(0) for success.
944 */
945 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_blob_make_memory_i420(const ie_blob_t *y, const ie_blob_t *u, const ie_blob_t *v, ie_blob_t **i420Blob);
946 
947 /**
948  * @brief Gets the total number of elements, which is a product of all the dimensions.
949  * @ingroup Blob
950  * @param blob A pointer to the blob.
951  * @param size_result The total number of elements.
952  * @return Status code of the operation: OK(0) for success.
953  */
954 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_blob_size(ie_blob_t *blob, int *size_result);
955 
956 /**
957  * @brief Gets the size of the current Blob in bytes.
958  * @ingroup Blob
959  * @param blob A pointer to the blob.
960  * @param bsize_result The size of the current blob in bytes.
961  * @return Status code of the operation: OK(0) for success.
962  */
963 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_blob_byte_size(ie_blob_t *blob, int *bsize_result);
964 
965 /**
966  * @brief Releases previously allocated data
967  * @ingroup Blob
968  * @param blob A pointer to the blob to free memory.
969  */
970 INFERENCE_ENGINE_C_API(void) ie_blob_deallocate(ie_blob_t **blob);
971 
972 /**
973  * @brief Gets access to the allocated memory .
974  * @ingroup Blob
975  * @param blob A pointer to the blob.
976  * @param blob_buffer A pointer to the copied data from the given blob.
977  * @return Status code of the operation: OK(0) for success.
978  */
979 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_blob_get_buffer(const ie_blob_t *blob, ie_blob_buffer_t *blob_buffer);
980 
981 /**
982  * @brief Gets read-only access to the allocated memory.
983  * @ingroup Blob
984  * @param blob A pointer to the blob.
985  * @param blob_cbuffer A pointer to the coped data from the given pointer to the blob and the data is read-only.
986  * @return Status code of the operation: OK(0) for success
987  */
988 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_blob_get_cbuffer(const ie_blob_t *blob, ie_blob_buffer_t *blob_cbuffer);
989 
990 /**
991  * @brief Gets dimensions of blob's tensor.
992  * @ingroup Blob
993  * @param blob A pointer to the blob.
994  * @param dims_result A pointer to the dimensions of blob's tensor.
995  * @return Status code of the operation: OK(0) for success.
996  */
997 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_blob_get_dims(const ie_blob_t *blob, dimensions_t *dims_result);
998 
999 /**
1000  * @brief Gets layout of blob's tensor.
1001  * @ingroup Blob
1002  * @param blob A pointer to the blob.
1003  * @param layout_result A pointer to the layout of blob's tensor.
1004  * @return Status code of the operation: OK(0) for success.
1005  */
1006 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_blob_get_layout(const ie_blob_t *blob, layout_e *layout_result);
1007 
1008 /**
1009  * @brief Gets precision of blob's tensor.
1010  * @ingroup Blob
1011  * @param blob A pointer to the blob.
1012  * @param prec_result A pointer to the precision of blob's tensor.
1013  * @return Status code of the operation: OK(0) for success.
1014  */
1015 INFERENCE_ENGINE_C_API(IE_NODISCARD IEStatusCode) ie_blob_get_precision(const ie_blob_t *blob, precision_e *prec_result);
1016 
1017 /**
1018  * @brief Releases the memory occupied by the ie_blob_t pointer.
1019  * @ingroup Blob
1020  * @param blob A pointer to the blob pointer to release memory.
1021  */
1022 INFERENCE_ENGINE_C_API(void) ie_blob_free(ie_blob_t **blob);
1023 
1024 /** @} */ // end of Blob
1025 
1026 #endif // IE_C_API_H
IEStatusCode ie_blob_make_memory_nv12(const ie_blob_t *y, const ie_blob_t *uv, ie_blob_t **nv12Blob)
Creates a NV12 blob from two planes Y and UV.
IEStatusCode ie_blob_make_memory_with_roi(const ie_blob_t *inputBlob, const roi_t *roi, ie_blob_t **blob)
Creates a blob describing given roi_t instance based on the given blob with pre-allocated memory.
IEStatusCode ie_blob_get_dims(const ie_blob_t *blob, dimensions_t *dims_result)
Gets dimensions of blob's tensor.
void ie_blob_deallocate(ie_blob_t **blob)
Releases previously allocated data.
IEStatusCode ie_blob_size(ie_blob_t *blob, int *size_result)
Gets the total number of elements, which is a product of all the dimensions.
IEStatusCode ie_blob_make_memory_from_preallocated(const tensor_desc_t *tensorDesc, void *ptr, size_t size, ie_blob_t **blob)
Creates a blob with the given tensor descriptor from the pointer to the pre-allocated memory.
void ie_blob_free(ie_blob_t **blob)
Releases the memory occupied by the ie_blob_t pointer.
IEStatusCode ie_blob_make_memory(const tensor_desc_t *tensorDesc, ie_blob_t **blob)
Creates a blob with the specified dimensions, layout and to allocate memory.
IEStatusCode ie_blob_get_buffer(const ie_blob_t *blob, ie_blob_buffer_t *blob_buffer)
Gets access to the allocated memory .
IEStatusCode ie_blob_get_precision(const ie_blob_t *blob, precision_e *prec_result)
Gets precision of blob's tensor.
IEStatusCode ie_blob_make_memory_i420(const ie_blob_t *y, const ie_blob_t *u, const ie_blob_t *v, ie_blob_t **i420Blob)
Creates I420 blob from three planes Y, U and V.
IEStatusCode ie_blob_get_layout(const ie_blob_t *blob, layout_e *layout_result)
Gets layout of blob's tensor.
IEStatusCode ie_blob_get_cbuffer(const ie_blob_t *blob, ie_blob_buffer_t *blob_cbuffer)
Gets read-only access to the allocated memory.
IEStatusCode ie_blob_byte_size(ie_blob_t *blob, int *bsize_result)
Gets the size of the current Blob in bytes.
void ie_core_free(ie_core_t **core)
Releases memory occupied by core.
IEStatusCode ie_core_get_versions(const ie_core_t *core, const char *device_name, ie_core_versions_t *versions)
Gets version information of the device specified. Use the ie_core_versions_free() method to free memo...
IEStatusCode ie_core_load_network(ie_core_t *core, const ie_network_t *network, const char *device_name, const ie_config_t *config, ie_executable_network_t **exe_network)
Creates an executable network from a network object. Users can create as many networks as they need a...
IEStatusCode ie_core_unregister_plugin(ie_core_t *core, const char *device_name)
Unregisters a plugin with a specified device name.
IEStatusCode ie_core_get_available_devices(const ie_core_t *core, ie_available_devices_t *avai_devices)
Gets available devices for neural network inference.
IEStatusCode ie_core_register_plugin(ie_core_t *core, const char *plugin_name, const char *device_name)
Registers a new device and a plugin which implement this device inside Inference Engine.
IEStatusCode ie_core_read_network(ie_core_t *core, const char *xml, const char *weights_file, ie_network_t **network)
Reads the model from the .xml and .bin files of the IR. Use the ie_network_free() method to free memo...
IEStatusCode ie_core_create(const char *xml_config_file, ie_core_t **core)
Constructs Inference Engine Core instance using XML configuration file with devices description....
IEStatusCode ie_core_get_metric(const ie_core_t *core, const char *device_name, const char *metric_name, ie_param_t *param_result)
Gets general runtime metric for dedicated hardware. The method is needed to request common device pro...
void ie_core_versions_free(ie_core_versions_t *vers)
Releases memory occupied by ie_core_versions.
IEStatusCode ie_core_get_config(const ie_core_t *core, const char *device_name, const char *config_name, ie_param_t *param_result)
Gets configuration dedicated to device behaviour. The method is targeted to extract information which...
IEStatusCode ie_core_read_network_from_memory(ie_core_t *core, const uint8_t *xml_content, size_t xml_content_size, const ie_blob_t *weight_blob, ie_network_t **network)
Reads the model from an xml string and a blob of the bin part of the IR. Use the ie_network_free() me...
void ie_core_available_devices_free(ie_available_devices_t *avai_devices)
Releases memory occpuied by ie_available_devices_t.
IEStatusCode ie_core_register_plugins(ie_core_t *core, const char *xml_config_file)
Registers plugins specified in an ".xml" configuration file.
IEStatusCode ie_core_add_extension(ie_core_t *core, const char *extension_path, const char *device_name)
Loads extension library to the device with a specified device name.
IEStatusCode ie_core_set_config(ie_core_t *core, const ie_config_t *ie_core_config, const char *device_name)
Sets configuration for device.
IEStatusCode ie_exec_network_set_config(ie_executable_network_t *ie_exec_network, const ie_config_t *param_config)
Sets configuration for current executable network. Currently, the method can be used when the network...
void ie_exec_network_free(ie_executable_network_t **ie_exec_network)
Releases memory occupied by ExecutableNetwork.
IEStatusCode ie_exec_network_get_metric(const ie_executable_network_t *ie_exec_network, const char *metric_name, ie_param_t *param_result)
Gets general runtime metric for an executable network. It can be network name, actual device ID on wh...
IEStatusCode ie_exec_network_create_infer_request(ie_executable_network_t *ie_exec_network, ie_infer_request_t **request)
Creates an inference request instance used to infer the network. The created request has allocated in...
IEStatusCode ie_exec_network_get_config(const ie_executable_network_t *ie_exec_network, const char *metric_config, ie_param_t *param_result)
Gets configuration for current executable network. The method is responsible to extract information w...
IEStatusCode ie_infer_request_wait(ie_infer_request_t *infer_request, const int64_t timeout)
Waits for the result to become available. Blocks until specified timeout elapses or the result become...
void ie_infer_request_free(ie_infer_request_t **infer_request)
Releases memory occupied by ie_infer_request_t instance.
IEStatusCode ie_infer_request_get_blob(ie_infer_request_t *infer_request, const char *name, ie_blob_t **blob)
Gets input/output data for inference.
IEStatusCode ie_infer_request_set_blob(ie_infer_request_t *infer_request, const char *name, const ie_blob_t *blob)
Sets input/output data to inference.
IEStatusCode ie_infer_set_completion_callback(ie_infer_request_t *infer_request, ie_complete_call_back_t *callback)
Sets a callback function that will be called on success or failure of asynchronous request.
IEStatusCode ie_infer_request_infer(ie_infer_request_t *infer_request)
Starts synchronous inference of the infer request and fill outputs.
IEStatusCode ie_infer_request_infer_async(ie_infer_request_t *infer_request)
Starts asynchronous inference of the infer request and fill outputs.
IEStatusCode ie_infer_request_set_batch(ie_infer_request_t *infer_request, const size_t size)
Sets new batch size for certain infer request when dynamic batching is enabled in executable network ...
IEStatusCode ie_network_get_input_layout(const ie_network_t *network, const char *input_name, layout_e *layout_result)
Gets a layout of the input data.
void ie_network_input_shapes_free(input_shapes_t *inputShapes)
Releases memory occupied by input_shapes.
void ie_network_free(ie_network_t **network)
When network is loaded into the Infernece Engine, it is not required anymore and should be released.
void ie_network_name_free(char **name)
Releases momory occupied by input_name or output_name.
IEStatusCode ie_network_get_output_name(const ie_network_t *network, const size_t number, char **name)
Gets name corresponding to the "number". Use the ie_network_name_free() method to free memory.
IEStatusCode ie_network_set_input_layout(ie_network_t *network, const char *input_name, const layout_e l)
Changes the layout of the input data named "input_name". This function should be called before loadin...
IEStatusCode ie_network_get_input_name(const ie_network_t *network, size_t number, char **name)
Gets name corresponding to the "number". Use the ie_network_name_free() method to free memory.
IEStatusCode ie_network_set_output_layout(ie_network_t *network, const char *output_name, const layout_e l)
Changes the layout of the output data named "output_name".
IEStatusCode ie_network_set_input_resize_algorithm(ie_network_t *network, const char *input_name, const resize_alg_e resize_algo)
Sets resize algorithm to be used during pre-processing.
IEStatusCode ie_network_get_name(const ie_network_t *network, char **name)
Get name of network.
IEStatusCode ie_network_get_input_shapes(ie_network_t *network, input_shapes_t *shapes)
Helper method collect all input shapes with input names of corresponding input data....
IEStatusCode ie_network_get_inputs_number(const ie_network_t *network, size_t *size_result)
Gets number of inputs for the network.
IEStatusCode ie_network_get_input_precision(const ie_network_t *network, const char *input_name, precision_e *prec_result)
Gets a precision of the input data provided by user.
IEStatusCode ie_network_get_output_layout(const ie_network_t *network, const char *output_name, layout_e *layout_result)
Gets a layout of the output data.
IEStatusCode ie_network_set_output_precision(ie_network_t *network, const char *output_name, const precision_e p)
Changes the precision of the output data named "output_name".
IEStatusCode ie_network_set_color_format(ie_network_t *network, const char *input_name, const colorformat_e color_format)
Changes the color format of the input data.
IEStatusCode ie_network_get_outputs_number(const ie_network_t *network, size_t *size_result)
Gets number of output for the network.
IEStatusCode ie_network_get_output_dims(const ie_network_t *network, const char *output_name, dimensions_t *dims_result)
Gets dimensions/shape of the output data with reversed order.
IEStatusCode ie_network_get_color_format(const ie_network_t *network, const char *input_name, colorformat_e *colformat_result)
Gets color format of the input data.
IEStatusCode ie_network_reshape(ie_network_t *network, const input_shapes_t shapes)
Run shape inference with new input shapes for the network.
IEStatusCode ie_network_get_input_dims(const ie_network_t *network, const char *input_name, dimensions_t *dims_result)
Gets dimensions/shape of the input data with reversed order.
IEStatusCode ie_network_set_input_precision(ie_network_t *network, const char *input_name, const precision_e p)
Changes the precision of the input data provided by the user. This function should be called before l...
IEStatusCode ie_network_get_output_precision(const ie_network_t *network, const char *output_name, precision_e *prec_result)
Gets a precision of the output data named "output_name".
IEStatusCode ie_network_get_input_resize_algorithm(const ie_network_t *network, const char *input_name, resize_alg_e *resize_alg_result)
Gets pre-configured resize algorithm.
IEStatusCode
This enum contains codes for all possible return values of the interface functions.
Definition: ie_c_api.h:229
colorformat_e
Extra information about input color format for preprocessing.
Definition: ie_c_api.h:205
@ BGRX
BGRX color format with X ignored during inference.
Definition: ie_c_api.h:210
@ RGB
RGB color format.
Definition: ie_c_api.h:207
@ BGR
BGR color format, default in DLDT.
Definition: ie_c_api.h:208
@ RGBX
RGBX color format with X ignored during inference.
Definition: ie_c_api.h:209
@ NV12
NV12 color format represented as compound Y+UV blob.
Definition: ie_c_api.h:211
@ RAW
Plain blob (default), no extra color processing required.
Definition: ie_c_api.h:206
@ I420
I420 color format represented as compound Y+U+V blob.
Definition: ie_c_api.h:212
precision_e
Precisions that the inference engine supports.
Definition: ie_c_api.h:172
@ U64
Definition: ie_c_api.h:185
@ U8
Definition: ie_c_api.h:180
@ FP32
Definition: ie_c_api.h:175
@ FP64
Definition: ie_c_api.h:177
@ BIN
Definition: ie_c_api.h:187
@ FP16
Definition: ie_c_api.h:176
@ MIXED
Definition: ie_c_api.h:174
@ U32
Definition: ie_c_api.h:186
@ I32
Definition: ie_c_api.h:183
@ Q78
Definition: ie_c_api.h:178
@ I8
Definition: ie_c_api.h:181
@ I16
Definition: ie_c_api.h:179
@ CUSTOM
Definition: ie_c_api.h:188
@ I64
Definition: ie_c_api.h:184
@ UNSPECIFIED
Definition: ie_c_api.h:173
@ U16
Definition: ie_c_api.h:182
void ie_version_free(ie_version_t *version)
Release the memory allocated by ie_c_api_version.
ie_version_t ie_c_api_version(void)
Returns number of version that is exported. Use the ie_version_free() to free memory.
layout_e
Layouts that the inference engine supports.
Definition: ie_c_api.h:139
@ BLOCKED
"BLOCKED" layout
Definition: ie_c_api.h:165
@ NC
"NC" layout
Definition: ie_c_api.h:162
@ NCHW
"NCHW" layout
Definition: ie_c_api.h:143
@ CN
"CN" layout
Definition: ie_c_api.h:163
@ C
"C" layout
Definition: ie_c_api.h:155
@ NHWC
"NHWC" layout
Definition: ie_c_api.h:144
@ OIHW
"OIHW" layout
Definition: ie_c_api.h:149
@ SCALAR
"SCALAR" layout
Definition: ie_c_api.h:152
@ CHW
"CHW" layout
Definition: ie_c_api.h:158
@ ANY
"ANY" layout
Definition: ie_c_api.h:140
@ HW
"HW" layout
Definition: ie_c_api.h:161
@ NCDHW
"NCDHW" layout
Definition: ie_c_api.h:145
@ NDHWC
"NDHWC" layout
Definition: ie_c_api.h:146
resize_alg_e
Represents the list of supported resize algorithms.
Definition: ie_c_api.h:219
@ RESIZE_BILINEAR
"Bilinear resize" mode
Definition: ie_c_api.h:221
@ RESIZE_AREA
"Area resize" mode
Definition: ie_c_api.h:222
@ NO_RESIZE
"No resize" mode
Definition: ie_c_api.h:220
void ie_param_free(ie_param_t *param)
Release the memory allocated by ie_param_t.
Represents detailed information for an error.
Definition: ie_c_api.h:122
char msg[256]
A description message.
Definition: ie_c_api.h:123
Represents dimensions for input or output data.
Definition: ie_c_api.h:130
size_t dims[8]
An array of dimensions.
Definition: ie_c_api.h:132
size_t ranks
A runk representing a number of dimensions.
Definition: ie_c_api.h:131
Represent all available devices.
Definition: ie_c_api.h:302
Represents copied data from the given blob.
Definition: ie_c_api.h:282
const void * cbuffer
cbuffer is read-only
Definition: ie_c_api.h:285
void * buffer
buffer can be written
Definition: ie_c_api.h:284
Completion callback definition about the function and args.
Definition: ie_c_api.h:293
Represents configuration information that describes devices.
Definition: ie_c_api.h:90
const char * name
A configuration key.
Definition: ie_c_api.h:91
const char * value
A configuration value.
Definition: ie_c_api.h:92
struct ie_config * next
A pointer to the next configuration value.
Definition: ie_c_api.h:93
Represents version information that describes devices and the inference engine runtime library.
Definition: ie_c_api.h:69
const char * build_number
A build number.
Definition: ie_c_api.h:73
size_t minor
A minor version.
Definition: ie_c_api.h:71
size_t major
A major version.
Definition: ie_c_api.h:70
const char * device_name
A device name.
Definition: ie_c_api.h:72
const char * description
A device description.
Definition: ie_c_api.h:74
Represents all versions information that describes all devices and the inference engine runtime libra...
Definition: ie_c_api.h:81
size_t num_vers
A number of versions in the array.
Definition: ie_c_api.h:83
ie_core_version_t * versions
An array of device versions.
Definition: ie_c_api.h:82
Represents configuration parameter information.
Definition: ie_c_api.h:113
metric and config parameters.
Definition: ie_c_api.h:100
Represents an API version information that reflects the set of supported features.
Definition: ie_c_api.h:61
char * api_version
A string representing Inference Engine version.
Definition: ie_c_api.h:62
Represents shape for input data.
Definition: ie_c_api.h:264
Represents shapes for all input data.
Definition: ie_c_api.h:273
This structure describes roi data.
Definition: ie_c_api.h:252
size_t sizeX
W size of roi.
Definition: ie_c_api.h:256
size_t id
ID of a roi.
Definition: ie_c_api.h:253
size_t posY
H upper left coordinate of roi.
Definition: ie_c_api.h:255
size_t posX
W upper left coordinate of roi.
Definition: ie_c_api.h:254
size_t sizeY
H size of roi.
Definition: ie_c_api.h:257
Represents detailed information for a tensor.
Definition: ie_c_api.h:195