Data Structures | Macros | Typedefs | Enumerations | Functions
ie_c_api.h File Reference
#include <stdint.h>
#include <stdio.h>

Go to the source code of this file.

Data Structures

struct  ie_version
 Represents an API version information that reflects the set of supported features. More...
 
struct  ie_core_version
 Represents version information that describes devices and the inference engine runtime library. More...
 
struct  ie_core_versions
 Represents all versions information that describes all devices and the inference engine runtime library. More...
 
struct  ie_config
 Represents configuration information that describes devices. More...
 
struct  ie_param
 metric and config parameters. More...
 
struct  ie_param_config
 Represents configuration parameter information. More...
 
struct  desc
 Represents detailed information for an error. More...
 
struct  dimensions
 Represents dimensions for input or output data. More...
 
struct  tensor_desc
 Represents detailed information for a tensor. More...
 
struct  roi
 
struct  input_shape
 Represents shape for input data. More...
 
struct  input_shapes
 Represents shapes for all input data. More...
 
struct  ie_blob_buffer
 Represents copied data from the given blob. More...
 
struct  ie_complete_call_back
 Completion callback definition about the function and args. More...
 
struct  ie_available_devices
 Represent all available devices. More...
 

Macros

#define INFERENCE_ENGINE_C_API_CALLBACK   __cdecl
 

Typedefs

typedef struct ie_core ie_core_t
 
typedef struct ie_network ie_network_t
 
typedef struct ie_executable ie_executable_network_t
 
typedef struct ie_infer_request ie_infer_request_t
 
typedef struct ie_blob ie_blob_t
 
typedef struct ie_version ie_version_t
 
typedef struct ie_core_version ie_core_version_t
 
typedef struct ie_core_versions ie_core_versions_t
 
typedef struct ie_config ie_config_t
 
typedef struct ie_param ie_param_t
 
typedef struct ie_param_config ie_param_config_t
 
typedef struct desc desc_t
 
typedef struct dimensions dimensions_t
 
typedef struct tensor_desc tensor_desc_t
 
typedef struct roi roi_t
 
typedef struct input_shape input_shape_t
 
typedef struct input_shapes input_shapes_t
 
typedef struct ie_blob_buffer ie_blob_buffer_t
 
typedef struct ie_complete_call_back ie_complete_call_back_t
 
typedef struct ie_available_devices ie_available_devices_t
 

Enumerations

enum  layout_e {
  ANY = 0 , NCHW = 1 , NHWC = 2 , NCDHW = 3 ,
  NDHWC = 4 , OIHW = 64 , SCALAR = 95 , C = 96 ,
  CHW = 128 , HW = 192 , NC = 193 , CN = 194 ,
  BLOCKED = 200
}
 Layouts that the inference engine supports. More...
 
enum  precision_e {
  UNSPECIFIED = 255 , MIXED = 0 , FP32 = 10 , FP16 = 11 ,
  FP64 = 13 , Q78 = 20 , I16 = 30 , U4 = 39 ,
  U8 = 40 , I4 = 49 , I8 = 50 , U16 = 60 ,
  I32 = 70 , I64 = 72 , U64 = 73 , U32 = 74 ,
  BIN = 71 , CUSTOM = 80
}
 Precisions that the inference engine supports. More...
 
enum  colorformat_e {
  RAW = 0u , RGB , BGR , RGBX ,
  BGRX , NV12 , I420
}
 Extra information about input color format for preprocessing. More...
 
enum  resize_alg_e { NO_RESIZE = 0 , RESIZE_BILINEAR , RESIZE_AREA }
 Represents the list of supported resize algorithms. More...
 
enum  IEStatusCode {
  OK = 0 , GENERAL_ERROR = -1 , NOT_IMPLEMENTED = -2 , NETWORK_NOT_LOADED = -3 ,
  PARAMETER_MISMATCH = -4 , NOT_FOUND = -5 , OUT_OF_BOUNDS = -6 , UNEXPECTED = -7 ,
  REQUEST_BUSY = -8 , RESULT_NOT_READY = -9 , NOT_ALLOCATED = -10 , INFER_NOT_STARTED = -11 ,
  NETWORK_NOT_READ = -12 , INFER_CANCELLED = -13
}
 This enum contains codes for all possible return values of the interface functions.
 

Functions

ie_version_t ie_c_api_version (void)
 Returns number of version that is exported. Use the ie_version_free() to free memory. More...
 
void ie_version_free (ie_version_t *version)
 Release the memory allocated by ie_c_api_version. More...
 
void ie_param_free (ie_param_t *param)
 Release the memory allocated by ie_param_t. More...
 
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. See RegisterPlugins for more details. Use the ie_core_free() method to free memory. More...
 
void ie_core_free (ie_core_t **core)
 Releases memory occupied by core. More...
 
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 memory. More...
 
void ie_core_versions_free (ie_core_versions_t *vers)
 Releases memory occupied by ie_core_versions. More...
 
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 memory. More...
 
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() method to free memory. More...
 
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 and use them simultaneously (up to the limitation of the hardware resources). Use the ie_exec_network_free() method to free memory. More...
 
IEStatusCode ie_core_load_network_from_file (ie_core_t *core, const char *xml, const char *device_name, const ie_config_t *config, ie_executable_network_t **exe_network)
 Reads model and creates an executable network from IR or ONNX file. Users can create as many networks as they need and use them simultaneously (up to the limitation of the hardware resources). Use the ie_exec_network_free() method to free memory. More...
 
IEStatusCode ie_core_set_config (ie_core_t *core, const ie_config_t *ie_core_config, const char *device_name)
 Sets configuration for device. More...
 
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. More...
 
IEStatusCode ie_core_register_plugins (ie_core_t *core, const char *xml_config_file)
 Registers plugins specified in an ".xml" configuration file. More...
 
IEStatusCode ie_core_unregister_plugin (ie_core_t *core, const char *device_name)
 Unregisters a plugin with a specified device name. More...
 
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. More...
 
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 properties which are executable network agnostic. It can be device name, temperature, other devices-specific values. More...
 
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 can be set via SetConfig method. More...
 
IEStatusCode ie_core_get_available_devices (const ie_core_t *core, ie_available_devices_t *avai_devices)
 Gets available devices for neural network inference. More...
 
void ie_core_available_devices_free (ie_available_devices_t *avai_devices)
 Releases memory occpuied by ie_available_devices_t. More...
 
void ie_exec_network_free (ie_executable_network_t **ie_exec_network)
 Releases memory occupied by ExecutableNetwork. More...
 
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 input and output blobs (that can be changed later). Use the ie_infer_request_free() method to free memory. More...
 
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 which executable network is running or all other properties which cannot be changed dynamically. More...
 
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 run on the Multi device and the configuration parameter is only can be "MULTI_DEVICE_PRIORITIES". More...
 
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 which affects executable network execution. More...
 
void ie_infer_request_free (ie_infer_request_t **infer_request)
 Releases memory occupied by ie_infer_request_t instance. More...
 
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. More...
 
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. More...
 
IEStatusCode ie_infer_request_infer (ie_infer_request_t *infer_request)
 Starts synchronous inference of the infer request and fill outputs. More...
 
IEStatusCode ie_infer_request_infer_async (ie_infer_request_t *infer_request)
 Starts asynchronous inference of the infer request and fill outputs. More...
 
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. More...
 
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 becomes available, whichever comes first. More...
 
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 that created this request. More...
 
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. More...
 
IEStatusCode ie_network_get_name (const ie_network_t *network, char **name)
 Get name of network. More...
 
IEStatusCode ie_network_get_inputs_number (const ie_network_t *network, size_t *size_result)
 Gets number of inputs for the network. More...
 
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. More...
 
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. More...
 
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 loading the network to the device. More...
 
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. More...
 
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 loading the network to the device. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. Use the ie_network_input_shapes_free() method to free memory. More...
 
IEStatusCode ie_network_reshape (ie_network_t *network, const input_shapes_t shapes)
 Run shape inference with new input shapes for the network. More...
 
IEStatusCode ie_network_get_outputs_number (const ie_network_t *network, size_t *size_result)
 Gets number of output for the network. More...
 
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. More...
 
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". More...
 
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". More...
 
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. More...
 
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". More...
 
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. More...
 
void ie_network_input_shapes_free (input_shapes_t *inputShapes)
 Releases memory occupied by input_shapes. More...
 
void ie_network_name_free (char **name)
 Releases momory occupied by input_name or output_name. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
IEStatusCode ie_blob_byte_size (ie_blob_t *blob, int *bsize_result)
 Gets the size of the current Blob in bytes. More...
 
void ie_blob_deallocate (ie_blob_t **blob)
 Releases previously allocated data. More...
 
IEStatusCode ie_blob_get_buffer (const ie_blob_t *blob, ie_blob_buffer_t *blob_buffer)
 Gets access to the allocated memory . More...
 
IEStatusCode ie_blob_get_cbuffer (const ie_blob_t *blob, ie_blob_buffer_t *blob_cbuffer)
 Gets read-only access to the allocated memory. More...
 
IEStatusCode ie_blob_get_dims (const ie_blob_t *blob, dimensions_t *dims_result)
 Gets dimensions of blob's tensor. More...
 
IEStatusCode ie_blob_get_layout (const ie_blob_t *blob, layout_e *layout_result)
 Gets layout of blob's tensor. More...
 
IEStatusCode ie_blob_get_precision (const ie_blob_t *blob, precision_e *prec_result)
 Gets precision of blob's tensor. More...
 
void ie_blob_free (ie_blob_t **blob)
 Releases the memory occupied by the ie_blob_t pointer. More...
 

Detailed Description

C API of Inference Engine bridge unlocks using of OpenVINO Inference Engine library and all its plugins in native applications disabling usage of C++ API. The scope of API covers significant part of C++ API and includes an ability to read model from the disk, modify input and output information to correspond their runtime representation like data types or memory layout, load in-memory model to Inference Engine on different devices including heterogeneous and multi-device modes, manage memory where input and output is allocated and manage inference flow.

Enumeration Type Documentation

◆ colorformat_e

Extra information about input color format for preprocessing.

Enumerator
RAW 

Plain blob (default), no extra color processing required.

RGB 

RGB color format.

BGR 

BGR color format, default in DLDT.

RGBX 

RGBX color format with X ignored during inference.

BGRX 

BGRX color format with X ignored during inference.

NV12 

NV12 color format represented as compound Y+UV blob.

I420 

I420 color format represented as compound Y+U+V blob.

◆ layout_e

enum layout_e

Layouts that the inference engine supports.

Enumerator
ANY 

"ANY" layout

NCHW 

"NCHW" layout

NHWC 

"NHWC" layout

NCDHW 

"NCDHW" layout

NDHWC 

"NDHWC" layout

OIHW 

"OIHW" layout

SCALAR 

"SCALAR" layout

"C" layout

CHW 

"CHW" layout

HW 

"HW" layout

NC 

"NC" layout

CN 

"CN" layout

BLOCKED 

"BLOCKED" layout

◆ precision_e

Precisions that the inference engine supports.

Enumerator
UNSPECIFIED 

Unspecified value. Used by default

MIXED 

Mixed value. Can be received from network. No applicable for tensors

FP32 

32bit floating point value

FP16 

16bit floating point value

FP64 

64bit floating point value

Q78 

16bit specific signed fixed point precision

I16 

16bit signed integer value

U4 

4bit unsigned integer value

U8 

8bit unsigned integer value

I4 

4bit signed integer value

I8 

8bit signed integer value

U16 

16bit unsigned integer value

I32 

32bit signed integer value

I64 

64bit signed integer value

U64 

64bit unsigned integer value

U32 

32bit unsigned integer value

BIN 

1bit integer value

CUSTOM 

custom precision has it's own name and size of elements

◆ resize_alg_e

Represents the list of supported resize algorithms.

Enumerator
NO_RESIZE 

"No resize" mode

RESIZE_BILINEAR 

"Bilinear resize" mode

RESIZE_AREA 

"Area resize" mode

Function Documentation

◆ 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.

Returns
Version number of the API.

◆ ie_param_free()

void ie_param_free ( ie_param_t param)

Release the memory allocated by ie_param_t.

Parameters
paramA pointer to the ie_param_t to free memory.

◆ ie_version_free()

void ie_version_free ( ie_version_t version)

Release the memory allocated by ie_c_api_version.

Parameters
versionA pointer to the ie_version_t to free memory.