Files
openvino/docs/snippets/InferenceEngine_Caching0.cpp
Mikhail Nosov 4a4c3e8ec9 [DOC] Model caching feature overview (#5519)
* Docs: Model caching feature overview

* Update docs/IE_DG/Intro_to_Performance.md

Co-authored-by: Anastasiya Ageeva <anastasiya.ageeva@intel.com>

* Apply suggestions from code review

Co-authored-by: Anastasiya Ageeva <anastasiya.ageeva@intel.com>

* Review comments
- Moved code examples to snippets
- Added link to Model Caching overview from "Inference Engine Developer Guide"
- Few minor changes

* Update docs/IE_DG/Intro_to_Performance.md

Co-authored-by: Anastasiya Ageeva <anastasiya.ageeva@intel.com>

Co-authored-by: Anastasiya Ageeva <anastasiya.ageeva@intel.com>
2021-06-23 09:33:50 +03:00

18 lines
796 B
C++

#include <ie_core.hpp>
int main() {
using namespace InferenceEngine;
std::string modelPath = "/tmp/myModel.xml";
std::string device = "GNA";
std::map<std::string, std::string> deviceConfig;
//! [part0]
InferenceEngine::Core ie; // Step 1: create Inference engine object
ie.SetConfig({{CONFIG_KEY(CACHE_DIR), "myCacheFolder"}}); // Step 1b: Enable caching
auto cnnNet = ie.ReadNetwork(modelPath); // Step 2: ReadNetwork
//... // Step 3: Prepare inputs/outputs
//... // Step 4: Set device configuration
ie.LoadNetwork(cnnNet, device, deviceConfig); // Step 5: LoadNetwork
//! [part0]
return 0;
}