Skip to content

Commit

Permalink
Do not use ONNX reader if ONNX importer was disabled (openvinotoolkit…
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyachur authored and azhogov committed Jun 1, 2020
1 parent 8aeda0a commit fcfc10e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions inference-engine/src/inference_engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ add_library(${TARGET_NAME}_obj OBJECT

target_compile_definitions(${TARGET_NAME}_obj PRIVATE IMPLEMENT_INFERENCE_ENGINE_API)

# TODO: Remove this definitios when readers will be loaded from xml
if(NGRAPH_ONNX_IMPORT_ENABLE)
target_compile_definitions(${TARGET_NAME}_obj PRIVATE ONNX_IMPORT_ENABLE)
endif()

target_include_directories(${TARGET_NAME}_obj SYSTEM PRIVATE $<TARGET_PROPERTY:ngraph::ngraph,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:pugixml,INTERFACE_INCLUDE_DIRECTORIES>)

Expand Down
2 changes: 2 additions & 0 deletions inference-engine/src/inference_engine/ie_network_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,11 @@ void registerReaders() {
std::lock_guard<std::mutex> lock(readerMutex);
if (initialized) return;
// TODO: Read readers info from XML
#ifdef ONNX_IMPORT_ENABLE
auto onnxReader = std::make_shared<Reader>("ONNX", std::string("inference_engine_onnx_reader") + std::string(IE_BUILD_POSTFIX));
readers.emplace("onnx", onnxReader);
readers.emplace("prototxt", onnxReader);
#endif
auto irReader = std::make_shared<Reader>("IR", std::string("inference_engine_ir_reader") + std::string(IE_BUILD_POSTFIX));
readers.emplace("xml", irReader);
initialized = true;
Expand Down

0 comments on commit fcfc10e

Please sign in to comment.