Added C bindings

This commit is contained in:
Ilya Churaev
2022-07-26 05:12:48 +02:00
parent a8395bd207
commit d2c9ddc263
4 changed files with 37 additions and 2 deletions

View File

@@ -1088,4 +1088,15 @@ INFERENCE_ENGINE_C_API(void) ie_blob_free(ie_blob_t **blob);
/** @} */ // end of Blob
/**
* @brief Shut down the OpenVINO by deleting all static-duration objects allocated by the library and releasing
* dependent resources
*
* @note This function should be used by advanced user to control unload the resources.
*
* You might want to use this function if you are developing a dynamically-loaded library which should clean up all
* resources after itself when the library is unloaded.
*/
INFERENCE_ENGINE_C_API(void) ie_shutdown();
#endif // IE_C_API_H

View File

@@ -1624,3 +1624,7 @@ void ie_blob_free(ie_blob_t **blob) {
*blob = NULL;
}
}
void ie_shutdown() {
InferenceEngine::shutdown();
}

View File

@@ -50,5 +50,15 @@ void regmodule_pyngraph_util(py::module m) {
return ngraph::op::util::get_ie_output_name(output);
});
mod.def("shutdown", &ov::shutdown);
mod.def("shutdown",
&ov::shutdown,
R"(
Shut down the OpenVINO by deleting all static-duration objects allocated by the library and releasing
dependent resources
This function should be used by advanced user to control unload the resources.
You might want to use this function if you are developing a dynamically-loaded library which should clean up all
resources after itself when the library is unloaded.
)");
}

View File

@@ -152,7 +152,17 @@ PYBIND11_MODULE(pyopenvino, m) {
serialize(model, xml_path="./serialized.xml", bin_path="./serialized.bin", version="IR_V11")
)");
m.def("shutdown", &ov::shutdown, R"(Shutdown openvino runtime by try unload libraries)");
m.def("shutdown",
&ov::shutdown,
R"(
Shut down the OpenVINO by deleting all static-duration objects allocated by the library and releasing
dependent resources
This function should be used by advanced user to control unload the resources.
You might want to use this function if you are developing a dynamically-loaded library which should clean up all
resources after itself when the library is unloaded.
)");
regclass_graph_PyRTMap(m);
regmodule_graph_types(m);