Move core components (#8869)
* Moved openvino to src * Moved ngraph and frontends to src * Fixed cmake generation * Moved inference_engine libs to src * Moved C API to src * Fixed CMake generation * Moved readers to tests, snippets and preprocessing to common * Fixed CMake * Moved transformations and lp_transformations * Fixed transformations cmake * Fixed build * Fixed unit-tests and ci paths * Fixed docs * Fixed C API build * Try to fix static build * More clear order * Renamed inference_engine_legacy_api to legacy * Fixed some cmake scripts * Fixed path to legacy * Fixed Myriad plugin * Fixed v7 reader * Fixed plugin.hpp * Fixed developer config * Fixed ie_parallel
This commit is contained in:
parent
9b3e12006f
commit
77f6a0076b
@ -117,9 +117,9 @@ jobs:
|
|||||||
# For running Python API tests
|
# For running Python API tests
|
||||||
python3 -m pip install -r $(REPO_DIR)/inference-engine/ie_bridges/python/src/requirements-dev.txt
|
python3 -m pip install -r $(REPO_DIR)/inference-engine/ie_bridges/python/src/requirements-dev.txt
|
||||||
# For running PaddlePaddle frontend unit tests
|
# For running PaddlePaddle frontend unit tests
|
||||||
python3 -m pip install -r $(REPO_DIR)/ngraph/test/frontend/paddlepaddle/requirements_dev.txt
|
python3 -m pip install -r $(REPO_DIR)/src/core/tests/frontend/paddlepaddle/requirements_dev.txt
|
||||||
# For running ONNX frontend unit tests
|
# For running ONNX frontend unit tests
|
||||||
python3 -m pip install -r $(REPO_DIR)/ngraph/test/requirements_test_onnx.txt
|
python3 -m pip install -r $(REPO_DIR)/src/core/tests/requirements_test_onnx.txt
|
||||||
# For MO unit tests
|
# For MO unit tests
|
||||||
python3 -m pip install -r $(REPO_DIR)/model-optimizer/requirements.txt
|
python3 -m pip install -r $(REPO_DIR)/model-optimizer/requirements.txt
|
||||||
python3 -m pip install -r $(REPO_DIR)/model-optimizer/requirements_dev.txt
|
python3 -m pip install -r $(REPO_DIR)/model-optimizer/requirements_dev.txt
|
||||||
|
@ -86,9 +86,9 @@ jobs:
|
|||||||
# For running Python API tests
|
# For running Python API tests
|
||||||
python3 -m pip install -r $(REPO_DIR)/inference-engine/ie_bridges/python/src/requirements-dev.txt
|
python3 -m pip install -r $(REPO_DIR)/inference-engine/ie_bridges/python/src/requirements-dev.txt
|
||||||
# For running PaddlePaddle frontend unit tests
|
# For running PaddlePaddle frontend unit tests
|
||||||
python3 -m pip install -r $(REPO_DIR)/ngraph/test/frontend/paddlepaddle/requirements_dev.txt
|
python3 -m pip install -r $(REPO_DIR)/src/core/tests/frontend/paddlepaddle/requirements_dev.txt
|
||||||
# For running ONNX frontend unit tests
|
# For running ONNX frontend unit tests
|
||||||
python3 -m pip install -r $(REPO_DIR)/ngraph/test/requirements_test_onnx.txt
|
python3 -m pip install -r $(REPO_DIR)/src/core/tests/requirements_test_onnx.txt
|
||||||
# For MO unit tests
|
# For MO unit tests
|
||||||
python3 -m pip install -r $(REPO_DIR)/model-optimizer/requirements.txt
|
python3 -m pip install -r $(REPO_DIR)/model-optimizer/requirements.txt
|
||||||
python3 -m pip install -r $(REPO_DIR)/model-optimizer/requirements_dev.txt
|
python3 -m pip install -r $(REPO_DIR)/model-optimizer/requirements_dev.txt
|
||||||
|
@ -84,7 +84,7 @@ jobs:
|
|||||||
- script: |
|
- script: |
|
||||||
brew install cython
|
brew install cython
|
||||||
brew install automake
|
brew install automake
|
||||||
python3 -m pip install -r $(REPO_DIR)/ngraph/test/requirements_test_onnx.txt
|
python3 -m pip install -r $(REPO_DIR)/src/core/tests/requirements_test_onnx.txt
|
||||||
# Speed up build
|
# Speed up build
|
||||||
brew install ninja
|
brew install ninja
|
||||||
# Speed up tests
|
# Speed up tests
|
||||||
|
@ -110,9 +110,9 @@ jobs:
|
|||||||
rem For running Python API tests
|
rem For running Python API tests
|
||||||
python -m pip install -r $(REPO_DIR)\inference-engine\ie_bridges\python\src\requirements-dev.txt
|
python -m pip install -r $(REPO_DIR)\inference-engine\ie_bridges\python\src\requirements-dev.txt
|
||||||
rem For running PaddlePaddle frontend unit tests
|
rem For running PaddlePaddle frontend unit tests
|
||||||
python -m pip install -r $(REPO_DIR)\ngraph\test\frontend\paddlepaddle\requirements_dev.txt
|
python -m pip install -r $(REPO_DIR)\src\core\tests\frontend\paddlepaddle\requirements_dev.txt
|
||||||
rem For running ONNX frontend unit tests
|
rem For running ONNX frontend unit tests
|
||||||
python -m pip install -r $(REPO_DIR)\ngraph\test\requirements_test_onnx.txt
|
python -m pip install -r $(REPO_DIR)\src\core\tests\requirements_test_onnx.txt
|
||||||
rem For MO unit tests
|
rem For MO unit tests
|
||||||
python -m pip install -r $(REPO_DIR)\model-optimizer\requirements.txt
|
python -m pip install -r $(REPO_DIR)\model-optimizer\requirements.txt
|
||||||
python -m pip install -r $(REPO_DIR)\model-optimizer\requirements_dev.txt
|
python -m pip install -r $(REPO_DIR)\model-optimizer\requirements_dev.txt
|
||||||
|
@ -92,11 +92,11 @@ ie_cpack_add_component(ngraph_dev REQUIRED DEPENDS ngraph)
|
|||||||
include(cmake/test_model_zoo.cmake)
|
include(cmake/test_model_zoo.cmake)
|
||||||
|
|
||||||
add_subdirectory(thirdparty)
|
add_subdirectory(thirdparty)
|
||||||
add_subdirectory(openvino)
|
add_subdirectory(inference-engine/thirdparty)
|
||||||
add_subdirectory(ngraph)
|
add_subdirectory(inference-engine/src)
|
||||||
add_subdirectory(inference-engine)
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
add_subdirectory(samples)
|
add_subdirectory(samples)
|
||||||
|
add_subdirectory(inference-engine)
|
||||||
include(cmake/extra_modules.cmake)
|
include(cmake/extra_modules.cmake)
|
||||||
add_subdirectory(model-optimizer)
|
add_subdirectory(model-optimizer)
|
||||||
add_subdirectory(docs)
|
add_subdirectory(docs)
|
||||||
|
@ -265,7 +265,7 @@ else()
|
|||||||
reset_deps_cache(OpenCV_DIR)
|
reset_deps_cache(OpenCV_DIR)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(${IE_MAIN_SOURCE_DIR}/cmake/ie_parallel.cmake)
|
include(${OpenVINO_SOURCE_DIR}/cmake/ie_parallel.cmake)
|
||||||
|
|
||||||
if(ENABLE_GNA)
|
if(ENABLE_GNA)
|
||||||
reset_deps_cache(
|
reset_deps_cache(
|
||||||
|
@ -311,7 +311,7 @@ function(ie_generate_plugins_hpp)
|
|||||||
ie_target_link_plugins(inference_engine_s)
|
ie_target_link_plugins(inference_engine_s)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(ie_plugins_hpp "${CMAKE_BINARY_DIR}/inference-engine/src/inference_engine/ie_plugins.hpp")
|
set(ie_plugins_hpp "${CMAKE_BINARY_DIR}/src/inference/ie_plugins.hpp")
|
||||||
set(plugins_hpp_in "${IEDevScripts_DIR}/plugins/plugins.hpp.in")
|
set(plugins_hpp_in "${IEDevScripts_DIR}/plugins/plugins.hpp.in")
|
||||||
|
|
||||||
add_custom_command(OUTPUT "${ie_plugins_hpp}"
|
add_custom_command(OUTPUT "${ie_plugins_hpp}"
|
||||||
|
@ -44,12 +44,12 @@ macro(ie_parse_ci_build_number)
|
|||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(ie_version_hpp "${OpenVINO_SOURCE_DIR}/inference-engine/src/inference_engine/include/ie/ie_version.hpp")
|
set(ie_version_hpp "${OpenVINO_SOURCE_DIR}/src/inference/include/ie/ie_version.hpp")
|
||||||
if(NOT EXISTS ${ie_version_hpp})
|
if(NOT EXISTS ${ie_version_hpp})
|
||||||
message(FATAL_ERROR "File ie_version.hpp with IE_VERSION definitions is not found")
|
message(FATAL_ERROR "File ie_version.hpp with IE_VERSION definitions is not found")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(ov_version_hpp "${OpenVINO_SOURCE_DIR}/ngraph/core/include/openvino/core/version.hpp")
|
set(ov_version_hpp "${OpenVINO_SOURCE_DIR}/src/core/include/openvino/core/version.hpp")
|
||||||
if(NOT EXISTS ${ov_version_hpp})
|
if(NOT EXISTS ${ov_version_hpp})
|
||||||
message(FATAL_ERROR "File openvino/core/version.hpp with OPENVINO_VERSION definitions is not found")
|
message(FATAL_ERROR "File openvino/core/version.hpp with OPENVINO_VERSION definitions is not found")
|
||||||
endif()
|
endif()
|
||||||
|
@ -6,7 +6,7 @@ function(ie_generate_dev_package_config)
|
|||||||
# dummy check that OpenCV is here
|
# dummy check that OpenCV is here
|
||||||
find_package(OpenCV QUIET)
|
find_package(OpenCV QUIET)
|
||||||
|
|
||||||
set(all_dev_targets gflags ie_libraries)
|
set(all_dev_targets gflags ov_runtime_libraries)
|
||||||
foreach(component IN LISTS openvino_export_components)
|
foreach(component IN LISTS openvino_export_components)
|
||||||
# export all targets with prefix and use them during extra modules build
|
# export all targets with prefix and use them during extra modules build
|
||||||
export(TARGETS ${${component}} NAMESPACE IE::
|
export(TARGETS ${${component}} NAMESPACE IE::
|
||||||
@ -102,7 +102,7 @@ openvino_developer_export_targets(COMPONENT ngraph TARGETS ngraph_backend interp
|
|||||||
ie_generate_dev_package_config()
|
ie_generate_dev_package_config()
|
||||||
|
|
||||||
# extra modules must be registered after inference_engine library
|
# extra modules must be registered after inference_engine library
|
||||||
# and all other IE common libraries (ie_libraries) are creared
|
# and all other IE common libraries (ov_runtime_libraries) are creared
|
||||||
# because 'register_extra_modules' creates fake InferenceEngineDeveloperPackageConfig.cmake
|
# because 'register_extra_modules' creates fake InferenceEngineDeveloperPackageConfig.cmake
|
||||||
# with all imported developer targets
|
# with all imported developer targets
|
||||||
register_extra_modules()
|
register_extra_modules()
|
||||||
|
@ -45,7 +45,7 @@ find_dependency(InferenceEngine
|
|||||||
NO_DEFAULT_PATH)
|
NO_DEFAULT_PATH)
|
||||||
|
|
||||||
find_dependency(ngraph
|
find_dependency(ngraph
|
||||||
PATHS "${CMAKE_CURRENT_LIST_DIR}/ngraph"
|
PATHS "${CMAKE_CURRENT_LIST_DIR}/src/core"
|
||||||
NO_CMAKE_FIND_ROOT_PATH
|
NO_CMAKE_FIND_ROOT_PATH
|
||||||
NO_DEFAULT_PATH)
|
NO_DEFAULT_PATH)
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
set_property(GLOBAL PROPERTY JOB_POOLS four_jobs=4)
|
set_property(GLOBAL PROPERTY JOB_POOLS four_jobs=4)
|
||||||
|
|
||||||
function(ov_model_convert SRC DST OUT)
|
function(ov_model_convert SRC DST OUT)
|
||||||
set(onnx_gen_script ${OpenVINO_SOURCE_DIR}/ngraph/test/models/onnx/onnx_prototxt_converter.py)
|
set(onnx_gen_script ${OpenVINO_SOURCE_DIR}/src/core/tests/models/onnx/onnx_prototxt_converter.py)
|
||||||
|
|
||||||
file(GLOB_RECURSE prototxt_models RELATIVE "${SRC}" "${SRC}/*.prototxt")
|
file(GLOB_RECURSE prototxt_models RELATIVE "${SRC}" "${SRC}/*.prototxt")
|
||||||
file(GLOB_RECURSE xml_models RELATIVE "${SRC}" "${SRC}/*.xml")
|
file(GLOB_RECURSE xml_models RELATIVE "${SRC}" "${SRC}/*.xml")
|
||||||
@ -62,8 +62,8 @@ function(ov_model_convert SRC DST OUT)
|
|||||||
set(${OUT} ${files} PARENT_SCOPE)
|
set(${OUT} ${files} PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
ov_model_convert("${CMAKE_CURRENT_SOURCE_DIR}/ngraph/test"
|
ov_model_convert("${CMAKE_CURRENT_SOURCE_DIR}/src/core/tests"
|
||||||
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_model_zoo/ngraph"
|
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_model_zoo/core"
|
||||||
onnx_out_files)
|
onnx_out_files)
|
||||||
|
|
||||||
set(rel_path "inference-engine/tests/functional/plugin/shared/models")
|
set(rel_path "inference-engine/tests/functional/plugin/shared/models")
|
||||||
@ -117,7 +117,7 @@ if(ENABLE_TESTS)
|
|||||||
list(APPEND args --use-feature=2020-resolver)
|
list(APPEND args --use-feature=2020-resolver)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(reqs "${OpenVINO_SOURCE_DIR}/ngraph/test/requirements_test_onnx.txt")
|
set(reqs "${OpenVINO_SOURCE_DIR}/src/core/tests/requirements_test_onnx.txt")
|
||||||
add_custom_target(test_pip_prerequsites ALL
|
add_custom_target(test_pip_prerequsites ALL
|
||||||
"${PYTHON_EXECUTABLE}" -m pip install ${args} -r ${reqs}
|
"${PYTHON_EXECUTABLE}" -m pip install ${args} -r ${reqs}
|
||||||
COMMENT "Install requirements_test.txt"
|
COMMENT "Install requirements_test.txt"
|
||||||
|
@ -65,13 +65,14 @@ function(build_docs)
|
|||||||
set(DOCS_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}")
|
set(DOCS_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}")
|
||||||
set(DOXYGEN_DIR "${OpenVINO_SOURCE_DIR}/docs/doxygen")
|
set(DOXYGEN_DIR "${OpenVINO_SOURCE_DIR}/docs/doxygen")
|
||||||
set(IE_SOURCE_DIR "${OpenVINO_SOURCE_DIR}/inference-engine")
|
set(IE_SOURCE_DIR "${OpenVINO_SOURCE_DIR}/inference-engine")
|
||||||
|
set(OV_INFERENCE_DIR "${OpenVINO_SOURCE_DIR}/src/inference")
|
||||||
set(PYTHON_API_IN "${IE_SOURCE_DIR}/ie_bridges/python/src/openvino/inference_engine/ie_api.pyx")
|
set(PYTHON_API_IN "${IE_SOURCE_DIR}/ie_bridges/python/src/openvino/inference_engine/ie_api.pyx")
|
||||||
set(PYTHON_API_OUT "${DOCS_BUILD_DIR}/python_api/ie_api.pyx")
|
set(PYTHON_API_OUT "${DOCS_BUILD_DIR}/python_api/ie_api.pyx")
|
||||||
set(C_API "${IE_SOURCE_DIR}/ie_bridges/c/include")
|
set(C_API "${OpenVINO_SOURCE_DIR}/bindings/c/include")
|
||||||
set(PLUGIN_API_DIR "${DOCS_BUILD_DIR}/IE_PLUGIN_DG")
|
set(PLUGIN_API_DIR "${DOCS_BUILD_DIR}/IE_PLUGIN_DG")
|
||||||
set(NGRAPH_DIR "${OpenVINO_SOURCE_DIR}/ngraph")
|
set(CORE_DIR "${OpenVINO_SOURCE_DIR}/src/core")
|
||||||
|
set(FRONTENDS_DIR "${OpenVINO_SOURCE_DIR}/src/frontends")
|
||||||
set(NGRAPH_PY_DIR "${OpenVINO_SOURCE_DIR}/src/bindings/python/src/compatibility/ngraph/")
|
set(NGRAPH_PY_DIR "${OpenVINO_SOURCE_DIR}/src/bindings/python/src/compatibility/ngraph/")
|
||||||
set(NGRAPH_CPP_DIR "${NGRAPH_DIR}/core/include/" "${NGRAPH_DIR}/frontend/onnx_import/include")
|
|
||||||
|
|
||||||
# Preprocessing scripts
|
# Preprocessing scripts
|
||||||
set(DOXY_MD_FILTER "${DOXYGEN_DIR}/doxy_md_filter.py")
|
set(DOXY_MD_FILTER "${DOXYGEN_DIR}/doxy_md_filter.py")
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
openvino/samples/cpp/hello_reshape_ssd/README.md
|
openvino/samples/cpp/hello_reshape_ssd/README.md
|
||||||
openvino/docs/index.md
|
openvino/docs/index.md
|
||||||
inference-engine/include/ie_icnn_network.hpp
|
|
||||||
openvino/docs/get_started/get_started_dl_workbench.md
|
openvino/docs/get_started/get_started_dl_workbench.md
|
||||||
openvino/docs/get_started/get_started_linux.md
|
openvino/docs/get_started/get_started_linux.md
|
||||||
openvino/docs/get_started/get_started_raspbian.md
|
openvino/docs/get_started/get_started_raspbian.md
|
||||||
@ -10,29 +9,13 @@ openvino/docs/HOWTO/Custom_Layers_Guide.md
|
|||||||
openvino/docs/install_guides/deployment-manager-tool.md
|
openvino/docs/install_guides/deployment-manager-tool.md
|
||||||
openvino/docs/MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md
|
openvino/docs/MO_DG/prepare_model/customize_model_optimizer/Customize_Model_Optimizer.md
|
||||||
openvino/docs/ovsa/ovsa_get_started.md
|
openvino/docs/ovsa/ovsa_get_started.md
|
||||||
openvino/inference-engine/ie_bridges/c/docs/api_overview.md
|
openvino/src/bindings/c/docs/api_overview.md
|
||||||
inference-engine/include/cpp/ie_infer_request.hpp
|
|
||||||
inference-engine/include/ie_parallel.hpp
|
|
||||||
inference-engine/include/gpu/gpu_context_api_ocl.hpp
|
|
||||||
inference-engine/include/gpu/gpu_context_api_va.hpp
|
|
||||||
inference-engine/include/ie_plugin_config.hpp
|
|
||||||
inference-engine/include/ie_unicode.hpp
|
|
||||||
inference-engine/include/vpu/myriad_config.hpp
|
|
||||||
inference-engine/include/vpu/vpu_config.hpp
|
|
||||||
inference-engine/include/vpu/vpu_plugin_config.hpp
|
|
||||||
openvino/docs/benchmarks/performance_int8_vs_fp32.md
|
openvino/docs/benchmarks/performance_int8_vs_fp32.md
|
||||||
openvino/docs/get_started/get_started_macos.md
|
openvino/docs/get_started/get_started_macos.md
|
||||||
inference-engine/include/details/ie_so_pointer.hpp
|
|
||||||
inference-engine/include/ie_compound_blob.h
|
|
||||||
inference-engine/include/ie_data.h
|
|
||||||
inference-engine/include/ie_blob.h
|
|
||||||
inference-engine/include/ie_precision.hpp
|
|
||||||
inference-engine/include/ie_remote_context.hpp
|
|
||||||
inference-engine/include/gpu/gpu_context_api_dx.hpp
|
|
||||||
build/docs/openvino_docs.xml
|
build/docs/openvino_docs.xml
|
||||||
openvino/docs/install_guides/installing-openvino-linux-ivad-vpu.md
|
openvino/docs/install_guides/installing-openvino-linux-ivad-vpu.md
|
||||||
inference-engine/src/inference_engine/include/ie/ie_parallel.hpp
|
src/inference/include/ie/ie_parallel.hpp
|
||||||
inference-engine/src/inference_engine/include/ie/ie_plugin_config.hpp
|
src/inference/include/ie/ie_plugin_config.hpp
|
||||||
inference-engine/src/inference_engine/include/ie/vpu/myriad_config.hpp
|
src/inference/include/ie/vpu/myriad_config.hpp
|
||||||
inference-engine/src/inference_engine/include/ie/vpu/vpu_config.hpp
|
src/inference/include/ie/vpu/vpu_config.hpp
|
||||||
inference-engine/src/inference_engine/include/ie/vpu/vpu_plugin_config.hpp
|
src/inference/include/ie/vpu/vpu_plugin_config.hpp
|
||||||
|
@ -824,7 +824,7 @@ WARN_LOGFILE = "@DOCS_BUILD_DIR@/ie_docs.log"
|
|||||||
# Note: If this tag is empty the current directory is searched.
|
# Note: If this tag is empty the current directory is searched.
|
||||||
|
|
||||||
INPUT = "@DOCS_BUILD_DIR@" \
|
INPUT = "@DOCS_BUILD_DIR@" \
|
||||||
"@IE_SOURCE_DIR@/src/inference_engine/include"
|
"@OV_INFERENCE_DIR@/include"
|
||||||
|
|
||||||
# This tag can be used to specify the character encoding of the source files
|
# This tag can be used to specify the character encoding of the source files
|
||||||
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
|
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
|
||||||
|
@ -24,9 +24,9 @@ GENERATE_TAGFILE = "@DOCS_BUILD_DIR@/ie_plugin_api.tag"
|
|||||||
EXTRACT_LOCAL_CLASSES = NO
|
EXTRACT_LOCAL_CLASSES = NO
|
||||||
|
|
||||||
INPUT = "@DOCS_BUILD_DIR@/docs/IE_PLUGIN_DG" \
|
INPUT = "@DOCS_BUILD_DIR@/docs/IE_PLUGIN_DG" \
|
||||||
"@IE_SOURCE_DIR@/src/plugin_api" \
|
"@OV_INFERENCE_DIR@/dev_api" \
|
||||||
"@IE_SOURCE_DIR@/src/transformations/include" \
|
"@OpenVINO_SOURCE_DIR@/src/common/transformations/include" \
|
||||||
"@OpenVINO_SOURCE_DIR@/openvino/itt/include/openvino"
|
"@OpenVINO_SOURCE_DIR@/src/common/itt/include/openvino"
|
||||||
|
|
||||||
|
|
||||||
RECURSIVE = YES
|
RECURSIVE = YES
|
||||||
|
@ -28,9 +28,9 @@ FILE_PATTERNS = *.cpp \
|
|||||||
|
|
||||||
LAYOUT_FILE = "@NGRAPH_CPP_LAYOUT_BUILD@"
|
LAYOUT_FILE = "@NGRAPH_CPP_LAYOUT_BUILD@"
|
||||||
|
|
||||||
INPUT = "@NGRAPH_DIR@/core/include/" \
|
INPUT = "@CORE_DIR@/core/include/" \
|
||||||
"@NGRAPH_DIR@/frontend/onnx/frontend/include/" \
|
"@FRONTENDS_DIR@/onnx/frontend/include/" \
|
||||||
"@NGRAPH_DIR@/frontend/paddlepaddle/frontend/include/"
|
"@FRONTENDS_DIR@/paddlepaddle/frontend/include/"
|
||||||
|
|
||||||
HTML_OUTPUT = "@NGRAPH_CPP_OUTPUT@"
|
HTML_OUTPUT = "@NGRAPH_CPP_OUTPUT@"
|
||||||
|
|
||||||
|
@ -4,10 +4,6 @@
|
|||||||
|
|
||||||
project(InferenceEngine)
|
project(InferenceEngine)
|
||||||
|
|
||||||
add_subdirectory(thirdparty)
|
|
||||||
add_subdirectory(src)
|
|
||||||
add_subdirectory(ie_bridges/c)
|
|
||||||
|
|
||||||
if(ENABLE_PYTHON)
|
if(ENABLE_PYTHON)
|
||||||
add_subdirectory(ie_bridges/python)
|
add_subdirectory(ie_bridges/python)
|
||||||
endif()
|
endif()
|
||||||
|
@ -47,7 +47,7 @@ endif()
|
|||||||
# create target for openvino.wheel
|
# create target for openvino.wheel
|
||||||
|
|
||||||
set(openvino_wheel_deps ie_api offline_transformations_api)
|
set(openvino_wheel_deps ie_api offline_transformations_api)
|
||||||
foreach(_target ie_libraries ie_plugins _pyngraph pyopenvino)
|
foreach(_target ov_runtime_libraries ie_plugins _pyngraph pyopenvino)
|
||||||
if(TARGET ${_target})
|
if(TARGET ${_target})
|
||||||
list(APPEND openvino_wheel_deps ${_target})
|
list(APPEND openvino_wheel_deps ${_target})
|
||||||
endif()
|
endif()
|
||||||
|
@ -7,14 +7,8 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
ie_add_compiler_flags(-Wmissing-declarations)
|
ie_add_compiler_flags(-Wmissing-declarations)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory(transformations)
|
|
||||||
|
|
||||||
add_subdirectory(low_precision_transformations)
|
|
||||||
|
|
||||||
add_subdirectory(offline_transformations)
|
add_subdirectory(offline_transformations)
|
||||||
|
|
||||||
add_subdirectory(snippets)
|
|
||||||
|
|
||||||
if(ENABLE_MKL_DNN)
|
if(ENABLE_MKL_DNN)
|
||||||
add_subdirectory(mkldnn_plugin)
|
add_subdirectory(mkldnn_plugin)
|
||||||
endif()
|
endif()
|
||||||
@ -38,42 +32,3 @@ endif()
|
|||||||
if(ENABLE_MULTI)
|
if(ENABLE_MULTI)
|
||||||
add_subdirectory(multi_device)
|
add_subdirectory(multi_device)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory(inference_engine)
|
|
||||||
|
|
||||||
add_subdirectory(legacy_api)
|
|
||||||
|
|
||||||
add_subdirectory(readers)
|
|
||||||
|
|
||||||
add_subdirectory(preprocessing)
|
|
||||||
|
|
||||||
# add a custom target to build all Inference Engine Core libraries
|
|
||||||
|
|
||||||
add_custom_target(ie_libraries ALL
|
|
||||||
DEPENDS inference_engine_transformations inference_engine_legacy
|
|
||||||
inference_engine inference_engine_preproc
|
|
||||||
inference_engine_lp_transformations inference_engine_snippets)
|
|
||||||
|
|
||||||
if(ENABLE_IR_V7_READER)
|
|
||||||
add_dependencies(ie_libraries inference_engine_ir_v7_reader)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NGRAPH_IR_FRONTEND_ENABLE)
|
|
||||||
if(BUILD_SHARED_LIBS)
|
|
||||||
add_dependencies(ie_libraries ir_ov_frontend)
|
|
||||||
endif()
|
|
||||||
# use this one once CVS-69781 is fixed
|
|
||||||
# add_dependencies(inference_engine ir_ov_frontend)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NGRAPH_ONNX_FRONTEND_ENABLE)
|
|
||||||
add_dependencies(inference_engine onnx_ov_frontend)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NGRAPH_PDPD_FRONTEND_ENABLE)
|
|
||||||
add_dependencies(inference_engine paddlepaddle_ov_frontend)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NGRAPH_TF_FRONTEND_ENABLE)
|
|
||||||
add_dependencies(inference_engine tensorflow_ov_frontend)
|
|
||||||
endif()
|
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
# Copyright (C) 2018-2021 Intel Corporation
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
#
|
|
||||||
|
|
||||||
set(TARGET_NAME inference_engine_reader_api)
|
|
||||||
|
|
||||||
# Reader API interface library
|
|
||||||
add_library(${TARGET_NAME} INTERFACE)
|
|
||||||
|
|
||||||
target_include_directories(${TARGET_NAME} INTERFACE
|
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/reader_api>
|
|
||||||
$<TARGET_PROPERTY:inference_engine,INTERFACE_INCLUDE_DIRECTORIES>)
|
|
||||||
|
|
||||||
ov_install_static_lib(${TARGET_NAME} core)
|
|
||||||
|
|
||||||
file(GLOB_RECURSE reader_api_hpp "${CMAKE_CURRENT_SOURCE_DIR}/reader_api/*.hpp")
|
|
||||||
|
|
||||||
add_cpplint_target(${TARGET_NAME}_cpplint FOR_SOURCES ${reader_api_hpp})
|
|
||||||
|
|
||||||
if(ENABLE_IR_V7_READER)
|
|
||||||
add_subdirectory(ir_reader_v7)
|
|
||||||
endif()
|
|
@ -21,7 +21,8 @@
|
|||||||
#include <vpu/ngraph/operations/dynamic_shape_resolver.hpp>
|
#include <vpu/ngraph/operations/dynamic_shape_resolver.hpp>
|
||||||
#include <vpu/ngraph/transformations/dynamic_to_static_shape.hpp>
|
#include <vpu/ngraph/transformations/dynamic_to_static_shape.hpp>
|
||||||
#include <ngraph/opsets/opset3.hpp>
|
#include <ngraph/opsets/opset3.hpp>
|
||||||
#include "../../../ngraph/core/include/openvino/core/interval.hpp"
|
// FIXME: Please remove relative path
|
||||||
|
#include "../../../src/core/include/openvino/core/interval.hpp"
|
||||||
|
|
||||||
using namespace InferenceEngine;
|
using namespace InferenceEngine;
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ function(ie_headers_compilation_with_custom_flags)
|
|||||||
"${OpenVINO_SOURCE_DIR}/inference-engine/src/plugin_api/")
|
"${OpenVINO_SOURCE_DIR}/inference-engine/src/plugin_api/")
|
||||||
else()
|
else()
|
||||||
set(include_dirs
|
set(include_dirs
|
||||||
"${OpenVINO_SOURCE_DIR}/ngraph/core/include"
|
"${OpenVINO_SOURCE_DIR}/src/core/include"
|
||||||
"${OpenVINO_SOURCE_DIR}/inference-engine/src/inference_engine/include/ie"
|
"${OpenVINO_SOURCE_DIR}/inference-engine/src/inference_engine/include/ie"
|
||||||
"${OpenVINO_SOURCE_DIR}/inference-engine/src/inference_engine/include/")
|
"${OpenVINO_SOURCE_DIR}/inference-engine/src/inference_engine/include/")
|
||||||
endif()
|
endif()
|
||||||
|
@ -8,6 +8,7 @@ if(NOT MSVC)
|
|||||||
ie_add_compiler_flags(-Wno-unused-variable)
|
ie_add_compiler_flags(-Wno-unused-variable)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
add_subdirectory(readers)
|
||||||
add_subdirectory(helpers)
|
add_subdirectory(helpers)
|
||||||
|
|
||||||
if (ENABLE_GAPI_TESTS)
|
if (ENABLE_GAPI_TESTS)
|
||||||
|
8
inference-engine/tests_deprecated/readers/CMakeLists.txt
Normal file
8
inference-engine/tests_deprecated/readers/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# Copyright (C) 2018-2021 Intel Corporation
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
|
if(ENABLE_IR_V7_READER)
|
||||||
|
add_subdirectory(ir_reader_v7)
|
||||||
|
add_dependencies(ov_runtime_libraries inference_engine_ir_v7_reader)
|
||||||
|
endif()
|
@ -34,7 +34,7 @@ target_compile_definitions(${TARGET_NAME} PRIVATE IMPLEMENT_INFERENCE_ENGINE_PLU
|
|||||||
|
|
||||||
target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/")
|
target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/")
|
||||||
|
|
||||||
target_link_libraries(${TARGET_NAME} PRIVATE inference_engine_reader_api inference_engine_plugin_api
|
target_link_libraries(${TARGET_NAME} PRIVATE inference_engine_plugin_api
|
||||||
inference_engine_legacy pugixml::static openvino::itt)
|
inference_engine_legacy pugixml::static openvino::itt)
|
||||||
|
|
||||||
ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
|
ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME})
|
@ -2,13 +2,13 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "ie_reader.hpp"
|
|
||||||
#include "ie_ir_parser.hpp"
|
#include "ie_ir_parser.hpp"
|
||||||
#include "ie_cnn_net_reader_impl.h"
|
#include "ie_cnn_net_reader_impl.h"
|
||||||
|
#include "legacy/ie_reader.hpp"
|
||||||
|
|
||||||
using namespace InferenceEngine;
|
using namespace InferenceEngine;
|
||||||
|
|
||||||
IRParser::IRParser(size_t version): IRParser(version, {}) {}
|
IRParser::IRParser(size_t version) : IRParser(version, {}) {}
|
||||||
IRParser::IRParser(size_t version, const std::vector<InferenceEngine::IExtensionPtr>& exts) {
|
IRParser::IRParser(size_t version, const std::vector<InferenceEngine::IExtensionPtr>& exts) {
|
||||||
if (version < 10) {
|
if (version < 10) {
|
||||||
parser = std::make_shared<CNNParser>();
|
parser = std::make_shared<CNNParser>();
|
||||||
@ -29,29 +29,25 @@ class WeightsHolderBlob : public TBlob<uint8_t> {
|
|||||||
Blob::CPtr originBlob;
|
Blob::CPtr originBlob;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit WeightsHolderBlob(const Blob::CPtr& weights) :
|
explicit WeightsHolderBlob(const Blob::CPtr& weights)
|
||||||
TBlob<uint8_t>(weights->getTensorDesc(),
|
: TBlob<uint8_t>(weights->getTensorDesc(), weights->cbuffer().as<uint8_t*>()), originBlob(weights) {}
|
||||||
weights->cbuffer().as<uint8_t*>()),
|
|
||||||
originBlob(weights) { }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
CNNNetwork CNNParser::parse(const pugi::xml_node& root, const Blob::CPtr& weights) {
|
CNNNetwork CNNParser::parse(const pugi::xml_node& root, const Blob::CPtr& weights) {
|
||||||
details::CNNNetReaderImpl reader(std::make_shared<details::V2FormatParserCreator>());
|
details::CNNNetReaderImpl reader(std::make_shared<details::V2FormatParserCreator>());
|
||||||
ResponseDesc resp;
|
ResponseDesc resp;
|
||||||
StatusCode ret = reader.ReadNetwork(root, &resp);
|
StatusCode ret = reader.ReadNetwork(root, &resp);
|
||||||
if (ret != OK)
|
if (ret != OK) IE_THROW() << resp.msg;
|
||||||
IE_THROW() << resp.msg;
|
|
||||||
|
|
||||||
TBlob<uint8_t>::Ptr weightsPtr;
|
TBlob<uint8_t>::Ptr weightsPtr;
|
||||||
|
|
||||||
if (weights != nullptr) {
|
if (weights != nullptr) {
|
||||||
weightsPtr = TBlob<uint8_t>::Ptr(new WeightsHolderBlob(weights));
|
weightsPtr = TBlob<uint8_t>::Ptr(new WeightsHolderBlob(weights));
|
||||||
} else {
|
} else {
|
||||||
weightsPtr = std::make_shared<TBlob<uint8_t>>(TensorDesc(Precision::U8, { 0 }, Layout::C));
|
weightsPtr = std::make_shared<TBlob<uint8_t>>(TensorDesc(Precision::U8, {0}, Layout::C));
|
||||||
weightsPtr->allocate();
|
weightsPtr->allocate();
|
||||||
}
|
}
|
||||||
ret = reader.SetWeights(weightsPtr, &resp);
|
ret = reader.SetWeights(weightsPtr, &resp);
|
||||||
if (ret != OK)
|
if (ret != OK) IE_THROW() << resp.msg;
|
||||||
IE_THROW() << resp.msg;
|
|
||||||
return reader.getNetwork();
|
return reader.getNetwork();
|
||||||
}
|
}
|
@ -5,7 +5,7 @@
|
|||||||
#include <xml_parse_utils.h>
|
#include <xml_parse_utils.h>
|
||||||
|
|
||||||
#include "openvino/runtime/common.hpp"
|
#include "openvino/runtime/common.hpp"
|
||||||
#include <ie_ir_version.hpp>
|
#include <legacy/ie_ir_version.hpp>
|
||||||
#include <ie_ir_reader.hpp>
|
#include <ie_ir_reader.hpp>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
@ -9,7 +9,7 @@
|
|||||||
#include <ie_common.h>
|
#include <ie_common.h>
|
||||||
#include <ie_iextension.h>
|
#include <ie_iextension.h>
|
||||||
|
|
||||||
#include <ie_reader.hpp>
|
#include <legacy/ie_reader.hpp>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -25,7 +25,7 @@ namespace InferenceEngine {
|
|||||||
/**
|
/**
|
||||||
* @brief This class is the main interface to build and parse a network from a given IR
|
* @brief This class is the main interface to build and parse a network from a given IR
|
||||||
*/
|
*/
|
||||||
class IRReader: public IReader {
|
class IRReader : public IReader {
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief Checks that reader supports format of the model
|
* @brief Checks that reader supports format of the model
|
||||||
@ -49,7 +49,9 @@ public:
|
|||||||
*
|
*
|
||||||
* @return CNNNetwork
|
* @return CNNNetwork
|
||||||
*/
|
*/
|
||||||
CNNNetwork read(std::istream& model, const Blob::CPtr& weights, const std::vector<IExtensionPtr>& exts) const override;
|
CNNNetwork read(std::istream& model,
|
||||||
|
const Blob::CPtr& weights,
|
||||||
|
const std::vector<IExtensionPtr>& exts) const override;
|
||||||
|
|
||||||
std::vector<std::string> getDataFileExtensions() const override {
|
std::vector<std::string> getDataFileExtensions() const override {
|
||||||
return {"bin"};
|
return {"bin"};
|
123
ngraph/.gitignore
vendored
123
ngraph/.gitignore
vendored
@ -1,123 +0,0 @@
|
|||||||
# Compiled Object files
|
|
||||||
*.slo
|
|
||||||
*.lo
|
|
||||||
*.o
|
|
||||||
*.obj
|
|
||||||
*.pyc
|
|
||||||
|
|
||||||
# Precompiled Headers
|
|
||||||
*.gch
|
|
||||||
*.pch
|
|
||||||
|
|
||||||
# Compiled Dynamic libraries
|
|
||||||
*.so
|
|
||||||
*.dylib
|
|
||||||
*.dll
|
|
||||||
|
|
||||||
*.db
|
|
||||||
|
|
||||||
# Fortran module files
|
|
||||||
*.mod
|
|
||||||
|
|
||||||
# Compiled Static libraries
|
|
||||||
*.lai
|
|
||||||
*.la
|
|
||||||
*.a
|
|
||||||
*.lib
|
|
||||||
|
|
||||||
# Executables
|
|
||||||
*.exe
|
|
||||||
*.out
|
|
||||||
*.app
|
|
||||||
|
|
||||||
# QT Creator
|
|
||||||
*.creator
|
|
||||||
*.config
|
|
||||||
*.files
|
|
||||||
*.includes
|
|
||||||
*.creator.user*
|
|
||||||
*.autosave
|
|
||||||
|
|
||||||
.DS_Store
|
|
||||||
@eaDir/
|
|
||||||
.d/
|
|
||||||
bin/
|
|
||||||
*.log
|
|
||||||
output/
|
|
||||||
*.png
|
|
||||||
*.jpg
|
|
||||||
*.mp2
|
|
||||||
*.mpg
|
|
||||||
*.cpio
|
|
||||||
*.wav
|
|
||||||
*.backup
|
|
||||||
doc/source/generated
|
|
||||||
.cache/
|
|
||||||
nervana_aeon.egg-info/
|
|
||||||
*.xsd
|
|
||||||
*.xslt
|
|
||||||
.vscode
|
|
||||||
|
|
||||||
# emacs
|
|
||||||
*~
|
|
||||||
|
|
||||||
# vim
|
|
||||||
*.swp
|
|
||||||
*.swo
|
|
||||||
tags
|
|
||||||
|
|
||||||
build/
|
|
||||||
scripts/
|
|
||||||
|
|
||||||
# makeenv and test intermediate files
|
|
||||||
tmp/
|
|
||||||
|
|
||||||
# Apple
|
|
||||||
*.AppleDouble
|
|
||||||
|
|
||||||
config_args.txt
|
|
||||||
.nfs*
|
|
||||||
venv/
|
|
||||||
.vscode/
|
|
||||||
.vs/
|
|
||||||
|
|
||||||
# VisualGDB files
|
|
||||||
VisualGDB/
|
|
||||||
toolchain.cmake
|
|
||||||
|
|
||||||
# docbuild artifacts
|
|
||||||
doc/sphinx/build/*
|
|
||||||
doc/doxygen/*.xml
|
|
||||||
doc/doxygen/*.html
|
|
||||||
doc/doxygen/man/*
|
|
||||||
doc/doxygen/latex/*
|
|
||||||
doc/doxygen/xml/*
|
|
||||||
doc/doxygen/html/*
|
|
||||||
|
|
||||||
|
|
||||||
# python venv things that might get added accidentally
|
|
||||||
../
|
|
||||||
python-wheels/
|
|
||||||
.whl
|
|
||||||
*.whl
|
|
||||||
.venv
|
|
||||||
|
|
||||||
# python wheels
|
|
||||||
python/share/*
|
|
||||||
|
|
||||||
# git merge
|
|
||||||
*.orig
|
|
||||||
\#*
|
|
||||||
\.#*
|
|
||||||
|
|
||||||
# remnants from a failed in-source build
|
|
||||||
CMakeCache.txt
|
|
||||||
CMakeFiles/
|
|
||||||
CMakeSettings.json
|
|
||||||
|
|
||||||
# don't add dot-save files!
|
|
||||||
|
|
||||||
.save
|
|
||||||
|
|
||||||
# YouCompleteMe
|
|
||||||
.ycm_extra_conf.py
|
|
@ -1,31 +0,0 @@
|
|||||||
# Copyright (C) 2018-2021 Intel Corporation
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
#
|
|
||||||
|
|
||||||
if(ENABLE_LTO)
|
|
||||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(NGRAPH_INCLUDE_PATH
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/core/include
|
|
||||||
)
|
|
||||||
|
|
||||||
project (ngraph)
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------------------------
|
|
||||||
# Installation logic...
|
|
||||||
#-----------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
set(NGRAPH_TARGETS_FILE "${CMAKE_CURRENT_BINARY_DIR}/ngraphTargets.cmake")
|
|
||||||
|
|
||||||
add_definitions(-DPROJECT_ROOT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------------------------
|
|
||||||
# External projects install directory
|
|
||||||
#-----------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
add_subdirectory(core)
|
|
||||||
|
|
||||||
add_subdirectory(frontend)
|
|
||||||
|
|
||||||
add_subdirectory(test)
|
|
@ -1,16 +0,0 @@
|
|||||||
# Environment Variables
|
|
||||||
|
|
||||||
| Name | Default | Description |
|
|
||||||
| ------------------------------------|:---:| --- |
|
|
||||||
| NGRAPH_ENABLE_REPLACE_CHECK | |
|
|
||||||
| NGRAPH_ENABLE_TRACING | |
|
|
||||||
| NGRAPH_ENABLE_VISUALIZE_TRACING | |
|
|
||||||
| NGRAPH_FAIL_MATCH_AT | |
|
|
||||||
| NGRAPH_GRAPH_REWRITE_RERUN_DYNAMIC_CHECK | |
|
|
||||||
| NGRAPH_GTEST_INFO | |
|
|
||||||
| NGRAPH_PROFILE_PASS_ENABLE | |
|
|
||||||
| NGRAPH_VISUALIZE_EDGE_JUMP_DISTANCE | |
|
|
||||||
| NGRAPH_VISUALIZE_EDGE_LABELS | |
|
|
||||||
| NGRAPH_VISUALIZE_TRACING_FORMAT | |
|
|
||||||
| NGRAPH_VISUALIZE_TREE_OUTPUT_SHAPES | |
|
|
||||||
| NGRAPH_VISUALIZE_TREE_OUTPUT_TYPES | |
|
|
@ -1,24 +0,0 @@
|
|||||||
These test executes 'unit-test'.
|
|
||||||
|
|
||||||
To run please do the following:
|
|
||||||
1. To run tests required installing some dependencies:
|
|
||||||
- pip3 install -r requirements.txt
|
|
||||||
2. Set environment variable:
|
|
||||||
a. Required:
|
|
||||||
export PATH_TO_EXE=<path where nGraph unit-test locates>
|
|
||||||
3. To run all tests:
|
|
||||||
a. cd folder where unit_test_executable.py locates
|
|
||||||
b. pytest --gtest_filter="*"
|
|
||||||
4. To run exact test:
|
|
||||||
a. cd folder where unit_test_executable.py locates
|
|
||||||
b. pytest --gtest_filter="<your test name>"
|
|
||||||
5. To get html report add "--html=report.html" to pytest cmd line
|
|
||||||
(but before install this module "pip install pytest-html")
|
|
||||||
6.This test get result of opset1 operation (passed and failed) and also creates csv file 'nodes_coverage.csv' and
|
|
||||||
'nodes_coverage.html' after execution. Here you may find name of operations and its passrate and coverage
|
|
||||||
for several plugins.
|
|
||||||
Example:
|
|
||||||
Operation | GPU passed / total | CPU passed / total
|
|
||||||
Abs | 1/2 | 1/2
|
|
||||||
|
|
||||||
Here operation 'Abs': 1 test of 2 passed on GPU and CPU
|
|
@ -1,96 +0,0 @@
|
|||||||
# Copyright (C) 2018-2021 Intel Corporation
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
import logging as log
|
|
||||||
import sys
|
|
||||||
import subprocess
|
|
||||||
import os
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
|
|
||||||
def pytest_addoption(parser):
|
|
||||||
parser.addoption(
|
|
||||||
"--gtest_filter",
|
|
||||||
help="Attributes to gtest",
|
|
||||||
type=str,
|
|
||||||
required=True,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
|
||||||
def gtest_filter(request):
|
|
||||||
return request.config.getoption('gtest_filter')
|
|
||||||
|
|
||||||
|
|
||||||
def shell(cmd, env=None):
|
|
||||||
"""
|
|
||||||
Run command execution in specified environment
|
|
||||||
:param cmd: list containing command and its parameters
|
|
||||||
:param env: set of environment variables to set for this command
|
|
||||||
:return:
|
|
||||||
"""
|
|
||||||
if sys.platform.startswith('linux') or sys.platform == 'darwin':
|
|
||||||
cmd = ['/bin/bash', '-c', "unset OMP_NUM_THREADS; " + cmd]
|
|
||||||
else:
|
|
||||||
cmd = " ".join(cmd)
|
|
||||||
|
|
||||||
sys.stdout.write("Running command:\n" + "".join(cmd) + "\n")
|
|
||||||
p = subprocess.Popen(cmd, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
|
|
||||||
universal_newlines=True)
|
|
||||||
stdout = []
|
|
||||||
while True:
|
|
||||||
line = p.stdout.readline()
|
|
||||||
stdout.append(line)
|
|
||||||
print(line.rstrip())
|
|
||||||
if line == '' and p.poll() != None:
|
|
||||||
break
|
|
||||||
return p.returncode, ''.join(stdout)
|
|
||||||
|
|
||||||
|
|
||||||
def create_list_test(stdout):
|
|
||||||
# Example of stdout content:
|
|
||||||
# 'CPU'
|
|
||||||
# ' zero_sized_abs'
|
|
||||||
# ' zero_sized_ceiling'
|
|
||||||
# ...
|
|
||||||
# So, list of test will be concatenation of 'CPU' and the second part (starting with ' '):
|
|
||||||
# 'CPU.zero_sized_abs'
|
|
||||||
# 'CPU.zero_sized_ceiling'
|
|
||||||
list_test = []
|
|
||||||
first_name, second_name = [''] * 2
|
|
||||||
for line in stdout:
|
|
||||||
if not line.startswith(' '):
|
|
||||||
first_name = line
|
|
||||||
else:
|
|
||||||
second_name = line
|
|
||||||
# Several test has gtest mark 'DISABLED' inside test - no test will be executed
|
|
||||||
if not 'DISABLED' in line:
|
|
||||||
list_test.append(first_name + second_name.strip())
|
|
||||||
return list_test
|
|
||||||
|
|
||||||
|
|
||||||
def pytest_generate_tests(metafunc):
|
|
||||||
gtest_filter = metafunc.config.getoption(name='gtest_filter')
|
|
||||||
if 'gtest_filter' in metafunc.fixturenames and gtest_filter is not None:
|
|
||||||
executable = os.path.join(os.environ.get('PATH_TO_EXE'), "unit-test")
|
|
||||||
cmd_line = executable + ' --gtest_filter=' + gtest_filter + ' --gtest_list_tests'
|
|
||||||
log.info('Executing {} for getting list of test'.format(executable))
|
|
||||||
retcode, stdout = shell(cmd=cmd_line)
|
|
||||||
assert retcode == 0, "unit-test --gtest_list_tests execution failed. Return code: {}".format(retcode)
|
|
||||||
stdout = stdout.split('\n')
|
|
||||||
list_test = create_list_test(stdout)
|
|
||||||
|
|
||||||
# Find all opset1 operations: execute test 'opset.dump'
|
|
||||||
cmd_line_all_op = executable + ' --gtest_filter=opset.dump'
|
|
||||||
log.info('Executing {} for getting list of test'.format(cmd_line_all_op))
|
|
||||||
retcode_op1, stdout_op1 = shell(cmd=cmd_line_all_op)
|
|
||||||
assert retcode_op1 == 0, "unit-test --gtest_filter=opset.dump execution failed. Return code: {}".format(retcode)
|
|
||||||
# Parsing stdout to storing name of opset1 operations
|
|
||||||
stdout_op1 = stdout_op1.split('\n')
|
|
||||||
operation_opset1 = []
|
|
||||||
for line in stdout_op1:
|
|
||||||
if 'All opset1 operations:' in line:
|
|
||||||
operation_opset1 = list(set(line.replace('All opset1 operations:', '').strip().split(' ')))
|
|
||||||
for op in operation_opset1:
|
|
||||||
pytest.operation_dictionary[op] = {}
|
|
||||||
metafunc.parametrize(argnames="gtest_filter", argvalues=list_test)
|
|
@ -1 +0,0 @@
|
|||||||
pytest
|
|
@ -1,143 +0,0 @@
|
|||||||
# Copyright (C) 2018-2021 Intel Corporation
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
import logging as log
|
|
||||||
import sys
|
|
||||||
import os
|
|
||||||
import csv
|
|
||||||
import pytest
|
|
||||||
import re
|
|
||||||
from conftest import shell
|
|
||||||
|
|
||||||
log.basicConfig(format="[ %(levelname)s ] %(msg)s", stream=sys.stdout, level=log.INFO)
|
|
||||||
|
|
||||||
pytest.operation_dictionary = {}
|
|
||||||
pytest.avaliable_plugins = []
|
|
||||||
|
|
||||||
|
|
||||||
def save_coverage_to_csv(csv_path, header):
|
|
||||||
with open(csv_path, 'w', newline='') as f:
|
|
||||||
csv_writer = csv.writer(f, delimiter='|', quotechar='|', quoting=csv.QUOTE_MINIMAL)
|
|
||||||
csv_writer.writerow(i for i in header)
|
|
||||||
i = 1
|
|
||||||
for key in sorted(pytest.operation_dictionary):
|
|
||||||
line = [i, key]
|
|
||||||
for plugin in pytest.avaliable_plugins:
|
|
||||||
if not plugin in pytest.operation_dictionary[key]:
|
|
||||||
line.append('0/0')
|
|
||||||
else:
|
|
||||||
line.append('/'.join(str(x) for x in pytest.operation_dictionary[key][plugin]))
|
|
||||||
csv_writer.writerow(line)
|
|
||||||
i += 1
|
|
||||||
|
|
||||||
|
|
||||||
def get_color(value):
|
|
||||||
if '/' in value:
|
|
||||||
passed, total = [int(x.strip()) for x in value.split('/')]
|
|
||||||
if passed == total and total != 0:
|
|
||||||
return "#d1ffd3"
|
|
||||||
elif passed == total and total == 0:
|
|
||||||
return "#dadada"
|
|
||||||
else:
|
|
||||||
return "#ffdbdb"
|
|
||||||
else:
|
|
||||||
return "white"
|
|
||||||
|
|
||||||
|
|
||||||
def csv_to_html_table(csv_path, html_path, headers=None, delimiter=","):
|
|
||||||
with open(csv_path) as f:
|
|
||||||
content = f.readlines()
|
|
||||||
|
|
||||||
# reading file content into list
|
|
||||||
rows = [x.strip() for x in content]
|
|
||||||
table = "<!DOCTYPE html><html><head><title>Opset1 operations results</title></head><body><table border=1>"
|
|
||||||
|
|
||||||
# creating HTML header row if header is provided
|
|
||||||
if headers is not None:
|
|
||||||
table += "<tr>"
|
|
||||||
table += "".join(["<th>" + cell + "</th>" for cell in headers])
|
|
||||||
table += "</tr>"
|
|
||||||
else:
|
|
||||||
table += "<tr>"
|
|
||||||
table += "".join(["<th>" + cell + "</th>" for cell in rows[0].split(delimiter)])
|
|
||||||
table += "</tr>"
|
|
||||||
rows = rows[1:]
|
|
||||||
|
|
||||||
# Converting csv to html row by row
|
|
||||||
for row in rows:
|
|
||||||
table += "<tr>" + "".join(["<td style=background-color:%s>" % (get_color(cell)) + cell + "</td>"
|
|
||||||
for cell in row.split(delimiter)]) + "</tr>" + "\n"
|
|
||||||
table += "</table></body></html><br>"
|
|
||||||
|
|
||||||
# Saving html file
|
|
||||||
fh = open(html_path, "w")
|
|
||||||
fh.write(table)
|
|
||||||
fh.close()
|
|
||||||
|
|
||||||
|
|
||||||
def setup_module():
|
|
||||||
try:
|
|
||||||
os.environ.get('PATH_TO_EXE')
|
|
||||||
except KeyError:
|
|
||||||
raise ImportError('PATH_TO_EXE is upsent in your environment variables. '
|
|
||||||
'Please, do "export PATH_TO_EXE=<path to unit-test>')
|
|
||||||
|
|
||||||
|
|
||||||
def teardown_module():
|
|
||||||
"""
|
|
||||||
Creating CSV file at the end of test with nGraph nodes coverage
|
|
||||||
:return:
|
|
||||||
"""
|
|
||||||
csv_path = "nodes_coverage.csv"
|
|
||||||
header = ["#", "Operation"] + [p + " passed / total" for p in pytest.avaliable_plugins]
|
|
||||||
save_coverage_to_csv(csv_path=csv_path, header=header)
|
|
||||||
|
|
||||||
# Convert csv file to html for better visualization
|
|
||||||
html_path = "nodes_coverage.html"
|
|
||||||
csv_to_html_table(csv_path=csv_path, html_path=html_path, delimiter="|")
|
|
||||||
|
|
||||||
|
|
||||||
def test(gtest_filter):
|
|
||||||
executable = os.path.join(os.environ.get('PATH_TO_EXE'), "unit-test")
|
|
||||||
cmd_line = executable + ' --gtest_filter=' + gtest_filter
|
|
||||||
retcode, stdout = shell(cmd=cmd_line)
|
|
||||||
|
|
||||||
# Parsing output of single test
|
|
||||||
stdout = stdout.split('\n')
|
|
||||||
nodes_list = []
|
|
||||||
for line in stdout:
|
|
||||||
if 'UNSUPPORTED OPS DETECTED!' in line:
|
|
||||||
pytest.skip('Skip from pytest because unit-test send error UNSUPPORTED OPS DETECTED!')
|
|
||||||
elif 'Nodes in test:' in line:
|
|
||||||
nodes_list = list(set(line.replace('Nodes in test:', '').strip().split(' ')))
|
|
||||||
|
|
||||||
if not nodes_list:
|
|
||||||
pytest.skip('Skip from pytest because inside test no one ngraph function created')
|
|
||||||
|
|
||||||
# Added one more loop, because condition below must be executed only if some nodes_list found
|
|
||||||
# (it means that test includes opset1 operations)
|
|
||||||
for line in stdout:
|
|
||||||
if re.match('.*1 test from\s([A-Z]+)', line):
|
|
||||||
matches = re.search(r'.*1 test from\s([A-Z]+)', line)
|
|
||||||
plugin = matches.group(1)
|
|
||||||
if plugin not in pytest.avaliable_plugins:
|
|
||||||
pytest.avaliable_plugins.append(plugin)
|
|
||||||
|
|
||||||
# Filling dictionary with operation coverage
|
|
||||||
# How many time one operation is tested
|
|
||||||
for n in nodes_list:
|
|
||||||
if plugin in pytest.operation_dictionary[n]:
|
|
||||||
numerator, denominator = pytest.operation_dictionary[n][plugin]
|
|
||||||
pytest.operation_dictionary[n][plugin] = (numerator if retcode != 0 else numerator + 1,
|
|
||||||
denominator + 1)
|
|
||||||
else:
|
|
||||||
pytest.operation_dictionary[n][plugin] = (0, 1) if retcode != 0 else (1, 1)
|
|
||||||
|
|
||||||
# This check is at the end, because with 99% it will return 0 or 1 (when function check of test failed)
|
|
||||||
# Because the same cmd line executed by pytest_generate_tests with --gtest_list_tests.
|
|
||||||
# So, most of the issue cached there.
|
|
||||||
assert retcode == 0, "unit-test execution failed. Gtest failed. Return code: {}".format(retcode)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
log.warning("Please run {} by pytest like so:\npytest {} --gtest_filter=<attributes for gtest_filter>")
|
|
@ -1,9 +0,0 @@
|
|||||||
# Copyright (C) 2018-2021 Intel Corporation
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
#
|
|
||||||
|
|
||||||
add_subdirectory(itt)
|
|
||||||
add_subdirectory(conditional_compilation)
|
|
||||||
add_subdirectory(util)
|
|
||||||
|
|
||||||
openvino_developer_export_targets(COMPONENT openvino_common TARGETS openvino::itt openvino::conditional_compilation)
|
|
@ -2,6 +2,44 @@
|
|||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
#
|
#
|
||||||
|
|
||||||
if(ENABLE_PYTHON)
|
if(ENABLE_LTO)
|
||||||
add_subdirectory(bindings/python)
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON)
|
||||||
|
endif()
|
||||||
|
add_definitions(-DPROJECT_ROOT_DIR="${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
|
|
||||||
|
add_custom_target(ov_runtime_libraries ALL)
|
||||||
|
|
||||||
|
# TODO: Fix Wall for core, frontends, tests and c binding
|
||||||
|
add_subdirectory(core)
|
||||||
|
add_subdirectory(frontends)
|
||||||
|
# TODO: remove ngraph/ngraph.hpp usage
|
||||||
|
add_subdirectory(core/tests)
|
||||||
|
add_subdirectory(bindings)
|
||||||
|
|
||||||
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
ie_add_compiler_flags(-Wall)
|
||||||
|
ie_add_compiler_flags(-Wmissing-declarations)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
add_subdirectory(inference)
|
||||||
|
add_subdirectory(common)
|
||||||
|
|
||||||
|
|
||||||
|
if(NGRAPH_IR_FRONTEND_ENABLE)
|
||||||
|
if(BUILD_SHARED_LIBS)
|
||||||
|
add_dependencies(ov_runtime_libraries ir_ov_frontend)
|
||||||
|
endif()
|
||||||
|
# use this one once CVS-69781 is fixed
|
||||||
|
# add_dependencies(inference_engine ir_ov_frontend)
|
||||||
|
endif()
|
||||||
|
if(NGRAPH_ONNX_FRONTEND_ENABLE)
|
||||||
|
add_dependencies(inference_engine onnx_ov_frontend)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NGRAPH_PDPD_FRONTEND_ENABLE)
|
||||||
|
add_dependencies(inference_engine paddlepaddle_ov_frontend)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NGRAPH_TF_FRONTEND_ENABLE)
|
||||||
|
add_dependencies(inference_engine tensorflow_ov_frontend)
|
||||||
endif()
|
endif()
|
||||||
|
10
src/bindings/CMakeLists.txt
Normal file
10
src/bindings/CMakeLists.txt
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
# Copyright (C) 2021 Intel Corporation
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
|
add_subdirectory(c)
|
||||||
|
|
||||||
|
if(ENABLE_PYTHON)
|
||||||
|
add_subdirectory(python)
|
||||||
|
endif()
|
||||||
|
|
19
src/common/CMakeLists.txt
Normal file
19
src/common/CMakeLists.txt
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Copyright (C) 2018-2021 Intel Corporation
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
|
add_subdirectory(itt)
|
||||||
|
add_subdirectory(conditional_compilation)
|
||||||
|
add_subdirectory(util)
|
||||||
|
|
||||||
|
add_subdirectory(snippets)
|
||||||
|
add_subdirectory(legacy)
|
||||||
|
add_subdirectory(preprocessing)
|
||||||
|
add_subdirectory(transformations)
|
||||||
|
add_subdirectory(low_precision_transformations)
|
||||||
|
|
||||||
|
add_dependencies(ov_runtime_libraries inference_engine_legacy
|
||||||
|
inference_engine_transformations
|
||||||
|
inference_engine_lp_transformations
|
||||||
|
inference_engine_preproc
|
||||||
|
inference_engine_snippets)
|
@ -50,3 +50,4 @@ ov_install_static_lib(${TARGET_NAME} ngraph)
|
|||||||
|
|
||||||
file(GLOB_RECURSE hdrs ${CMAKE_CURRENT_SOURCE_DIR}/include/*.h ${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp)
|
file(GLOB_RECURSE hdrs ${CMAKE_CURRENT_SOURCE_DIR}/include/*.h ${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp)
|
||||||
add_cpplint_target(${TARGET_NAME}_cpplint FOR_SOURCES ${hdrs})
|
add_cpplint_target(${TARGET_NAME}_cpplint FOR_SOURCES ${hdrs})
|
||||||
|
openvino_developer_export_targets(COMPONENT openvino_common TARGETS openvino::conditional_compilation)
|
@ -36,3 +36,4 @@ target_include_directories(${TARGET_NAME} PUBLIC
|
|||||||
ov_install_static_lib(${TARGET_NAME} openvino_common)
|
ov_install_static_lib(${TARGET_NAME} openvino_common)
|
||||||
|
|
||||||
add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME})
|
add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME})
|
||||||
|
openvino_developer_export_targets(COMPONENT openvino_common TARGETS openvino::itt)
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user