24 #define INFERENCE_ENGINE_C_API_EXTERN extern "C"
26 #define INFERENCE_ENGINE_C_API_EXTERN
29 #if defined(__GNUC__) && (__GNUC__ < 4)
30 #define INFERENCE_ENGINE_C_API(...) INFERENCE_ENGINE_C_API_EXTERN __VA_ARGS__
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
38 #define INFERENCE_ENGINE_C_API(...) INFERENCE_ENGINE_C_API_EXTERN __declspec(dllimport) __VA_ARGS__ __cdecl
42 #define INFERENCE_ENGINE_C_API(...) INFERENCE_ENGINE_C_API_EXTERN __attribute__((visibility("default"))) __VA_ARGS__
43 #define IE_NODISCARD __attribute__((warn_unused_result))
47 #ifndef INFERENCE_ENGINE_C_API_CALLBACK
48 #define INFERENCE_ENGINE_C_API_CALLBACK
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;
104 unsigned int range_for_async_infer_request[3];
105 unsigned int range_for_streams[2];
234 NOT_IMPLEMENTED = -2,
235 NETWORK_NOT_LOADED = -3,
236 PARAMETER_MISMATCH = -4,
244 RESULT_NOT_READY = -9,
246 INFER_NOT_STARTED = -11,
247 NETWORK_NOT_READ = -12,
248 INFER_CANCELLED = -13,
297 void (INFERENCE_ENGINE_C_API_CALLBACK *completeCallBackFunc)(
void *args);
395 const ie_blob_t *weight_blob, ie_network_t **network);
409 const ie_config_t *config, ie_executable_network_t **exe_network);
423 const ie_config_t *config, ie_executable_network_t **exe_network);
554 const char *metric_name,
ie_param_t *param_result);
576 const char *metric_config,
ie_param_t *param_result);
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_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...
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:231
colorformat_e
Extra information about input color format for preprocessing.
Definition: ie_c_api.h:207
@ BGRX
BGRX color format with X ignored during inference.
Definition: ie_c_api.h:212
@ RGB
RGB color format.
Definition: ie_c_api.h:209
@ BGR
BGR color format, default in DLDT.
Definition: ie_c_api.h:210
@ RGBX
RGBX color format with X ignored during inference.
Definition: ie_c_api.h:211
@ NV12
NV12 color format represented as compound Y+UV blob.
Definition: ie_c_api.h:213
@ RAW
Plain blob (default), no extra color processing required.
Definition: ie_c_api.h:208
@ I420
I420 color format represented as compound Y+U+V blob.
Definition: ie_c_api.h:214
precision_e
Precisions that the inference engine supports.
Definition: ie_c_api.h:172
@ U64
Definition: ie_c_api.h:187
@ U8
Definition: ie_c_api.h:181
@ FP32
Definition: ie_c_api.h:175
@ FP64
Definition: ie_c_api.h:177
@ BIN
Definition: ie_c_api.h:189
@ FP16
Definition: ie_c_api.h:176
@ MIXED
Definition: ie_c_api.h:174
@ U32
Definition: ie_c_api.h:188
@ I32
Definition: ie_c_api.h:185
@ Q78
Definition: ie_c_api.h:178
@ I8
Definition: ie_c_api.h:183
@ I16
Definition: ie_c_api.h:179
@ CUSTOM
Definition: ie_c_api.h:190
@ I64
Definition: ie_c_api.h:186
@ UNSPECIFIED
Definition: ie_c_api.h:173
@ I4
Definition: ie_c_api.h:182
@ U16
Definition: ie_c_api.h:184
@ U4
Definition: ie_c_api.h:180
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:221
@ RESIZE_BILINEAR
"Bilinear resize" mode
Definition: ie_c_api.h:223
@ RESIZE_AREA
"Area resize" mode
Definition: ie_c_api.h:224
@ NO_RESIZE
"No resize" mode
Definition: ie_c_api.h:222
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:305
Represents copied data from the given blob.
Definition: ie_c_api.h:285
const void * cbuffer
cbuffer is read-only
Definition: ie_c_api.h:288
void * buffer
buffer can be written
Definition: ie_c_api.h:287
Completion callback definition about the function and args.
Definition: ie_c_api.h:296
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
This structure describes roi data.
Definition: ie_c_api.h:255
size_t sizeX
W size of roi.
Definition: ie_c_api.h:259
size_t id
ID of a roi.
Definition: ie_c_api.h:256
size_t posY
H upper left coordinate of roi.
Definition: ie_c_api.h:258
size_t posX
W upper left coordinate of roi.
Definition: ie_c_api.h:257
size_t sizeY
H size of roi.
Definition: ie_c_api.h:260
Represents detailed information for a tensor.
Definition: ie_c_api.h:197