Library versions & made tests relocatable (#12416)

* Fixes for cases when TBB_DIR env var is set

* Don't use make in build_samples.sh script

* First version of Windows installer

* WIndows NSIS installer

* Improved version of debian packages

* Improvements

* Improvements

* Debian packages now look good

* Library versioning

* Fixed tests to run against debian packages

* Fixed frontend tests

* Fixed code style

* FIxed Windows

* Fixed python tests

* Fixed paths in tests

* fdvfdv

* Fixes

* USe versioning only for debian packages

* Relocatable tests

* Fixed

* Fixed all tests

* Fixed clang-format

* Fixed more tests

* Fixed some tests

* Absolute paths in .ci

* Fixes

* Added support of OpenCV 3.4

* Trying to fix gnaUnitTests
This commit is contained in:
Ilya Lavrenov 2022-08-08 13:59:24 +04:00 committed by GitHub
parent b9126fe6ea
commit 6ca47b074d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
87 changed files with 803 additions and 712 deletions

View File

@ -161,8 +161,8 @@ jobs:
-DIE_EXTRA_MODULES=$(OPENVINO_CONTRIB_REPO_DIR)/modules -DIE_EXTRA_MODULES=$(OPENVINO_CONTRIB_REPO_DIR)/modules
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache
$(REPO_DIR) -S $(REPO_DIR)
workingDirectory: $(BUILD_DIR) -B $(BUILD_DIR)
- script: ls -alR $(REPO_DIR)/temp/ - script: ls -alR $(REPO_DIR)/temp/
displayName: 'List temp SDKs' displayName: 'List temp SDKs'
@ -185,23 +185,21 @@ jobs:
- script: ls -alR $(REPO_DIR)/bin/ - script: ls -alR $(REPO_DIR)/bin/
displayName: 'List bin files' displayName: 'List bin files'
- script: cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -P cmake_install.cmake - script: cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -P $(BUILD_DIR)/cmake_install.cmake
workingDirectory: $(BUILD_DIR)
displayName: 'Install' displayName: 'Install'
- task: CMake@1 - task: CMake@1
inputs: inputs:
cmakeArgs: > cmakeArgs: >
-GNinja -GNinja
$(REPO_DIR)/tests/layer_tests -S $(REPO_DIR)/tests/layer_tests
workingDirectory: $(BUILD_LAYER_TESTS_DIR) -B $(BUILD_LAYER_TESTS_DIR)
- script: ninja - script: ninja
workingDirectory: $(BUILD_LAYER_TESTS_DIR) workingDirectory: $(BUILD_LAYER_TESTS_DIR)
displayName: 'Build Layer Tests' displayName: 'Build Layer Tests'
- script: cmake -DCOMPONENT=tests -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -P cmake_install.cmake - script: cmake -DCOMPONENT=tests -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -P $(BUILD_LAYER_TESTS_DIR)/cmake_install.cmake
workingDirectory: $(BUILD_LAYER_TESTS_DIR)
displayName: 'Install Layer Tests' displayName: 'Install Layer Tests'
- script: ls -alR $(INSTALL_DIR) - script: ls -alR $(INSTALL_DIR)
@ -213,16 +211,14 @@ jobs:
- script: | - script: |
set -e set -e
mkdir -p $(INSTALL_DIR)/opencv/ mkdir -p $(INSTALL_DIR)/opencv/
cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -DCOMPONENT=tests -P cmake_install.cmake cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -DCOMPONENT=tests -P $(BUILD_DIR)/cmake_install.cmake
cp -R $(REPO_DIR)/temp/opencv_4.5.2_ubuntu20/opencv/* $(INSTALL_DIR)/opencv/ cp -R $(REPO_DIR)/temp/opencv_4.5.2_ubuntu20/opencv/* $(INSTALL_DIR)/opencv/
workingDirectory: $(BUILD_DIR)
displayName: 'Install tests' displayName: 'Install tests'
- script: ls -alR $(INSTALL_DIR) - script: ls -alR $(INSTALL_DIR)
displayName: 'List install files' displayName: 'List install files'
- script: $(INSTALL_DIR)/samples/cpp/build_samples.sh -i $(INSTALL_DIR) - script: $(INSTALL_DIR)/samples/cpp/build_samples.sh -i $(INSTALL_DIR)
workingDirectory: $(BUILD_SAMPLES_DIR)
displayName: 'Build cpp samples' displayName: 'Build cpp samples'
continueOnError: false continueOnError: false
@ -230,12 +226,10 @@ jobs:
export CC=clang export CC=clang
export CXX=clang++ export CXX=clang++
$(INSTALL_DIR)/samples/cpp/build_samples.sh -i $(INSTALL_DIR) $(INSTALL_DIR)/samples/cpp/build_samples.sh -i $(INSTALL_DIR)
workingDirectory: $(BUILD_SAMPLES_DIR)
displayName: 'Build cpp samples - clang' displayName: 'Build cpp samples - clang'
continueOnError: false continueOnError: false
- script: $(INSTALL_DIR)/samples/c/build_samples.sh -i $(INSTALL_DIR) - script: $(INSTALL_DIR)/samples/c/build_samples.sh -i $(INSTALL_DIR)
workingDirectory: $(BUILD_SAMPLES_DIR)
displayName: 'Build c samples' displayName: 'Build c samples'
continueOnError: false continueOnError: false
@ -247,7 +241,7 @@ jobs:
- script: | - script: |
export DATA_PATH=$(MODELS_PATH) export DATA_PATH=$(MODELS_PATH)
export MODELS_PATH=$(MODELS_PATH) export MODELS_PATH=$(MODELS_PATH)
. $(SETUPVARS) -pyver 3.8 && python3 -m pytest -s $(INSTALL_TEST_DIR)/pyngraph $(PYTHON_STATIC_ARGS) --junitxml=TEST-Pyngraph.xml --ignore=$(INSTALL_TEST_DIR)/pyngraph/tests/test_onnx/test_zoo_models.py --ignore=$(INSTALL_TEST_DIR)/pyngraph/tests/test_onnx/test_backend.py . $(SETUPVARS) -pyver 3.8 && python3 -m pytest -s $(INSTALL_TEST_DIR)/pyngraph $(PYTHON_STATIC_ARGS) --junitxml=$(INSTALL_TEST_DIR)/TEST-Pyngraph.xml --ignore=$(INSTALL_TEST_DIR)/pyngraph/tests/test_onnx/test_zoo_models.py --ignore=$(INSTALL_TEST_DIR)/pyngraph/tests/test_onnx/test_backend.py
displayName: 'nGraph and IE Python Bindings Tests' displayName: 'nGraph and IE Python Bindings Tests'
continueOnError: false continueOnError: false
@ -255,81 +249,81 @@ jobs:
- script: | - script: |
export DATA_PATH=$(MODELS_PATH) export DATA_PATH=$(MODELS_PATH)
export MODELS_PATH=$(MODELS_PATH) export MODELS_PATH=$(MODELS_PATH)
. $(SETUPVARS) -pyver 3.8 && python3 -m pytest -s $(INSTALL_TEST_DIR)/pyopenvino $(PYTHON_STATIC_ARGS) --junitxml=TEST-Pyngraph.xml --ignore=$(INSTALL_TEST_DIR)/pyopenvino/tests/test_utils/test_utils.py --ignore=$(INSTALL_TEST_DIR)/pyopenvino/tests/test_onnx/test_zoo_models.py --ignore=$(INSTALL_TEST_DIR)/pyopenvino/tests/test_onnx/test_backend.py -v export LD_LIBRARY_PATH=$(INSTALL_TEST_DIR)
. $(SETUPVARS) -pyver 3.8 && python3 -m pytest -s $(INSTALL_TEST_DIR)/pyopenvino $(PYTHON_STATIC_ARGS) --junitxml=$(INSTALL_TEST_DIR)/TEST-Pyngraph.xml --ignore=$(INSTALL_TEST_DIR)/pyopenvino/tests/test_utils/test_utils.py --ignore=$(INSTALL_TEST_DIR)/pyopenvino/tests/test_onnx/test_zoo_models.py --ignore=$(INSTALL_TEST_DIR)/pyopenvino/tests/test_onnx/test_backend.py -v
displayName: 'Python API 2.0 Tests' displayName: 'Python API 2.0 Tests'
continueOnError: false continueOnError: false
- script: | - script: |
export MO_ROOT=$(INSTALL_DIR)/tools/mo export MO_ROOT=$(INSTALL_DIR)/tools/mo
. $(SETUPVARS) -pyver 3.8 && python3 -m pytest -s $(INSTALL_DIR)/tests/mo/unit_tests --junitxml=TEST-ModelOptimizer.xml . $(SETUPVARS) -pyver 3.8 && python3 -m pytest -s $(INSTALL_DIR)/tests/mo/unit_tests --junitxml=$(INSTALL_TEST_DIR)/TEST-ModelOptimizer.xml
displayName: 'Model Optimizer UT' displayName: 'Model Optimizer UT'
continueOnError: false continueOnError: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ov_core_unit_tests --gtest_print_time=1 --gtest_filter=-*IE_GPU* --gtest_output=xml:TEST-NGraphUT.xml - script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ov_core_unit_tests --gtest_print_time=1 --gtest_filter=-*IE_GPU* --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-NGraphUT.xml
workingDirectory: $(INSTALL_TEST_DIR)
displayName: 'OV Core UT' displayName: 'OV Core UT'
continueOnError: false continueOnError: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/onnx_tests --gtest_print_time=1 --gtest_filter=-*IE_GPU* --gtest_output=xml:TEST-ONNXImportUT.xml - script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/onnx_tests --gtest_print_time=1 --gtest_filter=-*IE_GPU* --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-ONNXImportUT.xml
workingDirectory: $(INSTALL_TEST_DIR)
displayName: 'ONNX Frontend UT' displayName: 'ONNX Frontend UT'
continueOnError: false continueOnError: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/paddle_tests --gtest_print_time=1 --gtest_output=xml:TEST-Paddle.xml - script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/paddle_tests --gtest_print_time=1 --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-Paddle.xml
displayName: 'Paddle Frontend UT' displayName: 'Paddle Frontend UT'
continueOnError: false continueOnError: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/onnx_frontend_tests --gtest_print_time=1 --gtest_output=xml:TEST-Paddle.xml - script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/onnx_frontend_tests --gtest_print_time=1 --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-Paddle.xml
workingDirectory: $(INSTALL_TEST_DIR)
displayName: 'ONNX Frontend UT' displayName: 'ONNX Frontend UT'
continueOnError: false continueOnError: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/tensorflow_tests --gtest_print_time=1 --gtest_output=xml:TEST-Tensorflow.xml - script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/tensorflow_tests --gtest_print_time=1 --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-Tensorflow.xml
displayName: 'Tensorflow Frontend UT' displayName: 'Tensorflow Frontend UT'
continueOnError: false continueOnError: false
# . $(SETUPVARS) && python3 $(WORK_DIR)/gtest-parallel/gtest_parallel.py $(INSTALL_TEST_DIR)/InferenceEngineUnitTests --workers=16 --dump_json_test_results=InferenceEngineUnitTests.json --gtest_filter=*smoke* -- --gtest_print_time=1 - script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/InferenceEngineUnitTests --gtest_print_time=1 --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-InferenceEngineUnitTests.xml
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/InferenceEngineUnitTests --gtest_print_time=1 --gtest_output=xml:TEST-InferenceEngineUnitTests.xml
displayName: 'IE UT old' displayName: 'IE UT old'
continueOnError: false continueOnError: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ieUnitTests --gtest_output=xml:TEST-ieUnitTests.xml - script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ieUnitTests --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-ieUnitTests.xml
displayName: 'IE UT' displayName: 'IE UT'
continueOnError: false continueOnError: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/cpuUnitTests --gtest_output=xml:TEST-cpuUnitTests.xml - script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/cpuUnitTests --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-cpuUnitTests.xml
displayName: 'CPU UT' displayName: 'CPU UT'
continueOnError: false continueOnError: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/gnaUnitTests --gtest_output=xml:TEST-gnaUnitTests.xml - script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/gnaUnitTests --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-gnaUnitTests.xml
displayName: 'GNA UT' displayName: 'GNA UT'
continueOnError: false continueOnError: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/vpuUnitTests --gtest_output=xml:TEST-vpuUnitTests.xml - script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/vpuUnitTests --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-vpuUnitTests.xml
displayName: 'VPU UT' displayName: 'VPU UT'
continueOnError: false continueOnError: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/XLinkTests --gtest_output=xml:TEST-XLinkTests.xml - script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/XLinkTests --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-XLinkTests.xml
displayName: 'XLink Tests' displayName: 'XLink Tests'
continueOnError: false continueOnError: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ieMultiPluginUnitTests --gtest_output=xml:TEST-ieMultiPluginUnitTests.xml - script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ieMultiPluginUnitTests --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-ieMultiPluginUnitTests.xml
displayName: 'MULTI UT' displayName: 'MULTI UT'
continueOnError: false continueOnError: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/onnxImporterUnitTests --gtest_output=xml:TEST-onnxImporterUnitTests.xml - script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/onnxImporterUnitTests --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-onnxImporterUnitTests.xml
displayName: 'ONNX Importer UT' displayName: 'ONNX Importer UT'
continueOnError: false continueOnError: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ieFuncTests --gtest_output=xml:TEST-ieFuncTests.xml - script: |
# because of IR reader v7
export LD_LIBRARY_PATH=$(INSTALL_TEST_DIR)
. $(SETUPVARS) && $(INSTALL_TEST_DIR)/ieFuncTests --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-ieFuncTests.xml
displayName: 'IE FuncTests' displayName: 'IE FuncTests'
continueOnError: false continueOnError: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ov_template_func_tests --gtest_filter=*smoke* --gtest_output=xml:TEST-templateFuncTests.xml - script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ov_template_func_tests --gtest_filter=*smoke* --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-templateFuncTests.xml
displayName: 'TEMPLATE FuncTests' displayName: 'TEMPLATE FuncTests'
continueOnError: false continueOnError: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/cpuFuncTests --gtest_filter=*smoke* --gtest_print_time=1 --gtest_output=xml:TEST-cpuFuncTests.xml - script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/cpuFuncTests --gtest_filter=*smoke* --gtest_print_time=1 --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-cpuFuncTests.xml
displayName: 'CPU FuncTests' displayName: 'CPU FuncTests'
continueOnError: false continueOnError: false
condition: eq(variables['CMAKE_BUILD_SHARED_LIBS'], 'OFF') condition: eq(variables['CMAKE_BUILD_SHARED_LIBS'], 'OFF')
@ -337,14 +331,14 @@ jobs:
- script: | - script: |
export DATA_PATH=$(MODELS_PATH) export DATA_PATH=$(MODELS_PATH)
export MODELS_PATH=$(MODELS_PATH) export MODELS_PATH=$(MODELS_PATH)
. $(SETUPVARS) && $(INSTALL_TEST_DIR)/InferenceEngineCAPITests --gtest_output=xml:TEST-InferenceEngineCAPITests.xml . $(SETUPVARS) && $(INSTALL_TEST_DIR)/InferenceEngineCAPITests --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-InferenceEngineCAPITests.xml
displayName: 'IE CAPITests' displayName: 'IE CAPITests'
continueOnError: false continueOnError: false
- script: | - script: |
export DATA_PATH=$(MODELS_PATH) export DATA_PATH=$(MODELS_PATH)
export MODELS_PATH=$(MODELS_PATH) export MODELS_PATH=$(MODELS_PATH)
. $(SETUPVARS) && $(INSTALL_TEST_DIR)/OpenVinoCAPITests --gtest_output=xml:TEST-OpenVinoCAPITests.xml . $(SETUPVARS) && $(INSTALL_TEST_DIR)/OpenVinoCAPITests --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-OpenVinoCAPITests.xml
displayName: 'OV CAPITests' displayName: 'OV CAPITests'
continueOnError: false continueOnError: false
@ -352,16 +346,14 @@ jobs:
inputs: inputs:
cmakeArgs: > cmakeArgs: >
-GNinja -GNinja
$(REPO_DIR)/tests/samples_tests -S $(REPO_DIR)/tests/samples_tests
workingDirectory: $(BUILD_SAMPLES_TESTS_DIR) -B $(BUILD_SAMPLES_TESTS_DIR)
- script: cmake -DCOMPONENT=tests -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -P cmake_install.cmake - script: cmake -DCOMPONENT=tests -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -P $(BUILD_SAMPLES_TESTS_DIR)/cmake_install.cmake
workingDirectory: $(BUILD_SAMPLES_TESTS_DIR)
displayName: 'Install Samples Tests' displayName: 'Install Samples Tests'
- script: | - script: |
python3 -m pip install -r $(INSTALL_DIR)/tests/smoke_tests/requirements.txt python3 -m pip install -r $(INSTALL_DIR)/tests/smoke_tests/requirements.txt
workingDirectory: $(INSTALL_DIR)
displayName: 'Install dependencies for samples smoke tests' displayName: 'Install dependencies for samples smoke tests'
continueOnError: false continueOnError: false
@ -372,18 +364,16 @@ jobs:
export IE_APP_PYTHON_PATH=$(INSTALL_DIR)/samples/python/ export IE_APP_PYTHON_PATH=$(INSTALL_DIR)/samples/python/
export SHARE=$(INSTALL_DIR)/tests/smoke_tests/samples_smoke_tests_data/ export SHARE=$(INSTALL_DIR)/tests/smoke_tests/samples_smoke_tests_data/
export WORKSPACE=$(INSTALL_DIR) export WORKSPACE=$(INSTALL_DIR)
. $(SETUPVARS) && python3 -m pytest $(INSTALL_DIR)/tests/smoke_tests/ --env_conf $(INSTALL_DIR)/tests/smoke_tests/env_config.yml -s --junitxml=$(BUILD_DIR)/TEST-SamplesSmokeTests.xml . $(SETUPVARS) && python3 -m pytest $(INSTALL_DIR)/tests/smoke_tests/ --env_conf $(INSTALL_DIR)/tests/smoke_tests/env_config.yml -s --junitxml=$(INSTALL_TEST_DIR)/TEST-SamplesSmokeTests.xml
workingDirectory: $(INSTALL_DIR)/samples_bin
displayName: 'Samples Smoke Tests' displayName: 'Samples Smoke Tests'
continueOnError: false continueOnError: false
- script: | - script: |
. $(SETUPVARS) . $(SETUPVARS)
python3 -m pip install -r requirements.txt python3 -m pip install -r $(LAYER_TESTS_DIR)/requirements.txt
export MO_ROOT=$(INSTALL_DIR)/tools/mo export MO_ROOT=$(INSTALL_DIR)/tools/mo
export PYTHONPATH=$(LAYER_TESTS_DIR):$PYTHONPATH export PYTHONPATH=$(LAYER_TESTS_DIR):$PYTHONPATH
python3 -m pytest tensorflow_tests/test_tf_Roll.py --ir_version=10 --junitxml=TEST-tf_Roll.xmlTEST python3 -m pytest $(LAYER_TESTS_DIR)/tensorflow_tests/test_tf_Roll.py --ir_version=10 --junitxml=$(INSTALL_TEST_DIR)/TEST-tf_Roll.xmlTEST
workingDirectory: $(LAYER_TESTS_DIR)
displayName: 'Layer Tests' displayName: 'Layer Tests'
continueOnError: false continueOnError: false

View File

@ -101,8 +101,17 @@ jobs:
export PATH="/usr/local/opt/cython/bin:$PATH" export PATH="/usr/local/opt/cython/bin:$PATH"
export CC=gcc export CC=gcc
export CXX=g++ export CXX=g++
cmake -GNinja -DVERBOSE_BUILD=ON -DENABLE_REQUIREMENTS_INSTALL=OFF -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -DENABLE_PYTHON=ON -DENABLE_TESTS=OFF -DENABLE_STRICT_DEPENDENCIES=OFF -DIE_EXTRA_MODULES=$(OPENVINO_CONTRIB_REPO_DIR)/modules -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache $(REPO_DIR) cmake -GNinja -DVERBOSE_BUILD=ON \
workingDirectory: $(BUILD_DIR) -DENABLE_REQUIREMENTS_INSTALL=OFF \
-DCMAKE_BUILD_TYPE=$(BUILD_TYPE) \
-DENABLE_PYTHON=ON \
-DENABLE_TESTS=OFF \
-DENABLE_STRICT_DEPENDENCIES=OFF \
-DIE_EXTRA_MODULES=$(OPENVINO_CONTRIB_REPO_DIR)/modules \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-S $(REPO_DIR) \
-B $(BUILD_DIR)
displayName: 'CMake' displayName: 'CMake'
- script: ls -alR $(REPO_DIR)/temp/ - script: ls -alR $(REPO_DIR)/temp/
@ -134,8 +143,7 @@ jobs:
- script: ls -alR $(REPO_DIR)/bin/ - script: ls -alR $(REPO_DIR)/bin/
displayName: 'List bin files' displayName: 'List bin files'
- script: cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -P cmake_install.cmake - script: cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -P $(BUILD_DIR)/cmake_install.cmake
workingDirectory: $(BUILD_DIR)
displayName: 'Install' displayName: 'Install'
- script: ls -alR $(INSTALL_DIR) - script: ls -alR $(INSTALL_DIR)
@ -144,62 +152,59 @@ jobs:
- script: | - script: |
set -e set -e
mkdir -p $(INSTALL_DIR)/opencv/ mkdir -p $(INSTALL_DIR)/opencv/
cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -DCOMPONENT=tests -P cmake_install.cmake cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -DCOMPONENT=tests -P $(BUILD_DIR)/cmake_install.cmake
cp -R $(REPO_DIR)/temp/opencv_4.5.2_osx/opencv/* $(INSTALL_DIR)/opencv/ cp -R $(REPO_DIR)/temp/opencv_4.5.2_osx/opencv/* $(INSTALL_DIR)/opencv/
workingDirectory: $(BUILD_DIR)
displayName: 'Install tests' displayName: 'Install tests'
- script: ls -alR $(INSTALL_DIR) - script: ls -alR $(INSTALL_DIR)
displayName: 'List install files' displayName: 'List install files'
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ov_core_unit_tests --gtest_print_time=1 --gtest_filter=-backend_api.config_unsupported:*IE_GPU* --gtest_output=xml:TEST-NGraphUT.xml - script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ov_core_unit_tests --gtest_print_time=1 --gtest_filter=-*IE_GPU* --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-NGraphUT.xml
workingDirectory: $(INSTALL_TEST_DIR)
displayName: 'OV Core UT' displayName: 'OV Core UT'
continueOnError: false continueOnError: false
enabled: false enabled: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/onnx_tests --gtest_print_time=1 --gtest_filter=-*IE_GPU*:IE_CPU.onnx_model_sigmoid:IE_CPU/GRUSequenceOp.onnx_model_gru* --gtest_output=xml:TEST-ONNXImportUT.xml - script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/onnx_tests --gtest_print_time=1 --gtest_filter=-*IE_GPU*--gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-ONNXImportUT.xml
workingDirectory: $(INSTALL_TEST_DIR)
displayName: 'ONNX Frontend UT' displayName: 'ONNX Frontend UT'
continueOnError: false continueOnError: false
enabled: false enabled: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/InferenceEngineUnitTests --gtest_print_time=1 --gtest_filter=-MKLDNNGraphStructureTests.TestNoRedundantReordersBeforeDWConvolution:TestConvolution/MKLDNNGraphConvolutionTests.TestsConvolution/0:TestConvolutionDefaultPrimitivesPriority/MKLDNNGraphConvolutionTests.TestsConvolution/0 --gtest_output=xml:TEST-InferenceEngineUnitTests.xml - script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/InferenceEngineUnitTests --gtest_print_time=1 --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-InferenceEngineUnitTests.xml
displayName: 'IE UT old' displayName: 'IE UT old'
continueOnError: false continueOnError: false
enabled: false enabled: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ieUnitTests --gtest_output=xml:TEST-ieUnitTests.xml - script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ieUnitTests --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-ieUnitTests.xml
displayName: 'IE UT' displayName: 'IE UT'
continueOnError: false continueOnError: false
enabled: false enabled: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/cpuUnitTests --gtest_output=xml:TEST-cpuUnitTests.xml - script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/cpuUnitTests --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-cpuUnitTests.xml
displayName: 'CPU UT' displayName: 'CPU UT'
continueOnError: false continueOnError: false
enabled: false enabled: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/vpuUnitTests --gtest_output=xml:TEST-vpuUnitTests.xml - script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/vpuUnitTests --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-vpuUnitTests.xml
displayName: 'VPU UT' displayName: 'VPU UT'
continueOnError: false continueOnError: false
enabled: false enabled: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/onnxImporterUnitTests --gtest_output=xml:TEST-onnxImporterUnitTests.xml - script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/onnxImporterUnitTests --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-onnxImporterUnitTests.xml
displayName: 'ONNX Importer UT' displayName: 'ONNX Importer UT'
continueOnError: false continueOnError: false
enabled: false enabled: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ieMultiPluginUnitTests --gtest_output=xml:TEST-ieMultiPluginUnitTests.xml - script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ieMultiPluginUnitTests --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-ieMultiPluginUnitTests.xml
displayName: 'MULTI UT' displayName: 'MULTI UT'
continueOnError: false continueOnError: false
enabled: false enabled: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ieFuncTests --gtest_output=xml:TEST-ieFuncTests.xml - script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/ieFuncTests --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-ieFuncTests.xml
displayName: 'IE FuncTests' displayName: 'IE FuncTests'
continueOnError: false continueOnError: false
enabled: false enabled: false
- script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/cpuFuncTests --gtest_filter=*smoke*:-smoke_LPT/ReduceMinTransformation.CompareWithRefImpl/f32_Shape* --gtest_print_time=1 --gtest_output=xml:TEST-cpuFuncTests.xml - script: . $(SETUPVARS) && $(INSTALL_TEST_DIR)/cpuFuncTests --gtest_filter=*smoke* --gtest_print_time=1 --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-cpuFuncTests.xml
displayName: 'CPU FuncTests' displayName: 'CPU FuncTests'
continueOnError: false continueOnError: false
enabled: false enabled: false
@ -207,7 +212,7 @@ jobs:
- script: | - script: |
export DATA_PATH=$(MODELS_PATH) export DATA_PATH=$(MODELS_PATH)
export MODELS_PATH=$(MODELS_PATH) export MODELS_PATH=$(MODELS_PATH)
. $(SETUPVARS) && $(INSTALL_TEST_DIR)/InferenceEngineCAPITests --gtest_output=xml:TEST-InferenceEngineCAPITests.xml . $(SETUPVARS) && $(INSTALL_TEST_DIR)/InferenceEngineCAPITests --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-InferenceEngineCAPITests.xml
displayName: 'IE CAPITests' displayName: 'IE CAPITests'
continueOnError: false continueOnError: false
enabled: false enabled: false
@ -215,7 +220,7 @@ jobs:
- script: | - script: |
export DATA_PATH=$(MODELS_PATH) export DATA_PATH=$(MODELS_PATH)
export MODELS_PATH=$(MODELS_PATH) export MODELS_PATH=$(MODELS_PATH)
. $(SETUPVARS) && $(INSTALL_TEST_DIR)/OpenVinoCAPITests --gtest_output=xml:TEST-OpenVinoCAPITests.xml . $(SETUPVARS) && $(INSTALL_TEST_DIR)/OpenVinoCAPITests --gtest_output=xml:$(INSTALL_TEST_DIR)/TEST-OpenVinoCAPITests.xml
displayName: 'IE CAPITests' displayName: 'IE CAPITests'
continueOnError: false continueOnError: false
enabled: false enabled: false

View File

@ -144,15 +144,13 @@ jobs:
- script: | - script: |
set PATH=$(WORK_DIR)\ninja-win;%PATH% set PATH=$(WORK_DIR)\ninja-win;%PATH%
call "$(MSVS_VARS_PATH)" && "C:\Program Files (x86)\IncrediBuild\BuildConsole.exe" /COMMAND="$(CMAKE_CMD) --build . --config Release" call "$(MSVS_VARS_PATH)" && "C:\Program Files (x86)\IncrediBuild\BuildConsole.exe" /COMMAND="$(CMAKE_CMD) --build $(BUILD_DIR) --config Release"
workingDirectory: $(BUILD_DIR)
displayName: 'Build Win - IB' displayName: 'Build Win - IB'
- script: dir $(REPO_DIR)\bin\ /s - script: dir $(REPO_DIR)\bin\ /s
displayName: 'List bin files' displayName: 'List bin files'
- script: $(CMAKE_CMD) -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -P cmake_install.cmake - script: $(CMAKE_CMD) -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -P $(BUILD_DIR)/cmake_install.cmake
workingDirectory: $(BUILD_DIR)
displayName: 'Install' displayName: 'Install'
- script: dir $(INSTALL_DIR) /s - script: dir $(INSTALL_DIR) /s
@ -165,23 +163,18 @@ jobs:
workingDirectory: $(BUILD_SAMPLES_TESTS_DIR) workingDirectory: $(BUILD_SAMPLES_TESTS_DIR)
displayName: 'CMake' displayName: 'CMake'
- script: $(CMAKE_CMD) -DCOMPONENT=tests -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -P cmake_install.cmake - script: $(CMAKE_CMD) -DCOMPONENT=tests -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -P $(BUILD_SAMPLES_TESTS_DIR)\cmake_install.cmake
workingDirectory: $(BUILD_SAMPLES_TESTS_DIR)
displayName: 'Install Samples Tests' displayName: 'Install Samples Tests'
- script: $(INSTALL_DIR)\samples\cpp\build_samples_msvc.bat -i $(INSTALL_DIR) - script: $(INSTALL_DIR)\samples\cpp\build_samples_msvc.bat -i $(INSTALL_DIR)
workingDirectory: $(BUILD_SAMPLES_DIR)
displayName: 'Build cpp samples' displayName: 'Build cpp samples'
continueOnError: false continueOnError: false
- script: $(INSTALL_DIR)\samples\c\build_samples_msvc.bat -i $(INSTALL_DIR) - script: $(INSTALL_DIR)\samples\c\build_samples_msvc.bat -i $(INSTALL_DIR)
workingDirectory: $(BUILD_SAMPLES_DIR)
displayName: 'Build c samples' displayName: 'Build c samples'
continueOnError: false continueOnError: false
- script: | - script: python -m pip install -r $(INSTALL_TEST_DIR)\smoke_tests\requirements.txt
python -m pip install -r $(INSTALL_DIR)\tests\smoke_tests\requirements.txt
workingDirectory: $(INSTALL_DIR)
displayName: 'Install dependencies for samples smoke tests' displayName: 'Install dependencies for samples smoke tests'
continueOnError: false continueOnError: false
@ -190,13 +183,13 @@ jobs:
set IE_APP_PYTHON_PATH=$(INSTALL_DIR)\samples\python\ set IE_APP_PYTHON_PATH=$(INSTALL_DIR)\samples\python\
set SHARE=$(INSTALL_DIR)\tests\smoke_tests\samples_smoke_tests_data\ set SHARE=$(INSTALL_DIR)\tests\smoke_tests\samples_smoke_tests_data\
set WORKSPACE=$(INSTALL_DIR) set WORKSPACE=$(INSTALL_DIR)
python -m pytest $(INSTALL_DIR)\tests\smoke_tests\ --env_conf $(INSTALL_DIR)\tests\smoke_tests\env_config.yml -s --junitxml=TEST-SamplesSmokeTests.xml python -m pytest $(INSTALL_DIR)\tests\smoke_tests\ --env_conf $(INSTALL_TEST_DIR)\smoke_tests\env_config.yml -s --junitxml=$(INSTALL_TEST_DIR)/TEST-SamplesSmokeTests.xml
workingDirectory: $(INSTALL_DIR)
displayName: 'Samples Smoke Tests' displayName: 'Samples Smoke Tests'
continueOnError: false continueOnError: false
- script: $(CMAKE_CMD) -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -DCOMPONENT=tests -P cmake_install.cmake && xcopy $(REPO_DIR)\temp\opencv_4.5.2\opencv\* $(INSTALL_DIR)\opencv\ /e /h /y - script: |
workingDirectory: $(BUILD_DIR) $(CMAKE_CMD) -DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) -DCOMPONENT=tests -P $(BUILD_DIR)\cmake_install.cmake && \
xcopy $(REPO_DIR)\temp\opencv_4.5.2\opencv\* $(INSTALL_DIR)\opencv\ /e /h /y
displayName: 'Install tests' displayName: 'Install tests'
- script: dir $(INSTALL_DIR) /s - script: dir $(INSTALL_DIR) /s
@ -206,74 +199,71 @@ jobs:
displayName: 'Clean build dir' displayName: 'Clean build dir'
continueOnError: false continueOnError: false
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\ov_core_unit_tests --gtest_print_time=1 --gtest_filter=-*IE_GPU* --gtest_output=xml:TEST-NGraphUT.xml - script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\ov_core_unit_tests --gtest_print_time=1 --gtest_filter=-*IE_GPU* --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-NGraphUT.xml
workingDirectory: $(INSTALL_TEST_DIR)
displayName: 'OV Core UT' displayName: 'OV Core UT'
continueOnError: false continueOnError: false
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\onnx_tests --gtest_print_time=1 --gtest_filter=-*IE_GPU* --gtest_output=xml:TEST-ONNXImportUT.xml - script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\onnx_tests --gtest_print_time=1 --gtest_filter=-*IE_GPU* --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-ONNXImportUT.xml
workingDirectory: $(INSTALL_TEST_DIR)
displayName: 'ONNX Frontend UT' displayName: 'ONNX Frontend UT'
continueOnError: false continueOnError: false
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\paddle_tests --gtest_print_time=1 --gtest_output=xml:TEST-Paddle.xml - script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\paddle_tests --gtest_print_time=1 --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-Paddle.xml
displayName: 'Paddle Frontend UT' displayName: 'Paddle Frontend UT'
continueOnError: false continueOnError: false
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\onnx_frontend_tests --gtest_print_time=1 --gtest_output=xml:TEST-ONNX.xml - script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\onnx_frontend_tests --gtest_print_time=1 --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-ONNX.xml
workingDirectory: $(INSTALL_TEST_DIR)
displayName: 'ONNX Frontend UT' displayName: 'ONNX Frontend UT'
continueOnError: false continueOnError: false
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\tensorflow_tests --gtest_print_time=1 --gtest_output=xml:TEST-Tensorflow.xml - script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\tensorflow_tests --gtest_print_time=1 --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-Tensorflow.xml
displayName: 'Tensorflow Frontend UT' displayName: 'Tensorflow Frontend UT'
continueOnError: false continueOnError: false
# set PATH=$(IB_DIR);%PATH% # set PATH=$(IB_DIR);%PATH%
# call $(SETUPVARS) && "$(IB_TESTCONSOLE)" $(INSTALL_TEST_DIR)\InferenceEngineUnitTests.exe --gtest_output=xml:TEST-InferenceEngineUnitTests-IB.xml # call $(SETUPVARS) && "$(IB_TESTCONSOLE)" $(INSTALL_TEST_DIR)\InferenceEngineUnitTests.exe --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-InferenceEngineUnitTests-IB.xml
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\InferenceEngineUnitTests --gtest_output=xml:TEST-InferenceEngineUnitTests.xml - script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\InferenceEngineUnitTests --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-InferenceEngineUnitTests.xml
displayName: 'IE UT old' displayName: 'IE UT old'
continueOnError: false continueOnError: false
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\ieUnitTests --gtest_output=xml:TEST-ieUnitTests.xml - script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\ieUnitTests --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-ieUnitTests.xml
displayName: 'IE UT' displayName: 'IE UT'
continueOnError: false continueOnError: false
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\cpuUnitTests --gtest_output=xml:TEST-cpuUnitTests.xml - script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\cpuUnitTests --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-cpuUnitTests.xml
displayName: 'CPU UT' displayName: 'CPU UT'
continueOnError: false continueOnError: false
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\gnaUnitTests --gtest_output=xml:TEST-gnaUnitTests.xml - script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\gnaUnitTests --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-gnaUnitTests.xml
displayName: 'GNA UT' displayName: 'GNA UT'
continueOnError: false continueOnError: false
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\vpuUnitTests --gtest_output=xml:TEST-vpuUnitTests.xml - script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\vpuUnitTests --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-vpuUnitTests.xml
displayName: 'VPU UT' displayName: 'VPU UT'
continueOnError: false continueOnError: false
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\XLinkTests --gtest_output=xml:TEST-XLinkTests.xml - script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\XLinkTests --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-XLinkTests.xml
displayName: 'XLink Tests' displayName: 'XLink Tests'
continueOnError: false continueOnError: false
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\onnxImporterUnitTests --gtest_output=xml:TEST-onnxImporterUnitTests.xml - script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\onnxImporterUnitTests --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-onnxImporterUnitTests.xml
displayName: 'ONNX Importer UT' displayName: 'ONNX Importer UT'
continueOnError: false continueOnError: false
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\ieMultiPluginUnitTests --gtest_output=xml:TEST-ieMultiPluginUnitTests.xml - script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\ieMultiPluginUnitTests --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-ieMultiPluginUnitTests.xml
displayName: 'MULTI UT' displayName: 'MULTI UT'
continueOnError: false continueOnError: false
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\ieFuncTests --gtest_output=xml:TEST-ieFuncTests.xml - script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\ieFuncTests --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-ieFuncTests.xml
displayName: 'IE FuncTests' displayName: 'IE FuncTests'
continueOnError: false continueOnError: false
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\ov_template_func_tests --gtest_output=xml:TEST-templateFuncTests.xml - script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\ov_template_func_tests --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-templateFuncTests.xml
displayName: 'TEMPLATE FuncTests' displayName: 'TEMPLATE FuncTests'
continueOnError: false continueOnError: false
# set PATH=$(IB_DIR);%PATH% # set PATH=$(IB_DIR);%PATH%
# call $(SETUPVARS) && "$(IB_TESTCONSOLE)" $(INSTALL_TEST_DIR)\cpuFuncTests.exe --gtest_filter=*smoke*:-*CompareWithRefs/base_size=16_pre_nms_topn=100_post_nms_topn=100_nms_thresh=0.7_feat_stride=1_min_size=1_ratio*:*smoke_GRUSequenceCommonZeroClip/GRUSequenceTest.CompareWithRefs/mode=CONVERT_TO_TI_MAX_SEQ_LEN_CONST_seq_lengths* --gtest_output=xml:TEST-cpuFuncTests-IB.xml /testlevel=24 # call $(SETUPVARS) && "$(IB_TESTCONSOLE)" $(INSTALL_TEST_DIR)\cpuFuncTests.exe --gtest_filter=*smoke*:-*CompareWithRefs/base_size=16_pre_nms_topn=100_post_nms_topn=100_nms_thresh=0.7_feat_stride=1_min_size=1_ratio*:*smoke_GRUSequenceCommonZeroClip/GRUSequenceTest.CompareWithRefs/mode=CONVERT_TO_TI_MAX_SEQ_LEN_CONST_seq_lengths* --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-cpuFuncTests-IB.xml /testlevel=24
- script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\cpuFuncTests --gtest_filter=*smoke* --gtest_output=xml:TEST-cpuFuncTests.xml - script: call $(SETUPVARS) && $(INSTALL_TEST_DIR)\cpuFuncTests --gtest_filter=*smoke* --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-cpuFuncTests.xml
displayName: 'CPU FuncTests' displayName: 'CPU FuncTests'
continueOnError: false continueOnError: false
condition: eq(variables['CMAKE_BUILD_SHARED_LIBS'], 'OFF') condition: eq(variables['CMAKE_BUILD_SHARED_LIBS'], 'OFF')
@ -281,14 +271,14 @@ jobs:
- script: | - script: |
set DATA_PATH=$(MODELS_PATH) set DATA_PATH=$(MODELS_PATH)
set MODELS_PATH=$(MODELS_PATH) set MODELS_PATH=$(MODELS_PATH)
call $(SETUPVARS) && $(INSTALL_TEST_DIR)\InferenceEngineCAPITests --gtest_output=xml:TEST-InferenceEngineCAPITests.xml call $(SETUPVARS) && $(INSTALL_TEST_DIR)\InferenceEngineCAPITests --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-InferenceEngineCAPITests.xml
displayName: 'IE CAPITests' displayName: 'IE CAPITests'
continueOnError: false continueOnError: false
- script: | - script: |
set DATA_PATH=$(MODELS_PATH) set DATA_PATH=$(MODELS_PATH)
set MODELS_PATH=$(MODELS_PATH) set MODELS_PATH=$(MODELS_PATH)
call $(SETUPVARS) && $(INSTALL_TEST_DIR)\OpenVinoCAPITests --gtest_output=xml:TEST-OpenVinoCAPITests.xml call $(SETUPVARS) && $(INSTALL_TEST_DIR)\OpenVinoCAPITests --gtest_output=xml:$(INSTALL_TEST_DIR)\TEST-OpenVinoCAPITests.xml
displayName: 'OV CAPITests' displayName: 'OV CAPITests'
continueOnError: false continueOnError: false

View File

@ -36,6 +36,8 @@ RUN apt-get update && apt-get -y --no-install-recommends install \
ocl-icd-opencl-dev \ ocl-icd-opencl-dev \
pkg-config \ pkg-config \
unzip \ unzip \
libtbb-dev \
libpugixml-dev \
wget \ wget \
# Python dependencies # Python dependencies
python3 \ python3 \
@ -80,5 +82,5 @@ RUN ninja install
WORKDIR /openvino/src/bindings/python WORKDIR /openvino/src/bindings/python
ENV OpenVINO_DIR=/openvino/dist/runtime/cmake ENV OpenVINO_DIR=/openvino/dist/runtime/cmake
ENV LD_LIBRARY_PATH=/openvino/dist/runtime/lib:/openvino/dist/runtime/3rdparty/tbb/lib ENV LD_LIBRARY_PATH=/openvino/dist/runtime/lib:/openvino/dist/runtime/3rdparty/tbb/lib
ENV PYTHONPATH=/openvino/bin/intel64/${BUILD_TYPE}/lib/python_api/python3.8:${PYTHONPATH} ENV PYTHONPATH=/openvino/bin/intel64/${BUILD_TYPE}/python_api/python3.8:${PYTHONPATH}
CMD tox CMD tox

View File

@ -8,7 +8,12 @@ if(DEFINED BUILD_SHARED_LIBS AND NOT BUILD_SHARED_LIBS)
# incorrect OpenVINOConfig.cmake in this case # incorrect OpenVINOConfig.cmake in this case
cmake_minimum_required(VERSION 3.17) cmake_minimum_required(VERSION 3.17)
else() else()
cmake_minimum_required(VERSION 3.13) if(CPACK_GENERATOR STREQUAL "DEB")
# we have to use CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS variable
cmake_minimum_required(VERSION 3.20)
else()
cmake_minimum_required(VERSION 3.13)
endif()
endif() endif()
project(OpenVINO DESCRIPTION "OpenVINO toolkit") project(OpenVINO DESCRIPTION "OpenVINO toolkit")

View File

@ -14,7 +14,7 @@ set(CMAKE_MODULE_PATH "${IEDevScripts_DIR}")
function(set_ci_build_number) function(set_ci_build_number)
set(repo_root "${CMAKE_SOURCE_DIR}") set(repo_root "${CMAKE_SOURCE_DIR}")
include(version) include(version)
foreach(var CI_BUILD_NUMBER OpenVINO_VERSION OpenVINO_VERSION_BUILD foreach(var CI_BUILD_NUMBER OpenVINO_VERSION OpenVINO_SOVERSION OpenVINO_VERSION_SUFFIX OpenVINO_VERSION_BUILD
OpenVINO_VERSION_MAJOR OpenVINO_VERSION_MINOR OpenVINO_VERSION_PATCH) OpenVINO_VERSION_MAJOR OpenVINO_VERSION_MINOR OpenVINO_VERSION_PATCH)
if(NOT DEFINED ${var}) if(NOT DEFINED ${var})
message(FATAL_ERROR "${var} version component is not defined") message(FATAL_ERROR "${var} version component is not defined")
@ -87,7 +87,6 @@ endif()
# Common scripts # Common scripts
# #
include(packaging/packaging)
include(coverage/coverage) include(coverage/coverage)
include(shellcheck/shellcheck) include(shellcheck/shellcheck)
@ -164,13 +163,8 @@ macro(ov_set_if_not_defined var value)
endif() endif()
endmacro() endmacro()
if(NOT UNIX) ov_set_if_not_defined(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
ov_set_if_not_defined(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER}) ov_set_if_not_defined(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
ov_set_if_not_defined(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
else()
ov_set_if_not_defined(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER}/lib)
ov_set_if_not_defined(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER}/lib)
endif()
ov_set_if_not_defined(CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER}) ov_set_if_not_defined(CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
ov_set_if_not_defined(CMAKE_PDB_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER}) ov_set_if_not_defined(CMAKE_PDB_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
ov_set_if_not_defined(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER}) ov_set_if_not_defined(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_ROOT}/${BIN_FOLDER})
@ -195,6 +189,8 @@ set(CMAKE_WARN_DEPRECATED OFF CACHE BOOL "Don't warn about obsolete cmake versio
set(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION ON CACHE BOOL "Warn about absolute paths in destination") set(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION ON CACHE BOOL "Warn about absolute paths in destination")
set(CMAKE_SKIP_INSTALL_RPATH ON) set(CMAKE_SKIP_INSTALL_RPATH ON)
include(packaging/packaging)
# LTO # LTO
if(ENABLE_LTO) if(ENABLE_LTO)

View File

@ -196,13 +196,7 @@ macro(ov_add_frontend)
target_link_libraries(${TARGET_NAME} PUBLIC openvino::runtime) target_link_libraries(${TARGET_NAME} PUBLIC openvino::runtime)
target_link_libraries(${TARGET_NAME} PRIVATE ${OV_FRONTEND_LINK_LIBRARIES}) target_link_libraries(${TARGET_NAME} PRIVATE ${OV_FRONTEND_LINK_LIBRARIES})
ov_add_library_version(${TARGET_NAME})
# TODO: define proper library version, currently SOVERSION 2022
if(CPACK_GENERATOR STREQUAL "DEB")
set_target_properties(${TARGET_NAME} PROPERTIES
SOVERSION ${OpenVINO_VERSION_MAJOR}
VERSION ${OpenVINO_VERSION})
endif()
# WA for TF frontends which always require protobuf (not protobuf-lite) # WA for TF frontends which always require protobuf (not protobuf-lite)
# if TF FE is built in static mode, use protobuf for all other FEs # if TF FE is built in static mode, use protobuf for all other FEs

View File

@ -1,6 +1,5 @@
openvino (2022.2.0) unstable; urgency=low openvino (2022.2.0) unstable; urgency=low
[Ilya Lavrenov]
* Implemented Debian packages support * Implemented Debian packages support
* Support of Ubuntu 22.04 * Support of Ubuntu 22.04
* Support of python 3.10 * Support of python 3.10
@ -10,7 +9,6 @@ openvino (2022.2.0) unstable; urgency=low
openvino (2022.1.0) unstable; urgency=low openvino (2022.1.0) unstable; urgency=low
[Ilya Lavrenov]
* Implemented OpenVINO 2.0 Runtime API for both C++ and Python * Implemented OpenVINO 2.0 Runtime API for both C++ and Python
* Introduced IR v11 which is aligned with frameworks model format * Introduced IR v11 which is aligned with frameworks model format

View File

@ -16,17 +16,18 @@ macro(ov_debian_cpack_set_dirs)
set(OV_CPACK_LIBRARYDIR ${CMAKE_INSTALL_LIBDIR}) set(OV_CPACK_LIBRARYDIR ${CMAKE_INSTALL_LIBDIR})
set(OV_CPACK_RUNTIMEDIR ${CMAKE_INSTALL_LIBDIR}) set(OV_CPACK_RUNTIMEDIR ${CMAKE_INSTALL_LIBDIR})
set(OV_CPACK_ARCHIVEDIR ${CMAKE_INSTALL_LIBDIR}) set(OV_CPACK_ARCHIVEDIR ${CMAKE_INSTALL_LIBDIR})
set(OV_CPACK_PLUGINSDIR ${CMAKE_INSTALL_LIBDIR}/openvino${OpenVINO_VERSION}) set(OV_CPACK_PLUGINSDIR ${CMAKE_INSTALL_LIBDIR}/openvino-${OpenVINO_VERSION})
set(OV_CPACK_IE_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/inferenceengine${OpenVINO_VERSION}) set(OV_CPACK_IE_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/inferenceengine${OpenVINO_VERSION})
set(OV_CPACK_NGRAPH_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/ngraph${OpenVINO_VERSION}) set(OV_CPACK_NGRAPH_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/ngraph${OpenVINO_VERSION})
set(OV_CPACK_OPENVINO_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/openvino${OpenVINO_VERSION}) set(OV_CPACK_OPENVINO_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/openvino${OpenVINO_VERSION})
set(OV_CPACK_DOCDIR ${CMAKE_INSTALL_DATADIR}/doc/openvino${OpenVINO_VERSION}) set(OV_CPACK_DOCDIR ${CMAKE_INSTALL_DATADIR}/doc/openvino-${OpenVINO_VERSION})
# non-native stuff # non-native stuff
set(OV_CPACK_PYTHONDIR ${OV_CPACK_PLUGINSDIR}) set(OV_CPACK_PYTHONDIR ${OV_CPACK_PLUGINSDIR})
set(OV_CPACK_SHAREDIR ${CMAKE_INSTALL_DATADIR}/openvino${OpenVINO_VERSION}) # internal set(OV_CPACK_SHAREDIR ${CMAKE_INSTALL_DATADIR}/openvino-${OpenVINO_VERSION}) # internal
set(OV_CPACK_SAMPLESDIR ${OV_CPACK_SHAREDIR}/samples) set(OV_CPACK_SAMPLESDIR ${OV_CPACK_SHAREDIR}/samples)
set(OV_CPACK_DEVREQDIR ${OV_CPACK_SHAREDIR}) set(OV_CPACK_DEVREQDIR ${OV_CPACK_SHAREDIR})
unset(OV_CPACK_SHAREDIR)
set(OV_CPACK_WHEELSDIR .) # TODO set(OV_CPACK_WHEELSDIR .) # TODO
@ -88,12 +89,17 @@ macro(ov_debian_specific_settings)
# WA: dpkg-shlibdeps requires folder with libraries # WA: dpkg-shlibdeps requires folder with libraries
# proper way is to use -l (path to libs) and -L (path to shlibs) for other already installed components # proper way is to use -l (path to libs) and -L (path to shlibs) for other already installed components
# but it require CMake source code changes # but it requires CMake source code changes
# with current WA automatic deps detection via dpkg-shlibdeps for "our libraries" # with current WA automatic deps detection via dpkg-shlibdeps for "our libraries"
# is ignored; but dependencies between our components are here because of # is ignored; but dependencies between our components are here because of
# CPACK_COMPONENT_<UCOMP>_DEPENDS variables # CPACK_COMPONENT_<UCOMP>_DEPENDS variables
# More proper WA is try to enable INSTALL_RPATH # More proper WA is try to enable INSTALL_RPATH
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
if(DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY)
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS_PRIVATE_DIRS "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
else()
message(FATAL_ERROR "CMAKE_LIBRARY_OUTPUT_DIRECTORY is empty")
endif()
# automatic dependencies discovering between openvino and user packages # automatic dependencies discovering between openvino and user packages
set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON) set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON)
@ -103,6 +109,8 @@ macro(ov_debian_specific_settings)
set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT") set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
# need to update this version once we rebuild the same package with additional fixes # need to update this version once we rebuild the same package with additional fixes
# set(CPACK_DEBIAN_PACKAGE_RELEASE "1") # set(CPACK_DEBIAN_PACKAGE_RELEASE "1")
# enable this if someday we change the version scheme
# set(CPACK_DEBIAN_PACKAGE_EPOCH "2")
endmacro() endmacro()
ov_debian_specific_settings() ov_debian_specific_settings()
@ -208,25 +216,25 @@ endfunction()
# ov_debian_generate_conflicts(<comp name>) # ov_debian_generate_conflicts(<comp name>)
# #
function(ov_debian_generate_conflicts comp) function(ov_debian_generate_conflicts comp)
set(versions ${ARGN}) set(cpack_name_versions ${ARGN})
string(TOUPPER "${comp}" ucomp) string(TOUPPER "${comp}" ucomp)
# sanity check # sanity check
if(NOT DEFINED CPACK_DEBIAN_${ucomp}_PACKAGE_NAME) if(NOT DEFINED CPACK_DEBIAN_${ucomp}_PACKAGE_NAME)
message(FATAL_ERROR "CPACK_DEBIAN_${ucomp}_PACKAGE_NAME is not defined") message(FATAL_ERROR "CPACK_DEBIAN_${ucomp}_PACKAGE_NAME is not defined")
else() else()
if(NOT DEFINED CPACK_PACKAGE_VERSION) if(NOT DEFINED cpack_name_ver)
message(FATAL_ERROR "CPACK_PACKAGE_VERSION is not defined") message(FATAL_ERROR "Internal variable 'cpack_name_ver' is not defined")
endif() endif()
string(REPLACE "${CPACK_PACKAGE_VERSION}" "" package_name_base "${CPACK_DEBIAN_${ucomp}_PACKAGE_NAME}") string(REPLACE "${cpack_name_ver}" "" package_name_base "${CPACK_DEBIAN_${ucomp}_PACKAGE_NAME}")
endif() endif()
foreach(version IN LISTS versions) foreach(cpack_name_version IN LISTS cpack_name_versions)
if(package_names) if(package_names)
set(package_names "${package_names}, ${package_name_base}${version}") set(package_names "${package_names}, ${package_name_base}${cpack_name_version}")
else() else()
set(package_names "${package_name_base}${version}") set(package_names "${package_name_base}${cpack_name_version}")
endif() endif()
endforeach() endforeach()
@ -250,7 +258,7 @@ macro(ov_debian_add_latest_component comp)
# take package name # take package name
if(DEFINED CPACK_DEBIAN_${ucomp}_PACKAGE_NAME) if(DEFINED CPACK_DEBIAN_${ucomp}_PACKAGE_NAME)
string(REPLACE "-${cpack_ver_mm}" "" string(REPLACE "-${cpack_name_ver}" ""
CPACK_DEBIAN_${upper_case}_PACKAGE_NAME CPACK_DEBIAN_${upper_case}_PACKAGE_NAME
"${CPACK_DEBIAN_${ucomp}_PACKAGE_NAME}") "${CPACK_DEBIAN_${ucomp}_PACKAGE_NAME}")
else() else()

View File

@ -158,6 +158,10 @@ macro(ie_cpack)
endif() endif()
set(CPACK_PACKAGE_VERSION "${OpenVINO_VERSION}") set(CPACK_PACKAGE_VERSION "${OpenVINO_VERSION}")
if(NOT OpenVINO_VERSION_BUILD STREQUAL "000")
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}.${OpenVINO_VERSION_BUILD}")
endif()
foreach(ver MAJOR MINOR PATCH) foreach(ver MAJOR MINOR PATCH)
if(DEFINED OpenVINO_VERSION_${ver}) if(DEFINED OpenVINO_VERSION_${ver})
set(CPACK_PACKAGE_VERSION_${ver} ${OpenVINO_VERSION_${ver}}) set(CPACK_PACKAGE_VERSION_${ver} ${OpenVINO_VERSION_${ver}})

View File

@ -93,7 +93,14 @@ macro(ov_parse_ci_build_number)
endforeach() endforeach()
endif() endif()
set(OpenVINO_SOVERSION "${OpenVINO_VERSION_MAJOR}${OpenVINO_VERSION_MINOR}${OpenVINO_VERSION_PATCH}")
set(OpenVINO_VERSION "${OpenVINO_VERSION_MAJOR}.${OpenVINO_VERSION_MINOR}.${OpenVINO_VERSION_PATCH}") set(OpenVINO_VERSION "${OpenVINO_VERSION_MAJOR}.${OpenVINO_VERSION_MINOR}.${OpenVINO_VERSION_PATCH}")
# TODO: remove DEB later
if(WIN32 OR NOT CPACK_GENERATOR STREQUAL "DEB")
set(OpenVINO_VERSION_SUFFIX "")
else()
set(OpenVINO_VERSION_SUFFIX ".${OpenVINO_VERSION}")
endif()
message(STATUS "OpenVINO version is ${OpenVINO_VERSION} (Build ${OpenVINO_VERSION_BUILD})") message(STATUS "OpenVINO version is ${OpenVINO_VERSION} (Build ${OpenVINO_VERSION_BUILD})")
endmacro() endmacro()
@ -131,3 +138,15 @@ macro (addVersionDefines FILE)
endforeach() endforeach()
unset(__version_file) unset(__version_file)
endmacro() endmacro()
function(ov_add_library_version library)
if(CPACK_GENERATOR STREQUAL "DEB")
if(NOT DEFINED OpenVINO_SOVERSION)
message(FATAL_ERROR "Internal error: OpenVINO_SOVERSION is not defined")
endif()
set_target_properties(${library} PROPERTIES
SOVERSION ${OpenVINO_SOVERSION}
VERSION ${OpenVINO_VERSION})
endif()
endfunction()

View File

@ -126,7 +126,7 @@ ie_dependent_option (ENABLE_FUNCTIONAL_TESTS "functional tests" ON "ENABLE_TESTS
ie_dependent_option (ENABLE_SAMPLES "console samples are part of inference engine package" ON "NOT MINGW" OFF) ie_dependent_option (ENABLE_SAMPLES "console samples are part of inference engine package" ON "NOT MINGW" OFF)
ie_option (ENABLE_OPENCV "enables OpenCV" ON) ie_option (ENABLE_OPENCV "enables custom OpenCV download" ON)
ie_option (ENABLE_V7_SERIALIZE "enables serialization to IR v7" OFF) ie_option (ENABLE_V7_SERIALIZE "enables serialization to IR v7" OFF)

View File

@ -14,18 +14,22 @@ function(_ov_add_plugin comp is_pseudo)
set(package_name "${CPACK_DEBIAN_${ucomp}_PACKAGE_NAME}") set(package_name "${CPACK_DEBIAN_${ucomp}_PACKAGE_NAME}")
endif() endif()
if(NOT DEFINED cpack_full_ver)
message(FATAL_ERROR "Internal variable 'cpack_full_ver' is not defined")
endif()
if(is_pseudo) if(is_pseudo)
if(pseudo_plugins_recommends) if(pseudo_plugins_recommends)
set(pseudo_plugins_recommends "${pseudo_plugins_recommends}, ${package_name} (= ${CPACK_PACKAGE_VERSION})") set(pseudo_plugins_recommends "${pseudo_plugins_recommends}, ${package_name} (= ${cpack_full_ver})")
else() else()
set(pseudo_plugins_recommends "${package_name} (= ${CPACK_PACKAGE_VERSION})") set(pseudo_plugins_recommends "${package_name} (= ${cpack_full_ver})")
endif() endif()
endif() endif()
if(all_plugins_suggest) if(all_plugins_suggest)
set(all_plugins_suggest "${all_plugins_suggest}, ${package_name} (= ${CPACK_PACKAGE_VERSION})") set(all_plugins_suggest "${all_plugins_suggest}, ${package_name} (= ${cpack_full_ver})")
else() else()
set(all_plugins_suggest "${package_name} (= ${CPACK_PACKAGE_VERSION})") set(all_plugins_suggest "${package_name} (= ${cpack_full_ver})")
endif() endif()
list(APPEND installed_plugins ${comp}) list(APPEND installed_plugins ${comp})
@ -47,6 +51,8 @@ macro(ov_cpack_settings)
# even for case of system TBB we have installation rules for wheels packages # even for case of system TBB we have installation rules for wheels packages
# so, need to skip this explicitly # so, need to skip this explicitly
NOT item MATCHES "^tbb(_dev)?$" AND NOT item MATCHES "^tbb(_dev)?$" AND
# we have copyright file for debian package
NOT item STREQUAL OV_CPACK_COMP_LICENSING AND
# not appropriate components # not appropriate components
NOT item STREQUAL OV_CPACK_COMP_DEPLOYMENT_MANAGER AND NOT item STREQUAL OV_CPACK_COMP_DEPLOYMENT_MANAGER AND
NOT item STREQUAL OV_CPACK_COMP_INSTALL_DEPENDENCIES AND NOT item STREQUAL OV_CPACK_COMP_INSTALL_DEPENDENCIES AND
@ -57,15 +63,30 @@ macro(ov_cpack_settings)
list(REMOVE_DUPLICATES CPACK_COMPONENTS_ALL) list(REMOVE_DUPLICATES CPACK_COMPONENTS_ALL)
# version with 3 components # version with 3 components
set(cpack_ver_mm "${CPACK_PACKAGE_VERSION}") set(cpack_name_ver "${OpenVINO_VERSION}")
# full version with epoch and release components
set(cpack_full_ver "${CPACK_PACKAGE_VERSION}")
# take release version into account
if(DEFINED CPACK_DEBIAN_PACKAGE_RELEASE)
set(cpack_full_ver "${cpack_full_ver}-${CPACK_DEBIAN_PACKAGE_RELEASE}")
endif()
# take epoch version into account
if(DEFINED CPACK_DEBIAN_PACKAGE_EPOCH)
set(cpack_full_ver "${CPACK_DEBIAN_PACKAGE_EPOCH}:${cpack_full_ver}")
endif()
# a list of conflicting package versions # a list of conflicting package versions
set(conflicting_versions set(conflicting_versions
# 2022 release series # 2022 release series
# - 2022.1.0 is the last public release with debian packages from Intel install team
# - 2022.1.1 does not have debian packages enabled, distributed only as archives
2022.1.0) 2022.1.0)
# core # core
set(CPACK_COMPONENT_CORE_DESCRIPTION "OpenVINO C / C++ Runtime libraries") set(CPACK_COMPONENT_CORE_DESCRIPTION "OpenVINO C / C++ Runtime libraries")
set(CPACK_DEBIAN_CORE_PACKAGE_NAME "libopenvino-${cpack_ver_mm}") set(CPACK_DEBIAN_CORE_PACKAGE_NAME "libopenvino-${cpack_name_ver}")
# we need triggers to run ldconfig for openvino # we need triggers to run ldconfig for openvino
set(CPACK_DEBIAN_CORE_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm};${def_triggers}") set(CPACK_DEBIAN_CORE_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm};${def_triggers}")
@ -77,7 +98,7 @@ macro(ov_cpack_settings)
# core_dev # core_dev
set(CPACK_COMPONENT_CORE_DEV_DESCRIPTION "Intel(R) Distribution of OpenVINO(TM) Toolkit C / C++ Development files") set(CPACK_COMPONENT_CORE_DEV_DESCRIPTION "Intel(R) Distribution of OpenVINO(TM) Toolkit C / C++ Development files")
set(CPACK_COMPONENT_CORE_DEV_DEPENDS "core") set(CPACK_COMPONENT_CORE_DEV_DEPENDS "core")
set(CPACK_DEBIAN_CORE_DEV_PACKAGE_NAME "libopenvino-dev-${cpack_ver_mm}") set(CPACK_DEBIAN_CORE_DEV_PACKAGE_NAME "libopenvino-dev-${cpack_name_ver}")
ov_debian_generate_conflicts(core_dev ${conflicting_versions}) ov_debian_generate_conflicts(core_dev ${conflicting_versions})
ov_debian_add_lintian_suppression(core_dev ov_debian_add_lintian_suppression(core_dev
@ -92,7 +113,7 @@ macro(ov_cpack_settings)
if(ENABLE_HETERO) if(ENABLE_HETERO)
set(CPACK_COMPONENT_HETERO_DESCRIPTION "OpenVINO Hetero plugin") set(CPACK_COMPONENT_HETERO_DESCRIPTION "OpenVINO Hetero plugin")
set(CPACK_COMPONENT_HETERO_DEPENDS "core") set(CPACK_COMPONENT_HETERO_DEPENDS "core")
set(CPACK_DEBIAN_HETERO_PACKAGE_NAME "libopenvino-hetero-${cpack_ver_mm}") set(CPACK_DEBIAN_HETERO_PACKAGE_NAME "libopenvino-hetero-${cpack_name_ver}")
set(CPACK_DEBIAN_HETERO_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm}") set(CPACK_DEBIAN_HETERO_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm}")
_ov_add_plugin(hetero ON) _ov_add_plugin(hetero ON)
endif() endif()
@ -101,7 +122,7 @@ macro(ov_cpack_settings)
if(ENABLE_AUTO_BATCH) if(ENABLE_AUTO_BATCH)
set(CPACK_COMPONENT_BATCH_DESCRIPTION "OpenVINO Automatic Batching plugin") set(CPACK_COMPONENT_BATCH_DESCRIPTION "OpenVINO Automatic Batching plugin")
set(CPACK_COMPONENT_BATCH_DEPENDS "core") set(CPACK_COMPONENT_BATCH_DEPENDS "core")
set(CPACK_DEBIAN_BATCH_PACKAGE_NAME "libopenvino-auto-batch-${cpack_ver_mm}") set(CPACK_DEBIAN_BATCH_PACKAGE_NAME "libopenvino-auto-batch-${cpack_name_ver}")
set(CPACK_DEBIAN_BATCH_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm}") set(CPACK_DEBIAN_BATCH_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm}")
_ov_add_plugin(batch ON) _ov_add_plugin(batch ON)
endif() endif()
@ -114,13 +135,13 @@ macro(ov_cpack_settings)
set(CPACK_COMPONENT_MULTI_DESCRIPTION "OpenVINO Multi plugin") set(CPACK_COMPONENT_MULTI_DESCRIPTION "OpenVINO Multi plugin")
endif() endif()
set(CPACK_COMPONENT_MULTI_DEPENDS "core") set(CPACK_COMPONENT_MULTI_DEPENDS "core")
set(CPACK_DEBIAN_MULTI_PACKAGE_NAME "libopenvino-auto-${cpack_ver_mm}") set(CPACK_DEBIAN_MULTI_PACKAGE_NAME "libopenvino-auto-${cpack_name_ver}")
set(CPACK_DEBIAN_MULTI_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm}") set(CPACK_DEBIAN_MULTI_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm}")
_ov_add_plugin(multi ON) _ov_add_plugin(multi ON)
elseif(ENABLE_AUTO) elseif(ENABLE_AUTO)
set(CPACK_COMPONENT_AUTO_DESCRIPTION "OpenVINO Auto plugin") set(CPACK_COMPONENT_AUTO_DESCRIPTION "OpenVINO Auto plugin")
set(CPACK_COMPONENT_AUTO_DEPENDS "core") set(CPACK_COMPONENT_AUTO_DEPENDS "core")
set(CPACK_DEBIAN_AUTO_PACKAGE_NAME "libopenvino-auto-${cpack_ver_mm}") set(CPACK_DEBIAN_AUTO_PACKAGE_NAME "libopenvino-auto-${cpack_name_ver}")
set(CPACK_DEBIAN_AUTO_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm}") set(CPACK_DEBIAN_AUTO_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm}")
_ov_add_plugin(auto ON) _ov_add_plugin(auto ON)
endif() endif()
@ -129,7 +150,7 @@ macro(ov_cpack_settings)
if(ENABLE_INTEL_CPU) if(ENABLE_INTEL_CPU)
set(CPACK_COMPONENT_CPU_DESCRIPTION "Intel® CPU") set(CPACK_COMPONENT_CPU_DESCRIPTION "Intel® CPU")
set(CPACK_COMPONENT_CPU_DEPENDS "core") set(CPACK_COMPONENT_CPU_DEPENDS "core")
set(CPACK_DEBIAN_CPU_PACKAGE_NAME "libopenvino-intel-cpu-${cpack_ver_mm}") set(CPACK_DEBIAN_CPU_PACKAGE_NAME "libopenvino-intel-cpu-${cpack_name_ver}")
set(CPACK_DEBIAN_CPU_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm}") set(CPACK_DEBIAN_CPU_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm}")
_ov_add_plugin(cpu OFF) _ov_add_plugin(cpu OFF)
endif() endif()
@ -138,8 +159,10 @@ macro(ov_cpack_settings)
if(ENABLE_INTEL_GPU) if(ENABLE_INTEL_GPU)
set(CPACK_COMPONENT_GPU_DESCRIPTION "Intel® Processor Graphics") set(CPACK_COMPONENT_GPU_DESCRIPTION "Intel® Processor Graphics")
set(CPACK_COMPONENT_GPU_DEPENDS "core") set(CPACK_COMPONENT_GPU_DEPENDS "core")
set(CPACK_DEBIAN_GPU_PACKAGE_NAME "libopenvino-intel-gpu-${cpack_ver_mm}") set(CPACK_DEBIAN_GPU_PACKAGE_NAME "libopenvino-intel-gpu-${cpack_name_ver}")
set(CPACK_DEBIAN_GPU_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm}") set(CPACK_DEBIAN_GPU_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm}")
# auto batch exhances GPU
# set(CPACK_DEBIAN_BATCH_PACKAGE_ENHANCES "${CPACK_DEBIAN_GPU_PACKAGE_NAME} = (${cpack_full_ver})")
_ov_add_plugin(gpu OFF) _ov_add_plugin(gpu OFF)
endif() endif()
@ -147,7 +170,7 @@ macro(ov_cpack_settings)
if(ENABLE_INTEL_MYRIAD) if(ENABLE_INTEL_MYRIAD)
set(CPACK_COMPONENT_MYRIAD_DESCRIPTION "Intel® Movidius™ VPU") set(CPACK_COMPONENT_MYRIAD_DESCRIPTION "Intel® Movidius™ VPU")
set(CPACK_COMPONENT_MYRIAD_DEPENDS "core") set(CPACK_COMPONENT_MYRIAD_DEPENDS "core")
set(CPACK_DEBIAN_MYRIAD_PACKAGE_NAME "libopenvino-intel-vpu-${cpack_ver_mm}") set(CPACK_DEBIAN_MYRIAD_PACKAGE_NAME "libopenvino-intel-vpu-${cpack_name_ver}")
set(CPACK_DEBIAN_MYRIAD_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm}") set(CPACK_DEBIAN_MYRIAD_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm}")
_ov_add_plugin(myriad OFF) _ov_add_plugin(myriad OFF)
endif() endif()
@ -156,7 +179,7 @@ macro(ov_cpack_settings)
if(ENABLE_INTEL_GNA) if(ENABLE_INTEL_GNA)
set(CPACK_COMPONENT_GNA_DESCRIPTION "Intel® Gaussian Neural Accelerator") set(CPACK_COMPONENT_GNA_DESCRIPTION "Intel® Gaussian Neural Accelerator")
set(CPACK_COMPONENT_GNA_DEPENDS "core") set(CPACK_COMPONENT_GNA_DEPENDS "core")
set(CPACK_DEBIAN_GNA_PACKAGE_NAME "libopenvino-intel-gna-${cpack_ver_mm}") set(CPACK_DEBIAN_GNA_PACKAGE_NAME "libopenvino-intel-gna-${cpack_name_ver}")
# since we have libgna.so we need to call ldconfig and have `def_triggers` here # since we have libgna.so we need to call ldconfig and have `def_triggers` here
set(CPACK_DEBIAN_GNA_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm};${def_triggers}") set(CPACK_DEBIAN_GNA_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm};${def_triggers}")
@ -186,7 +209,7 @@ macro(ov_cpack_settings)
else() else()
set(CPACK_COMPONENT_PYTHON_PYTHON3.8_DEPENDS "core") set(CPACK_COMPONENT_PYTHON_PYTHON3.8_DEPENDS "core")
endif() endif()
set(CPACK_DEBIAN_PYTHON_PYTHON3.8_PACKAGE_NAME "libopenvino-python-${cpack_ver_mm}") set(CPACK_DEBIAN_PYTHON_PYTHON3.8_PACKAGE_NAME "libopenvino-python-${cpack_name_ver}")
set(CPACK_DEBIAN_PYTHON_PYTHON3.8_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm}") set(CPACK_DEBIAN_PYTHON_PYTHON3.8_PACKAGE_CONTROL_EXTRA "${def_postinst};${def_postrm}")
endif() endif()
@ -200,7 +223,7 @@ macro(ov_cpack_settings)
# c_samples / cpp_samples # c_samples / cpp_samples
set(CPACK_COMPONENT_SAMPLES_DESCRIPTION "Intel(R) Distribution of OpenVINO(TM) Toolkit C / C++ Samples") set(CPACK_COMPONENT_SAMPLES_DESCRIPTION "Intel(R) Distribution of OpenVINO(TM) Toolkit C / C++ Samples")
set(CPACK_COMPONENT_SAMPLES_DEPENDS "core_dev") set(CPACK_COMPONENT_SAMPLES_DEPENDS "core_dev")
set(CPACK_DEBIAN_SAMPLES_PACKAGE_NAME "openvino-samples-${cpack_ver_mm}") set(CPACK_DEBIAN_SAMPLES_PACKAGE_NAME "openvino-samples-${cpack_name_ver}")
set(CPACK_DEBIAN_SAMPLES_PACKAGE_SUGGESTS "${samples_build_deps_suggest}, ${all_plugins_suggest}") set(CPACK_DEBIAN_SAMPLES_PACKAGE_SUGGESTS "${samples_build_deps_suggest}, ${all_plugins_suggest}")
set(CPACK_DEBIAN_SAMPLES_PACKAGE_DEPENDS "libgflags-dev, nlohmann-json3-dev, zlib1g-dev") set(CPACK_DEBIAN_SAMPLES_PACKAGE_DEPENDS "libgflags-dev, nlohmann-json3-dev, zlib1g-dev")
# can be skipped with --no-install-recommends # can be skipped with --no-install-recommends
@ -209,7 +232,7 @@ macro(ov_cpack_settings)
# python_samples # python_samples
set(CPACK_COMPONENT_PYTHON_SAMPLES_DESCRIPTION "Intel(R) Distribution of OpenVINO(TM) Toolkit Python Samples") set(CPACK_COMPONENT_PYTHON_SAMPLES_DESCRIPTION "Intel(R) Distribution of OpenVINO(TM) Toolkit Python Samples")
set(CPACK_DEBIAN_PYTHON_SAMPLES_PACKAGE_NAME "openvino-samples-python-${cpack_ver_mm}") set(CPACK_DEBIAN_PYTHON_SAMPLES_PACKAGE_NAME "openvino-samples-python-${cpack_name_ver}")
set(CPACK_DEBIAN_PYTHON_SAMPLES_PACKAGE_DEPENDS "python3") set(CPACK_DEBIAN_PYTHON_SAMPLES_PACKAGE_DEPENDS "python3")
set(CPACK_DEBIAN_PYTHON_SAMPLES_PACKAGE_ARCHITECTURE "all") set(CPACK_DEBIAN_PYTHON_SAMPLES_PACKAGE_ARCHITECTURE "all")
@ -224,7 +247,7 @@ macro(ov_cpack_settings)
else() else()
set(CPACK_COMPONENT_LIBRARIES_DEPENDS "core") set(CPACK_COMPONENT_LIBRARIES_DEPENDS "core")
endif() endif()
set(CPACK_DEBIAN_LIBRARIES_PACKAGE_NAME "openvino-libraries-${cpack_ver_mm}") set(CPACK_DEBIAN_LIBRARIES_PACKAGE_NAME "openvino-libraries-${cpack_name_ver}")
ov_debian_add_lintian_suppression(libraries ov_debian_add_lintian_suppression(libraries
# it's umbrella package # it's umbrella package
@ -233,7 +256,7 @@ macro(ov_cpack_settings)
# all libraries-dev # all libraries-dev
set(CPACK_COMPONENT_LIBRARIES_DEV_DESCRIPTION "Intel(R) Distribution of OpenVINO(TM) Toolkit Libraries and Development files") set(CPACK_COMPONENT_LIBRARIES_DEV_DESCRIPTION "Intel(R) Distribution of OpenVINO(TM) Toolkit Libraries and Development files")
set(CPACK_COMPONENT_LIBRARIES_DEV_DEPENDS "core_dev;libraries") set(CPACK_COMPONENT_LIBRARIES_DEV_DEPENDS "core_dev;libraries")
set(CPACK_DEBIAN_LIBRARIES_DEV_PACKAGE_NAME "openvino-libraries-dev-${cpack_ver_mm}") set(CPACK_DEBIAN_LIBRARIES_DEV_PACKAGE_NAME "openvino-libraries-dev-${cpack_name_ver}")
# ov_debian_generate_conflicts(libraries_dev ${conflicting_versions}) # ov_debian_generate_conflicts(libraries_dev ${conflicting_versions})
ov_debian_add_lintian_suppression(libraries_dev ov_debian_add_lintian_suppression(libraries_dev
# it's umbrella package # it's umbrella package
@ -242,7 +265,7 @@ macro(ov_cpack_settings)
# all openvino # all openvino
set(CPACK_COMPONENT_OPENVINO_DESCRIPTION "Intel(R) Distribution of OpenVINO(TM) Toolkit Libraries and Development files") set(CPACK_COMPONENT_OPENVINO_DESCRIPTION "Intel(R) Distribution of OpenVINO(TM) Toolkit Libraries and Development files")
set(CPACK_COMPONENT_OPENVINO_DEPENDS "libraries_dev;samples;python_samples") set(CPACK_COMPONENT_OPENVINO_DEPENDS "libraries_dev;samples;python_samples")
set(CPACK_DEBIAN_OPENVINO_PACKAGE_NAME "openvino-${cpack_ver_mm}") set(CPACK_DEBIAN_OPENVINO_PACKAGE_NAME "openvino-${cpack_name_ver}")
ov_debian_add_lintian_suppression(openvino ov_debian_add_lintian_suppression(openvino
# it's umbrella package # it's umbrella package
"empty-binary-package") "empty-binary-package")
@ -270,6 +293,6 @@ macro(ov_cpack_settings)
ov_debian_add_latest_component(openvino) ov_debian_add_latest_component(openvino)
# users can manually install specific version of package # users can manually install specific version of package
# e.g. sudo apt-get install openvino=2022.1.0-643 # e.g. sudo apt-get install openvino=2022.1.0
# even if we have package version 2022.2.0 # even if we have latest package version 2022.2.0
endmacro() endmacro()

View File

@ -35,16 +35,8 @@ if(NOT ENABLE_DOCKER)
foreach(target openvino_template_plugin template_extension openvino_template_extension) foreach(target openvino_template_plugin template_extension openvino_template_extension)
if(TARGET ${target}) if(TARGET ${target})
if(target MATCHES ".*_plugin$")
set(dest_location ${OV_CPACK_PLUGINSDIR})
else()
set(dest_location ${OV_CPACK_RUNTIMEDIR})
endif()
install(TARGETS ${target} install(TARGETS ${target}
LIBRARY DESTINATION ${dest_location} LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)
COMPONENT tests
EXCLUDE_FROM_ALL)
endif() endif()
endforeach() endforeach()
endif() endif()

View File

@ -61,15 +61,9 @@ if(NOT CMAKE_CROSSCOMPILING)
endif() endif()
# remove OpenCV related sources # remove OpenCV related sources
if (ENABLE_OPENCV) find_package(OpenCV QUIET COMPONENTS core imgcodecs)
find_package(OpenCV QUIET)
else()
set(OpenCV_FOUND OFF)
endif()
if(NOT OpenCV_FOUND) if(NOT OpenCV_FOUND)
list(REMOVE_ITEM SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/dldt_optimization_guide5.cpp" list(REMOVE_ITEM SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/ShapeInference.cpp")
"${CMAKE_CURRENT_SOURCE_DIR}/ShapeInference.cpp")
endif() endif()
# requires mfxFrameSurface1 and MSS API # requires mfxFrameSurface1 and MSS API

View File

@ -2,7 +2,6 @@
#include <openvino/core/layout.hpp> #include <openvino/core/layout.hpp>
#include <opencv2/core/core.hpp> #include <opencv2/core/core.hpp>
#include <opencv2/imgcodecs.hpp> #include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
int main() { int main() {
ov::Core core; ov::Core core;

View File

@ -172,12 +172,13 @@ else
echo "Unknown OS, please install build dependencies manually" echo "Unknown OS, please install build dependencies manually"
fi fi
# cmake 3.17 or higher is required to build OpenVINO # cmake 3.20 or higher is required to build OpenVINO
current_cmake_version=$(cmake --version | sed -ne 's/[^0-9]*\(\([0-9]\.\)\{0,4\}[0-9][^.]\).*/\1/p') current_cmake_ver=$(cmake --version | sed -ne 's/[^0-9]*\(\([0-9]\.\)\{0,4\}[0-9][^.]\).*/\1/p')
required_cmake_ver=3.17 required_cmake_ver=3.20.0
if [ ! "$(printf '%s\n' "$required_cmake_ver" "$current_cmake_version" | sort -V | head -n1)" = "$required_cmake_ver" ]; then if [ ! "$(printf '%s\n' "$required_cmake_ver" "$current_cmake_ver" | sort -V | head -n1)" = "$required_cmake_ver" ]; then
wget "https://github.com/Kitware/CMake/releases/download/v3.18.4/cmake-3.18.4.tar.gz" installed_cmake_ver=3.23.2
tar xf cmake-3.18.4.tar.gz wget "https://github.com/Kitware/CMake/releases/download/v${installed_cmake_ver}/cmake-${installed_cmake_ver}.tar.gz"
(cd cmake-3.18.4 && ./bootstrap --parallel="$(nproc --all)" && make --jobs="$(nproc --all)" && sudo make install) tar xf cmake-${installed_cmake_ver}.tar.gz
rm -rf cmake-3.18.4 cmake-3.18.4.tar.gz (cd cmake-${installed_cmake_ver} && ./bootstrap --parallel="$(nproc --all)" && make --jobs="$(nproc --all)" && sudo make install)
rm -rf cmake-${installed_cmake_ver} cmake-${installed_cmake_ver}.tar.gz
fi fi

View File

@ -8,6 +8,8 @@
ie_cpack_add_component(${OV_CPACK_COMP_LICENSING} HIDDEN) ie_cpack_add_component(${OV_CPACK_COMP_LICENSING} HIDDEN)
# TODO: exclude from debian and use cmake/developer_package/packaging/copyright
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/
DESTINATION ${OV_CPACK_DOCDIR}/licensing DESTINATION ${OV_CPACK_DOCDIR}/licensing
COMPONENT ${OV_CPACK_COMP_LICENSING} COMPONENT ${OV_CPACK_COMP_LICENSING}

View File

@ -8,8 +8,8 @@ add_subdirectory(c)
# used by tests_deprecated # used by tests_deprecated
if(TARGET format_reader) if(TARGET format_reader)
install(TARGETS format_reader install(TARGETS format_reader
RUNTIME DESTINATION ${OV_CPACK_RUNTIMEDIR} COMPONENT tests EXCLUDE_FROM_ALL RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL
LIBRARY DESTINATION ${OV_CPACK_LIBRARYDIR} COMPONENT tests EXCLUDE_FROM_ALL) LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)
endif() endif()
openvino_developer_export_targets(COMPONENT openvino_common TARGETS format_reader ie_samples_utils) openvino_developer_export_targets(COMPONENT openvino_common TARGETS format_reader ie_samples_utils)

View File

@ -12,7 +12,7 @@ file(GLOB HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.h)
add_library(${TARGET_NAME} SHARED ${HEADERS} ${SOURCES}) add_library(${TARGET_NAME} SHARED ${HEADERS} ${SOURCES})
# Find OpenCV components if exist # Find OpenCV components if exist
find_package(OpenCV COMPONENTS core imgproc imgcodecs QUIET) find_package(OpenCV QUIET COMPONENTS core imgproc imgcodecs)
if(NOT OpenCV_FOUND) if(NOT OpenCV_FOUND)
message(WARNING "OPENCV is disabled or not found, ${TARGET_NAME} is built without OPENCV support") message(WARNING "OPENCV is disabled or not found, ${TARGET_NAME} is built without OPENCV support")
else() else()

View File

@ -65,7 +65,7 @@ endif()
# Optional OpenCV dependency # Optional OpenCV dependency
find_package(OpenCV COMPONENTS core QUIET) find_package(OpenCV QUIET COMPONENTS core)
if(NOT OpenCV_FOUND) if(NOT OpenCV_FOUND)
message(WARNING "OpenCV is disabled or not found, ${TARGET_NAME} will be built without OpenCV support. Set OpenCV_DIR") message(WARNING "OpenCV is disabled or not found, ${TARGET_NAME} will be built without OpenCV support. Set OpenCV_DIR")
else() else()

View File

@ -16,7 +16,7 @@ source_group("include" FILES ${LIBRARY_HEADERS})
add_library(${TARGET_NAME} SHARED ${MAIN_SRC} ${LIBRARY_HEADERS}) add_library(${TARGET_NAME} SHARED ${MAIN_SRC} ${LIBRARY_HEADERS})
# Find OpenCV components if exist # Find OpenCV components if exist
find_package(OpenCV COMPONENTS core imgproc imgcodecs QUIET) find_package(OpenCV QUIET COMPONENTS core imgproc imgcodecs)
if(NOT OpenCV_FOUND) if(NOT OpenCV_FOUND)
message(WARNING "OpenCV is disabled or not found, ${TARGET_NAME} will be built without OpenCV support") message(WARNING "OpenCV is disabled or not found, ${TARGET_NAME} will be built without OpenCV support")
else() else()

View File

@ -30,15 +30,9 @@ ie_add_vs_version_file(NAME ${TARGET_NAME}
# export # export
set_target_properties(${TARGET_NAME} PROPERTIES set_target_properties(${TARGET_NAME} PROPERTIES EXPORT_NAME runtime::ov)
EXPORT_NAME runtime::ov)
if(CPACK_GENERATOR STREQUAL "DEB") ov_add_library_version(${TARGET_NAME})
# TODO: define proper library version, currently SOVERSION 2022
set_target_properties(${TARGET_NAME} PROPERTIES
SOVERSION ${OpenVINO_VERSION_MAJOR}
VERSION ${OpenVINO_VERSION})
endif()
export(TARGETS ${TARGET_NAME} NAMESPACE openvino:: export(TARGETS ${TARGET_NAME} NAMESPACE openvino::
APPEND FILE "${CMAKE_BINARY_DIR}/OpenVINOTargets.cmake") APPEND FILE "${CMAKE_BINARY_DIR}/OpenVINOTargets.cmake")

View File

@ -5,7 +5,7 @@
set(TARGET_NAME "OpenVinoCAPITests") set(TARGET_NAME "OpenVinoCAPITests")
# Find OpenCV components if exist # Find OpenCV components if exist
find_package(OpenCV COMPONENTS core imgproc imgcodecs QUIET) find_package(OpenCV QUIET COMPONENTS core imgproc imgcodecs)
if(NOT OpenCV_FOUND) if(NOT OpenCV_FOUND)
message(WARNING "OPENCV is disabled or not found, ${TARGET_NAME} is disabled") message(WARNING "OPENCV is disabled or not found, ${TARGET_NAME} is disabled")
return() return()

View File

@ -30,14 +30,9 @@ ie_add_vs_version_file(NAME ${TARGET_NAME}
# export # export
set_target_properties(${TARGET_NAME} PROPERTIES set_target_properties(${TARGET_NAME} PROPERTIES EXPORT_NAME runtime::c)
EXPORT_NAME runtime::c)
if(CPACK_GENERATOR STREQUAL "DEB") ov_add_library_version(${TARGET_NAME})
set_target_properties(${TARGET_NAME} PROPERTIES
SOVERSION ${OpenVINO_VERSION_MAJOR}
VERSION ${OpenVINO_VERSION})
endif()
export(TARGETS ${TARGET_NAME} NAMESPACE openvino:: export(TARGETS ${TARGET_NAME} NAMESPACE openvino::
APPEND FILE "${CMAKE_BINARY_DIR}/OpenVINOTargets.cmake") APPEND FILE "${CMAKE_BINARY_DIR}/OpenVINOTargets.cmake")

View File

@ -5,7 +5,7 @@
set(TARGET_NAME "InferenceEngineCAPITests") set(TARGET_NAME "InferenceEngineCAPITests")
# Find OpenCV components if exist # Find OpenCV components if exist
find_package(OpenCV COMPONENTS core imgproc imgcodecs QUIET) find_package(OpenCV QUIET COMPONENTS core imgproc imgcodecs)
if(NOT OpenCV_FOUND) if(NOT OpenCV_FOUND)
message(WARNING "OPENCV is disabled or not found, ${TARGET_NAME} is disabled") message(WARNING "OPENCV is disabled or not found, ${TARGET_NAME} is disabled")
return() return()

View File

@ -346,7 +346,12 @@ def test_direct_infer(device):
def test_compiled_model_after_core_destroyed(device): def test_compiled_model_after_core_destroyed(device):
core, model = get_model_with_template_extension() core = Core()
with open(test_net_bin, "rb") as f:
weights = f.read()
with open(test_net_xml, "rb") as f:
xml = f.read()
model = core.read_model(model=xml, weights=weights)
compiled = core.compile_model(model, device) compiled = core.compile_model(model, device)
del core del core
del model del model

View File

@ -317,7 +317,7 @@ def test_unregister_plugin(device):
with pytest.raises(RuntimeError) as e: with pytest.raises(RuntimeError) as e:
core.load_network(model, device) core.load_network(model, device)
assert ( assert (
f"Device with '{device}' name is not registered in the InferenceEngine" f"Device with '{device}' name is not registered in the OpenVINO Runtime"
in str(e.value) in str(e.value)
) )

View File

@ -202,12 +202,8 @@ def test_set_tensors(device):
assert np.allclose(tensor4.data, t9.data, atol=1e-2, rtol=1e-2) assert np.allclose(tensor4.data, t9.data, atol=1e-2, rtol=1e-2)
@pytest.mark.dynamic_library()
@pytest.mark.template_extension()
def test_batched_tensors(device): def test_batched_tensors(device):
core = Core() core = Core()
# TODO: remove when plugins will support set_input_tensors
core.register_plugin("openvino_template_plugin", "TEMPLATE")
batch = 4 batch = 4
one_shape = [1, 2, 2, 2] one_shape = [1, 2, 2, 2]
@ -230,7 +226,7 @@ def test_batched_tensors(device):
model = Model([res1], [data1]) model = Model([res1], [data1])
compiled_model = core.compile_model(model, "TEMPLATE") compiled_model = core.compile_model(model, device)
req = compiled_model.create_infer_request() req = compiled_model.create_infer_request()

View File

@ -69,7 +69,7 @@ def test_load_network_wrong_device():
net = ie.read_network(model=test_net_xml, weights=test_net_bin) net = ie.read_network(model=test_net_xml, weights=test_net_bin)
with pytest.raises(RuntimeError) as e: with pytest.raises(RuntimeError) as e:
ie.load_network(net, "BLA") ie.load_network(net, "BLA")
assert 'Device with "BLA" name is not registered in the InferenceEngine' in str(e.value) assert 'Device with "BLA" name is not registered in the OpenVINO Runtime' in str(e.value)
def test_query_network(device): def test_query_network(device):
@ -123,7 +123,7 @@ def test_unregister_plugin(device):
net = ie.read_network(model=test_net_xml, weights=test_net_bin) net = ie.read_network(model=test_net_xml, weights=test_net_bin)
with pytest.raises(RuntimeError) as e: with pytest.raises(RuntimeError) as e:
ie.load_network(net, device) ie.load_network(net, device)
assert f"Device with '{device}' name is not registered in the InferenceEngine" in str(e.value) assert f"Device with '{device}' name is not registered in the OpenVINO Runtime" in str(e.value)
def test_available_devices(device): def test_available_devices(device):

View File

@ -557,13 +557,11 @@ def test_query_state_write_buffer(device, input_shape, data_type, mode):
"Expected values: {} \n Actual values: {} \n".format(expected_res, res) "Expected values: {} \n Actual values: {} \n".format(expected_res, res)
@pytest.mark.template_plugin def test_set_blob_with_incorrect_name(device):
def test_set_blob_with_incorrect_name():
function = create_encoder([4, 4, 20, 20]) function = create_encoder([4, 4, 20, 20])
net = ng.function_to_cnn(function) net = ng.function_to_cnn(function)
ie_core = ie.IECore() ie_core = ie.IECore()
ie_core.register_plugin("openvino_template_plugin", "TEMPLATE") exec_net = ie_core.load_network(net, device)
exec_net = ie_core.load_network(net, "TEMPLATE")
tensor_desc = exec_net.requests[0].input_blobs["data"].tensor_desc tensor_desc = exec_net.requests[0].input_blobs["data"].tensor_desc
tensor_desc.dims = [4, 4, 20, 20] tensor_desc.dims = [4, 4, 20, 20]
blob = ie.Blob(tensor_desc) blob = ie.Blob(tensor_desc)
@ -572,13 +570,11 @@ def test_set_blob_with_incorrect_name():
assert f"Failed to find input or output with name: 'incorrect_name'" in str(e.value) assert f"Failed to find input or output with name: 'incorrect_name'" in str(e.value)
@pytest.mark.template_plugin def test_set_blob_with_incorrect_size(device):
def test_set_blob_with_incorrect_size():
function = create_encoder([4, 4, 20, 20]) function = create_encoder([4, 4, 20, 20])
net = ng.function_to_cnn(function) net = ng.function_to_cnn(function)
ie_core = ie.IECore() ie_core = ie.IECore()
ie_core.register_plugin("openvino_template_plugin", "TEMPLATE") exec_net = ie_core.load_network(net, device)
exec_net = ie_core.load_network(net, "TEMPLATE")
tensor_desc = exec_net.requests[0].input_blobs["data"].tensor_desc tensor_desc = exec_net.requests[0].input_blobs["data"].tensor_desc
tensor_desc.dims = [tensor_desc.dims[0]*2, 4, 20, 20] tensor_desc.dims = [tensor_desc.dims[0]*2, 4, 20, 20]
blob = ie.Blob(tensor_desc) blob = ie.Blob(tensor_desc)

View File

@ -102,11 +102,7 @@ ov_install_static_lib(${TARGET_NAME}_dev ${OV_CPACK_COMP_CORE})
list(APPEND PATH_VARS "IE_INCLUDE_DIR") list(APPEND PATH_VARS "IE_INCLUDE_DIR")
# TODO: dpkg-shlibdeps does not work otherwise ov_add_library_version(${TARGET_NAME})
# TODO: define proper library version, currently SOVERSION 2022
# set_target_properties(${TARGET_NAME} PROPERTIES
# SOVERSION ${OpenVINO_VERSION_MAJOR}
# VERSION ${OpenVINO_VERSION})
if(ENABLE_INTEL_GNA) if(ENABLE_INTEL_GNA)
list(APPEND PATH_VARS "GNA_PATH") list(APPEND PATH_VARS "GNA_PATH")
@ -124,14 +120,10 @@ if(BUILD_SHARED_LIBS)
DESTINATION ${OV_CPACK_PLUGINSDIR} DESTINATION ${OV_CPACK_PLUGINSDIR}
COMPONENT ${OV_CPACK_COMP_CORE}) COMPONENT ${OV_CPACK_COMP_CORE})
# for InferenceEngineUnitTest if(ENABLE_TESTS)
# For public tests # for InferenceEngineUnitTest
install(FILES $<TARGET_FILE_DIR:${TARGET_NAME}>/plugins.xml
DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)
# For private tests
if (NOT WIN32)
install(FILES $<TARGET_FILE_DIR:${TARGET_NAME}>/plugins.xml install(FILES $<TARGET_FILE_DIR:${TARGET_NAME}>/plugins.xml
DESTINATION tests/lib COMPONENT tests EXCLUDE_FROM_ALL) DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)
endif() endif()
endif() endif()

View File

@ -15,6 +15,7 @@
#include <ie_blob.h> #include <ie_blob.h>
#include <file_utils.h> #include <file_utils.h>
#include <ie_preprocess.hpp> #include <ie_preprocess.hpp>
#include "ie_version.hpp"
namespace InferenceEngine { namespace InferenceEngine {
@ -77,17 +78,31 @@ public:
"Use 'cmake -DENABLE_GAPI_PREPROCESSING=ON ...'"; "Use 'cmake -DENABLE_GAPI_PREPROCESSING=ON ...'";
# endif // ENABLE_GAPI_PREPROCESSING # endif // ENABLE_GAPI_PREPROCESSING
#else #else
ov::util::FilePath libraryName = ov::util::to_file_path(std::string("openvino_gapi_preproc") + std::string(IE_BUILD_POSTFIX)); // preprocessing plugin can be found in the following locations
ov::util::FilePath preprocLibraryPath = FileUtils::makePluginLibraryName(getInferenceEngineLibraryPath(), libraryName); // 1. in openvino-X.Y.Z location relative to libopenvino.so
// 2. in the same folder as libopenvino.so
if (!FileUtils::fileExist(preprocLibraryPath)) { ov::util::FilePath ovLibraryPath = getInferenceEngineLibraryPath();
ov::util::FilePath libraryName = ov::util::to_file_path(std::string("openvino_gapi_preproc") + std::string(IE_BUILD_POSTFIX));
libraryName = FileUtils::makePluginLibraryName({}, libraryName);
std::ostringstream str;
str << "openvino-" << IE_VERSION_MAJOR << "." << IE_VERSION_MINOR << "." << IE_VERSION_PATCH;
ov::util::FilePath ovLibraryPathPlusOV = FileUtils::makePath(ovLibraryPath, ov::util::to_file_path(str.str()));
const ov::util::FilePath preprocLibraryPathPlusOV = FileUtils::makePath(ovLibraryPathPlusOV, libraryName);
const ov::util::FilePath preprocLibraryPath = FileUtils::makePath(ovLibraryPath, libraryName);
const bool existsInOV = FileUtils::fileExist(preprocLibraryPathPlusOV);
const bool existsInLib = FileUtils::fileExist(preprocLibraryPath);
if (!existsInOV && !existsInLib) {
IE_THROW() << "Please, make sure that pre-processing library " IE_THROW() << "Please, make sure that pre-processing library "
<< ov::util::from_file_path(::FileUtils::makePluginLibraryName({}, libraryName)) << " is in " << ov::util::from_file_path(libraryName) << " is in "
<< getIELibraryPath(); << ov::util::from_file_path(preprocLibraryPathPlusOV) << " or " << ov::util::from_file_path(preprocLibraryPath);
} }
using CreateF = void(std::shared_ptr<IPreProcessData>& data); using CreateF = void(std::shared_ptr<IPreProcessData>& data);
_so = ov::util::load_shared_object(preprocLibraryPath.c_str()); _so = ov::util::load_shared_object(existsInOV ? preprocLibraryPathPlusOV.c_str() : preprocLibraryPath.c_str());
reinterpret_cast<CreateF *>(ov::util::get_symbol(_so, "CreatePreProcessData"))(_ptr); reinterpret_cast<CreateF *>(ov::util::get_symbol(_so, "CreatePreProcessData"))(_ptr);
#endif #endif
} }

View File

@ -328,10 +328,7 @@ static std::string get_ov_library_path_a() {
#elif defined(__APPLE__) || defined(__linux__) #elif defined(__APPLE__) || defined(__linux__)
Dl_info info; Dl_info info;
dladdr(reinterpret_cast<void*>(ov::util::get_ov_lib_path), &info); dladdr(reinterpret_cast<void*>(ov::util::get_ov_lib_path), &info);
std::string result = get_path_name(ov::util::get_absolute_file_path(info.dli_fname)).c_str(); return get_path_name(ov::util::get_absolute_file_path(info.dli_fname)).c_str();
if (!ov::util::ends_with(result, "/lib") && !ov::util::ends_with(result, "/lib/"))
result = ov::util::path_join({result, "lib"});
return result;
#else #else
# error "Unsupported OS" # error "Unsupported OS"
#endif // _WIN32 #endif // _WIN32

View File

@ -543,7 +543,7 @@ add_executable(ov_core_unit_tests ${SRC})
add_dependencies(ov_core_unit_tests template_extension) add_dependencies(ov_core_unit_tests template_extension)
target_include_directories(ov_core_unit_tests PRIVATE ".") target_include_directories(ov_core_unit_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(ov_core_unit_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/runtime) target_include_directories(ov_core_unit_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/runtime)
get_target_property(OV_CORE_SRC_DIR ngraph_obj SOURCE_DIR) get_target_property(OV_CORE_SRC_DIR ngraph_obj SOURCE_DIR)

View File

@ -6,6 +6,7 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include "common_test_utils/file_utils.hpp"
#include "openvino/core/graph_util.hpp" #include "openvino/core/graph_util.hpp"
#include "openvino/core/op_extension.hpp" #include "openvino/core/op_extension.hpp"
#include "openvino/opsets/opset9.hpp" #include "openvino/opsets/opset9.hpp"
@ -13,7 +14,8 @@
#include "so_extension.hpp" #include "so_extension.hpp"
inline std::string get_extension_path() { inline std::string get_extension_path() {
return ov::util::make_plugin_library_name<char>({}, std::string("openvino_template_extension") + IE_BUILD_POSTFIX); return ov::util::make_plugin_library_name<char>(CommonTestUtils::getExecutableDirectory(),
std::string("openvino_template_extension") + IE_BUILD_POSTFIX);
} }
TEST(extension, load_extension) { TEST(extension, load_extension) {

View File

@ -14,6 +14,8 @@ set(SRC ${CMAKE_CURRENT_SOURCE_DIR}/mock_frontend.cpp)
set(MOCK1_FE_NAME openvino_mock1_frontend) set(MOCK1_FE_NAME openvino_mock1_frontend)
add_library(${MOCK1_FE_NAME} SHARED EXCLUDE_FROM_ALL ${SRC}) add_library(${MOCK1_FE_NAME} SHARED EXCLUDE_FROM_ALL ${SRC})
ov_add_library_version(${MOCK1_FE_NAME})
target_compile_definitions(${MOCK1_FE_NAME} PRIVATE "-DMOCK_VARIANT=\"1\"") target_compile_definitions(${MOCK1_FE_NAME} PRIVATE "-DMOCK_VARIANT=\"1\"")
target_include_directories(${MOCK1_FE_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(${MOCK1_FE_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
@ -23,12 +25,6 @@ add_dependencies(ov_core_unit_tests ${MOCK1_FE_NAME})
add_clang_format_target(${MOCK1_FE_NAME}_clang FOR_TARGETS ${MOCK1_FE_NAME}) add_clang_format_target(${MOCK1_FE_NAME}_clang FOR_TARGETS ${MOCK1_FE_NAME})
if(BUILD_SHARED_LIBS) install(TARGETS ${MOCK1_FE_NAME}
install(TARGETS ${MOCK1_FE_NAME} RUNTIME DESTINATION tests COMPONENT tests OPTIONAL EXCLUDE_FROM_ALL
RUNTIME DESTINATION ${OV_CPACK_RUNTIMEDIR} COMPONENT tests OPTIONAL EXCLUDE_FROM_ALL LIBRARY DESTINATION tests COMPONENT tests OPTIONAL EXCLUDE_FROM_ALL)
LIBRARY DESTINATION ${OV_CPACK_LIBRARYDIR} COMPONENT tests OPTIONAL EXCLUDE_FROM_ALL)
else()
install(TARGETS ${MOCK1_FE_NAME}
RUNTIME DESTINATION tests COMPONENT tests OPTIONAL EXCLUDE_FROM_ALL
LIBRARY DESTINATION tests COMPONENT tests OPTIONAL EXCLUDE_FROM_ALL)
endif()

View File

@ -6,6 +6,7 @@
#include <openvino/frontend/exception.hpp> #include <openvino/frontend/exception.hpp>
#include <openvino/frontend/manager.hpp> #include <openvino/frontend/manager.hpp>
#include "common_test_utils/file_utils.hpp"
#include "gmock/gmock.h" #include "gmock/gmock.h"
#include "gtest/gtest.h" #include "gtest/gtest.h"
#include "ngraph/file_util.hpp" #include "ngraph/file_util.hpp"
@ -24,46 +25,31 @@
# include <dlfcn.h> # include <dlfcn.h>
#endif #endif
#ifdef _WIN32
const char FrontEndPathSeparator[] = ";";
#else
const char FrontEndPathSeparator[] = ":";
#endif // _WIN32
using namespace ngraph;
using namespace ov::frontend; using namespace ov::frontend;
static std::string find_my_pathname() {
#ifdef _WIN32
HMODULE hModule = GetModuleHandleW(SHARED_LIB_PREFIX L"openvino" SHARED_LIB_SUFFIX);
WCHAR wpath[MAX_PATH];
GetModuleFileNameW(hModule, wpath, MAX_PATH);
std::wstring ws(wpath);
std::string path(ws.begin(), ws.end());
std::replace(path.begin(), path.end(), '\\', '/');
NGRAPH_SUPPRESS_DEPRECATED_START
path = file_util::get_directory(path);
NGRAPH_SUPPRESS_DEPRECATED_END
path += "/";
return path;
#elif defined(__linux) || defined(__APPLE__)
Dl_info dl_info;
dladdr(reinterpret_cast<void*>(ngraph::to_lower), &dl_info);
return ov::util::get_absolute_file_path(dl_info.dli_fname);
#else
# error "Unsupported OS"
#endif
}
static int set_test_env(const char* name, const char* value) { static int set_test_env(const char* name, const char* value) {
#ifdef _WIN32 #ifdef _WIN32
return _putenv_s(name, value); return _putenv_s(name, value);
#elif defined(__linux) || defined(__APPLE__) #elif defined(__linux) || defined(__APPLE__)
std::string var = std::string(name) + "=" + value; std::string var = std::string(name) + "=" + value;
return setenv(name, value, 0); return setenv(name, value, 1);
#else
# error "Unsupported OS"
#endif #endif
} }
struct SetTestEnvrionment {
SetTestEnvrionment(const char* value = nullptr) {
NGRAPH_SUPPRESS_DEPRECATED_START
set_test_env("OV_FRONTEND_PATH", value ? value : CommonTestUtils::getExecutableDirectory().c_str());
NGRAPH_SUPPRESS_DEPRECATED_END
}
~SetTestEnvrionment() {
set_test_env("OV_FRONTEND_PATH", "");
}
};
TEST(FrontEndManagerTest, testAvailableFrontEnds) { TEST(FrontEndManagerTest, testAvailableFrontEnds) {
FrontEndManager fem; FrontEndManager fem;
class MockFrontEnd : public FrontEnd {}; class MockFrontEnd : public FrontEnd {};
@ -85,41 +71,51 @@ TEST(FrontEndManagerTest, testAvailableFrontEnds) {
} }
TEST(FrontEndManagerTest, testMockPluginFrontEnd) { TEST(FrontEndManagerTest, testMockPluginFrontEnd) {
NGRAPH_SUPPRESS_DEPRECATED_START {
std::string fePath = ngraph::file_util::get_directory(find_my_pathname()); // with wring env
fePath = fePath + FrontEndPathSeparator + "someInvalidPath"; SetTestEnvrionment obj("someInvalidPath");
set_test_env("OV_FRONTEND_PATH", fePath.c_str());
FrontEndManager fem; FrontEndManager fem;
auto frontends = fem.get_available_front_ends(); auto frontends = fem.get_available_front_ends();
ASSERT_NE(std::find(frontends.begin(), frontends.end(), "mock1"), frontends.end()); EXPECT_EQ(std::find(frontends.begin(), frontends.end(), "mock1"), frontends.end());
FrontEnd::Ptr fe; }
ASSERT_NO_THROW(fe = fem.load_by_framework("mock1"));
ASSERT_EQ(fe->get_name(), "mock1"); {
set_test_env("OV_FRONTEND_PATH", ""); // update env
NGRAPH_SUPPRESS_DEPRECATED_END SetTestEnvrionment obj;
FrontEndManager fem;
auto frontends = fem.get_available_front_ends();
EXPECT_NE(std::find(frontends.begin(), frontends.end(), "mock1"), frontends.end());
FrontEnd::Ptr fe;
ASSERT_NO_THROW(fe = fem.load_by_framework("mock1"));
EXPECT_EQ(fe->get_name(), "mock1");
}
} }
TEST(FrontEndManagerTest, testFEMDestroy_FrontEndHolder) { TEST(FrontEndManagerTest, testFEMDestroy_FrontEndHolder) {
FrontEnd::Ptr fe; FrontEnd::Ptr fe;
{ {
SetTestEnvrionment obj;
FrontEndManager fem; FrontEndManager fem;
auto frontends = fem.get_available_front_ends(); auto frontends = fem.get_available_front_ends();
ASSERT_NE(std::find(frontends.begin(), frontends.end(), "mock1"), frontends.end()); EXPECT_NE(std::find(frontends.begin(), frontends.end(), "mock1"), frontends.end());
ASSERT_NO_THROW(fe = fem.load_by_framework("mock1")); ASSERT_NO_THROW(fe = fem.load_by_framework("mock1"));
} }
ASSERT_EQ(fe->get_name(), "mock1"); EXPECT_EQ(fe->get_name(), "mock1");
} }
TEST(FrontEndManagerTest, testFEMDestroy_InputModelHolder) { TEST(FrontEndManagerTest, testFEMDestroy_InputModelHolder) {
InputModel::Ptr input_model; InputModel::Ptr input_model;
{ {
SetTestEnvrionment obj;
std::shared_ptr<ov::Model> model; std::shared_ptr<ov::Model> model;
FrontEndManager fem; FrontEndManager fem;
auto fe = fem.load_by_framework("mock1"); auto fe = fem.load_by_framework("mock1");
input_model = fe->load("test"); input_model = fe->load("test");
model = fe->convert(input_model); model = fe->convert(input_model);
ASSERT_EQ(model->get_friendly_name(), "mock1_model"); EXPECT_EQ(model->get_friendly_name(), "mock1_model");
} }
ASSERT_TRUE(input_model); ASSERT_TRUE(input_model);
} }
@ -127,44 +123,46 @@ TEST(FrontEndManagerTest, testFEMDestroy_InputModelHolder) {
TEST(FrontEndManagerTest, testFEMDestroy_OVModelHolder) { TEST(FrontEndManagerTest, testFEMDestroy_OVModelHolder) {
std::shared_ptr<ov::Model> model; std::shared_ptr<ov::Model> model;
{ {
SetTestEnvrionment obj;
FrontEndManager fem; FrontEndManager fem;
auto fe = fem.load_by_framework("mock1"); auto fe = fem.load_by_framework("mock1");
auto input_model = fe->load("test"); auto input_model = fe->load("test");
model = fe->convert(input_model); model = fe->convert(input_model);
ASSERT_EQ(model->get_friendly_name(), "mock1_model"); EXPECT_EQ(model->get_friendly_name(), "mock1_model");
ASSERT_TRUE(model->get_rt_info().count("mock_test")); EXPECT_TRUE(model->get_rt_info().count("mock_test"));
ASSERT_EQ(model->get_rt_info()["mock_test"].as<std::string>(), std::string(1024, 't')); EXPECT_EQ(model->get_rt_info()["mock_test"].as<std::string>(), std::string(1024, 't'));
} }
ASSERT_EQ(model->get_friendly_name(), "mock1_model"); EXPECT_EQ(model->get_friendly_name(), "mock1_model");
} }
TEST(FrontEndManagerTest, testFEMDestroy_OVModelHolder_Clone) { TEST(FrontEndManagerTest, testFEMDestroy_OVModelHolder_Clone) {
std::shared_ptr<ov::Model> model_clone; std::shared_ptr<ov::Model> model_clone;
{ {
SetTestEnvrionment obj;
FrontEndManager fem; FrontEndManager fem;
auto fe = fem.load_by_framework("mock1"); auto fe = fem.load_by_framework("mock1");
auto input_model = fe->load("test"); auto input_model = fe->load("test");
auto model = fe->convert(input_model); auto model = fe->convert(input_model);
ASSERT_EQ(model->get_friendly_name(), "mock1_model"); EXPECT_EQ(model->get_friendly_name(), "mock1_model");
ASSERT_TRUE(model->get_rt_info().count("mock_test")); EXPECT_TRUE(model->get_rt_info().count("mock_test"));
ASSERT_EQ(model->get_rt_info()["mock_test"].as<std::string>(), std::string(1024, 't')); EXPECT_EQ(model->get_rt_info()["mock_test"].as<std::string>(), std::string(1024, 't'));
model_clone = ov::clone_model(*model); model_clone = ov::clone_model(*model);
} }
ASSERT_EQ(model_clone->get_rt_info()["mock_test"].as<std::string>(), std::string(1024, 't')); EXPECT_EQ(model_clone->get_rt_info()["mock_test"].as<std::string>(), std::string(1024, 't'));
ASSERT_EQ(model_clone->get_friendly_name(), "mock1_model"); EXPECT_EQ(model_clone->get_friendly_name(), "mock1_model");
} }
TEST(FrontEndManagerTest, testDefaultFrontEnd) { TEST(FrontEndManagerTest, testDefaultFrontEnd) {
FrontEndManager fem; FrontEndManager fem;
FrontEnd::Ptr fe; FrontEnd::Ptr fe;
ASSERT_NO_THROW(fe = fem.load_by_model("")); ASSERT_NO_THROW(fe = fem.load_by_model(""));
ASSERT_FALSE(fe); ASSERT_EQ(nullptr, fe);
class MockFrontEnd : public FrontEnd {}; class MockFrontEnd : public FrontEnd {};
std::unique_ptr<FrontEnd> fePtr(new MockFrontEnd()); // to verify base destructor std::unique_ptr<FrontEnd> fePtr(new MockFrontEnd()); // to verify base destructor
fe = std::make_shared<MockFrontEnd>(); fe = std::make_shared<MockFrontEnd>();
ASSERT_ANY_THROW(fe->load("")); ASSERT_ANY_THROW(fe->load(""));
ASSERT_ANY_THROW(fe->convert(std::shared_ptr<Function>(nullptr))); ASSERT_ANY_THROW(fe->convert(std::shared_ptr<ov::Model>(nullptr)));
ASSERT_ANY_THROW(fe->convert(InputModel::Ptr(nullptr))); ASSERT_ANY_THROW(fe->convert(InputModel::Ptr(nullptr)));
ASSERT_ANY_THROW(fe->convert_partially(nullptr)); ASSERT_ANY_THROW(fe->convert_partially(nullptr));
ASSERT_ANY_THROW(fe->decode(nullptr)); ASSERT_ANY_THROW(fe->decode(nullptr));
@ -239,6 +237,8 @@ TEST(FrontEndManagerTest, testDefaultPlace) {
ASSERT_ANY_THROW(place->is_equal_data(nullptr)); ASSERT_ANY_THROW(place->is_equal_data(nullptr));
} }
// clang-format off
TEST(FrontEndExceptionTest, frontend_general_error_no_throw) { TEST(FrontEndExceptionTest, frontend_general_error_no_throw) {
EXPECT_NO_THROW(FRONT_END_GENERAL_CHECK(true)); EXPECT_NO_THROW(FRONT_END_GENERAL_CHECK(true));
} }
@ -348,6 +348,7 @@ TEST(FrontEndExceptionTest, frontend_initialization_error_throw_info) {
// FrontEndManager exception safety // FrontEndManager exception safety
#define CHECK_EXCEPTION_FRONTEND(statement) \ #define CHECK_EXCEPTION_FRONTEND(statement) \
try { \ try { \
SetTestEnvrionment env; \
FrontEndManager fem; \ FrontEndManager fem; \
auto fe = fem.load_by_framework("mock1"); \ auto fe = fem.load_by_framework("mock1"); \
auto input_model = fe->load("throw_next"); \ auto input_model = fe->load("throw_next"); \
@ -361,34 +362,44 @@ TEST(FrontEndExceptionTest, frontend_initialization_error_throw_info) {
TEST(FrontEndManagerTest, Exception_Safety_FrontEnd_Load_By_Framework) { TEST(FrontEndManagerTest, Exception_Safety_FrontEnd_Load_By_Framework) {
EXPECT_ANY_THROW({ EXPECT_ANY_THROW({
SetTestEnvrionment env;
FrontEndManager fem; FrontEndManager fem;
auto fe = fem.load_by_framework("mock1"); auto fe = fem.load_by_framework("mock1");
fe->load("throw_now"); fe->load("throw_now");
}); });
} }
TEST(FrontEndManagerTest, Exception_Safety_FrontEnd_Convert){CHECK_EXCEPTION_FRONTEND(fe->convert(input_model))} TEST(FrontEndManagerTest, Exception_Safety_FrontEnd_Convert){
CHECK_EXCEPTION_FRONTEND(fe->convert(input_model))
}
TEST(FrontEndManagerTest, TEST(FrontEndManagerTest, Exception_Safety_FrontEnd_Convert_OV_Model) {
Exception_Safety_FrontEnd_Convert_OV_Model){CHECK_EXCEPTION_FRONTEND(fe->convert(std::shared_ptr<ov::Model>()))} CHECK_EXCEPTION_FRONTEND(fe->convert(std::shared_ptr<ov::Model>()))
}
TEST(FrontEndManagerTest, Exception_Safety_FrontEnd_Get_Name){CHECK_EXCEPTION_FRONTEND(fe->get_name())} TEST(FrontEndManagerTest, Exception_Safety_FrontEnd_Get_Name) {
CHECK_EXCEPTION_FRONTEND(fe->get_name())
}
TEST(FrontEndManagerTest, Exception_Safety_FrontEnd_Supported) { TEST(FrontEndManagerTest, Exception_Safety_FrontEnd_Supported) {
EXPECT_ANY_THROW({ EXPECT_ANY_THROW({
SetTestEnvrionment env;
FrontEndManager fem; FrontEndManager fem;
auto fe = fem.load_by_framework("mock1"); auto fe = fem.load_by_framework("mock1");
fe->supported("throw_now"); fe->supported("throw_now");
}); });
} }
TEST(FrontEndManagerTest, Exception_Safety_FrontEnd_Add_Extension){ TEST(FrontEndManagerTest, Exception_Safety_FrontEnd_Add_Extension) {
CHECK_EXCEPTION_FRONTEND(fe->add_extension(std::make_shared<ov::Extension>()))} CHECK_EXCEPTION_FRONTEND(fe->add_extension(std::make_shared<ov::Extension>()))}
TEST(FrontEndManagerTest, TEST(FrontEndManagerTest, Exception_Safety_FrontEnd_Convert_Partially) {
Exception_Safety_FrontEnd_Convert_Partially){CHECK_EXCEPTION_FRONTEND(fe->convert_partially(input_model))} CHECK_EXCEPTION_FRONTEND(fe->convert_partially(input_model))
}
TEST(FrontEndManagerTest, Exception_Safety_FrontEnd_Normalize){CHECK_EXCEPTION_FRONTEND(fe->normalize(nullptr))} TEST(FrontEndManagerTest, Exception_Safety_FrontEnd_Normalize) {
CHECK_EXCEPTION_FRONTEND(fe->normalize(nullptr))
}
TEST(FrontEndManagerTest, Exception_Safety_FrontEnd_Decode) { TEST(FrontEndManagerTest, Exception_Safety_FrontEnd_Decode) {
CHECK_EXCEPTION_FRONTEND(fe->decode(input_model)) CHECK_EXCEPTION_FRONTEND(fe->decode(input_model))
@ -398,6 +409,7 @@ TEST(FrontEndManagerTest, Exception_Safety_FrontEnd_Decode) {
#define CHECK_EXCEPTION_INPUT_MODEL(statement) \ #define CHECK_EXCEPTION_INPUT_MODEL(statement) \
try { \ try { \
SetTestEnvrionment env; \
FrontEndManager fem; \ FrontEndManager fem; \
auto fe = fem.load_by_framework("mock1"); \ auto fe = fem.load_by_framework("mock1"); \
auto input_model = fe->load("throw_model"); \ auto input_model = fe->load("throw_model"); \
@ -409,74 +421,97 @@ TEST(FrontEndManagerTest, Exception_Safety_FrontEnd_Decode) {
FAIL() << "Unexpected error is thrown"; \ FAIL() << "Unexpected error is thrown"; \
} }
TEST(FrontEndManagerTest, TEST(FrontEndManagerTest, Exception_Safety_Input_Model_get_inputs) {
Exception_Safety_Input_Model_get_inputs){CHECK_EXCEPTION_INPUT_MODEL(input_model->get_inputs())} CHECK_EXCEPTION_INPUT_MODEL(input_model->get_inputs())
}
TEST(FrontEndManagerTest, TEST(FrontEndManagerTest, Exception_Safety_Input_Model_get_outputs) {
Exception_Safety_Input_Model_get_outputs){CHECK_EXCEPTION_INPUT_MODEL(input_model->get_outputs())} CHECK_EXCEPTION_INPUT_MODEL(input_model->get_outputs())
}
TEST(FrontEndManagerTest, Exception_Safety_Input_Model_get_place_by_tensor_name){ TEST(FrontEndManagerTest, Exception_Safety_Input_Model_get_place_by_tensor_name) {
CHECK_EXCEPTION_INPUT_MODEL(input_model->get_place_by_tensor_name({}))} CHECK_EXCEPTION_INPUT_MODEL(input_model->get_place_by_tensor_name({}))
}
TEST(FrontEndManagerTest, Exception_Safety_Input_Model_get_place_by_operation_name){ TEST(FrontEndManagerTest, Exception_Safety_Input_Model_get_place_by_operation_name) {
CHECK_EXCEPTION_INPUT_MODEL(input_model->get_place_by_operation_name({}))} CHECK_EXCEPTION_INPUT_MODEL(input_model->get_place_by_operation_name({}))
}
TEST(FrontEndManagerTest, Exception_Safety_Input_Model_get_place_by_operation_name_and_input_port){ TEST(FrontEndManagerTest, Exception_Safety_Input_Model_get_place_by_operation_name_and_input_port) {
CHECK_EXCEPTION_INPUT_MODEL(input_model->get_place_by_operation_name_and_input_port({}, {}))} CHECK_EXCEPTION_INPUT_MODEL(input_model->get_place_by_operation_name_and_input_port({}, {}))
}
TEST(FrontEndManagerTest, Exception_Safety_Input_Model_get_place_by_operation_name_and_output_port){ TEST(FrontEndManagerTest, Exception_Safety_Input_Model_get_place_by_operation_name_and_output_port) {
CHECK_EXCEPTION_INPUT_MODEL(input_model->get_place_by_operation_name_and_output_port({}, {}))} CHECK_EXCEPTION_INPUT_MODEL(input_model->get_place_by_operation_name_and_output_port({}, {}))
}
TEST(FrontEndManagerTest, Exception_Safety_Input_Model_set_name_for_tensor){ TEST(FrontEndManagerTest, Exception_Safety_Input_Model_set_name_for_tensor) {
CHECK_EXCEPTION_INPUT_MODEL(input_model->set_name_for_tensor({}, {}))} CHECK_EXCEPTION_INPUT_MODEL(input_model->set_name_for_tensor({}, {}))
}
TEST(FrontEndManagerTest, Exception_Safety_Input_Model_add_name_for_tensor){ TEST(FrontEndManagerTest, Exception_Safety_Input_Model_add_name_for_tensor) {
CHECK_EXCEPTION_INPUT_MODEL(input_model->add_name_for_tensor({}, {}))} CHECK_EXCEPTION_INPUT_MODEL(input_model->add_name_for_tensor({}, {}))
}
TEST(FrontEndManagerTest, Exception_Safety_Input_Model_set_name_for_operation){ TEST(FrontEndManagerTest, Exception_Safety_Input_Model_set_name_for_operation) {
CHECK_EXCEPTION_INPUT_MODEL(input_model->set_name_for_operation({}, {}))} CHECK_EXCEPTION_INPUT_MODEL(input_model->set_name_for_operation({}, {}))
}
TEST(FrontEndManagerTest, Exception_Safety_Input_Model_free_name_for_tensor){ TEST(FrontEndManagerTest, Exception_Safety_Input_Model_free_name_for_tensor) {
CHECK_EXCEPTION_INPUT_MODEL(input_model->free_name_for_tensor({}))} CHECK_EXCEPTION_INPUT_MODEL(input_model->free_name_for_tensor({}))
}
TEST(FrontEndManagerTest, Exception_Safety_Input_Model_free_name_for_operation){ TEST(FrontEndManagerTest, Exception_Safety_Input_Model_free_name_for_operation) {
CHECK_EXCEPTION_INPUT_MODEL(input_model->free_name_for_operation({}))} CHECK_EXCEPTION_INPUT_MODEL(input_model->free_name_for_operation({}))
}
TEST(FrontEndManagerTest, Exception_Safety_Input_Model_set_name_for_dimension){ TEST(FrontEndManagerTest, Exception_Safety_Input_Model_set_name_for_dimension) {
CHECK_EXCEPTION_INPUT_MODEL(input_model->set_name_for_dimension({}, {}, {}))} CHECK_EXCEPTION_INPUT_MODEL(input_model->set_name_for_dimension({}, {}, {}))
}
TEST(FrontEndManagerTest, Exception_Safety_Input_Model_cut_and_add_new_input){ TEST(FrontEndManagerTest, Exception_Safety_Input_Model_cut_and_add_new_input) {
CHECK_EXCEPTION_INPUT_MODEL(input_model->cut_and_add_new_input({}, {}))} CHECK_EXCEPTION_INPUT_MODEL(input_model->cut_and_add_new_input({}, {}))
}
TEST(FrontEndManagerTest, Exception_Safety_Input_Model_cut_and_add_new_output){ TEST(FrontEndManagerTest, Exception_Safety_Input_Model_cut_and_add_new_output) {
CHECK_EXCEPTION_INPUT_MODEL(input_model->cut_and_add_new_output({}, {}))} CHECK_EXCEPTION_INPUT_MODEL(input_model->cut_and_add_new_output({}, {}))
}
TEST(FrontEndManagerTest, TEST(FrontEndManagerTest, Exception_Safety_Input_Model_add_output) {
Exception_Safety_Input_Model_add_output){CHECK_EXCEPTION_INPUT_MODEL(input_model->add_output({}))} CHECK_EXCEPTION_INPUT_MODEL(input_model->add_output({}))
}
TEST(FrontEndManagerTest, TEST(FrontEndManagerTest, Exception_Safety_Input_Model_remove_output) {
Exception_Safety_Input_Model_remove_output){CHECK_EXCEPTION_INPUT_MODEL(input_model->remove_output({}))} CHECK_EXCEPTION_INPUT_MODEL(input_model->remove_output({}))
}
TEST(FrontEndManagerTest, Exception_Safety_Input_Model_override_all_outputs){ TEST(FrontEndManagerTest, Exception_Safety_Input_Model_override_all_outputs) {
CHECK_EXCEPTION_INPUT_MODEL(input_model->override_all_outputs({}))} CHECK_EXCEPTION_INPUT_MODEL(input_model->override_all_outputs({}))
}
TEST(FrontEndManagerTest, Exception_Safety_Input_Model_override_all_inputs){ TEST(FrontEndManagerTest, Exception_Safety_Input_Model_override_all_inputs) {
CHECK_EXCEPTION_INPUT_MODEL(input_model->override_all_inputs({}))} CHECK_EXCEPTION_INPUT_MODEL(input_model->override_all_inputs({}))
}
TEST(FrontEndManagerTest, TEST(FrontEndManagerTest, Exception_Safety_Input_Model_extract_subgraph) {
Exception_Safety_Input_Model_extract_subgraph){CHECK_EXCEPTION_INPUT_MODEL(input_model->extract_subgraph({}, {}))} CHECK_EXCEPTION_INPUT_MODEL(input_model->extract_subgraph({}, {}))
}
TEST(FrontEndManagerTest, Exception_Safety_Input_Model_set_partial_shape){ TEST(FrontEndManagerTest, Exception_Safety_Input_Model_set_partial_shape) {
CHECK_EXCEPTION_INPUT_MODEL(input_model->set_partial_shape({}, {}))} CHECK_EXCEPTION_INPUT_MODEL(input_model->set_partial_shape({}, {}))
}
TEST(FrontEndManagerTest, TEST(FrontEndManagerTest, Exception_Safety_Input_Model_get_partial_shape) {
Exception_Safety_Input_Model_get_partial_shape){CHECK_EXCEPTION_INPUT_MODEL(input_model->get_partial_shape({}))} CHECK_EXCEPTION_INPUT_MODEL(input_model->get_partial_shape({}))
}
TEST(FrontEndManagerTest, TEST(FrontEndManagerTest, Exception_Safety_Input_Model_set_element_type) {
Exception_Safety_Input_Model_set_element_type){CHECK_EXCEPTION_INPUT_MODEL(input_model->set_element_type({}, {}))} CHECK_EXCEPTION_INPUT_MODEL(input_model->set_element_type({}, {}))
}
TEST(FrontEndManagerTest, TEST(FrontEndManagerTest, Exception_Safety_Input_Model_set_tensor_value) {
Exception_Safety_Input_Model_set_tensor_value){CHECK_EXCEPTION_INPUT_MODEL(input_model->set_tensor_value({}, {}))} CHECK_EXCEPTION_INPUT_MODEL(input_model->set_tensor_value({}, {}))
}
TEST(FrontEndManagerTest, Exception_Safety_Input_Model_set_tensor_partial_value) { TEST(FrontEndManagerTest, Exception_Safety_Input_Model_set_tensor_partial_value) {
CHECK_EXCEPTION_INPUT_MODEL(input_model->set_tensor_partial_value({}, {}, {})) CHECK_EXCEPTION_INPUT_MODEL(input_model->set_tensor_partial_value({}, {}, {}))

View File

@ -4,6 +4,7 @@
#include "openvino/frontend/onnx/extension/conversion.hpp" #include "openvino/frontend/onnx/extension/conversion.hpp"
#include "common_test_utils/file_utils.hpp"
#include "conversion_extension.hpp" #include "conversion_extension.hpp"
#include "onnx_utils.hpp" #include "onnx_utils.hpp"
#include "openvino/frontend/onnx/frontend.hpp" #include "openvino/frontend/onnx/frontend.hpp"
@ -67,7 +68,8 @@ TEST(ONNXConversionExtensionTest, custom_op_with_custom_domain) {
auto fe = std::make_shared<ov::frontend::onnx::FrontEnd>(); auto fe = std::make_shared<ov::frontend::onnx::FrontEnd>();
fe->add_extension(ext); fe->add_extension(ext);
const auto input_model = fe->load(ov::util::path_join({TEST_ONNX_MODELS_DIRNAME, "missing_op_domain.onnx"})); const auto input_model = fe->load(CommonTestUtils::getModelFromTestModelZoo(
ov::util::path_join({TEST_ONNX_MODELS_DIRNAME, "missing_op_domain.onnx"})));
std::shared_ptr<ov::Model> model; std::shared_ptr<ov::Model> model;
ASSERT_NO_THROW(model = fe->convert(input_model)); ASSERT_NO_THROW(model = fe->convert(input_model));

View File

@ -54,7 +54,6 @@ std::vector<std::string> tensor_names = {
}; };
TEST(Paddle_Places, check_tensor_names) { TEST(Paddle_Places, check_tensor_names) {
FrontEndTestUtils::setupTestEnv();
auto fem = FrontEndManager(); auto fem = FrontEndManager();
FrontEnd::Ptr frontend; FrontEnd::Ptr frontend;
ASSERT_NO_THROW(frontend = fem.load_by_framework(PADDLE_FE)); ASSERT_NO_THROW(frontend = fem.load_by_framework(PADDLE_FE));
@ -68,7 +67,6 @@ TEST(Paddle_Places, check_tensor_names) {
} }
TEST(Paddle_Places, check_input_outputs) { TEST(Paddle_Places, check_input_outputs) {
FrontEndTestUtils::setupTestEnv();
auto fem = FrontEndManager(); auto fem = FrontEndManager();
FrontEnd::Ptr frontend; FrontEnd::Ptr frontend;
ASSERT_NO_THROW(frontend = fem.load_by_framework(PADDLE_FE)); ASSERT_NO_THROW(frontend = fem.load_by_framework(PADDLE_FE));
@ -102,7 +100,6 @@ TEST(Paddle_Places, check_input_outputs) {
// all existed in the model ops have "Out" port // all existed in the model ops have "Out" port
TEST(Paddle_Places, check_out_port_of_all_ops) { TEST(Paddle_Places, check_out_port_of_all_ops) {
FrontEndTestUtils::setupTestEnv();
auto fem = FrontEndManager(); auto fem = FrontEndManager();
FrontEnd::Ptr frontend; FrontEnd::Ptr frontend;
ASSERT_NO_THROW(frontend = fem.load_by_framework(PADDLE_FE)); ASSERT_NO_THROW(frontend = fem.load_by_framework(PADDLE_FE));
@ -125,7 +122,6 @@ TEST(Paddle_Places, check_out_port_of_all_ops) {
} }
TEST(Paddle_Places, check_in_out_ports_of_model_outputs) { TEST(Paddle_Places, check_in_out_ports_of_model_outputs) {
FrontEndTestUtils::setupTestEnv();
auto fem = FrontEndManager(); auto fem = FrontEndManager();
FrontEnd::Ptr frontend; FrontEnd::Ptr frontend;
ASSERT_NO_THROW(frontend = fem.load_by_framework(PADDLE_FE)); ASSERT_NO_THROW(frontend = fem.load_by_framework(PADDLE_FE));
@ -160,7 +156,6 @@ TEST(Paddle_Places, check_in_out_ports_of_model_outputs) {
} }
TEST(Paddle_Places, check_source_target_tensors_of_model_outputs) { TEST(Paddle_Places, check_source_target_tensors_of_model_outputs) {
FrontEndTestUtils::setupTestEnv();
auto fem = FrontEndManager(); auto fem = FrontEndManager();
FrontEnd::Ptr frontend; FrontEnd::Ptr frontend;
ASSERT_NO_THROW(frontend = fem.load_by_framework(PADDLE_FE)); ASSERT_NO_THROW(frontend = fem.load_by_framework(PADDLE_FE));
@ -195,7 +190,6 @@ TEST(Paddle_Places, check_source_target_tensors_of_model_outputs) {
} }
TEST(Paddle_Places, check_producing_consuming_ops_of_model_outputs) { TEST(Paddle_Places, check_producing_consuming_ops_of_model_outputs) {
FrontEndTestUtils::setupTestEnv();
auto fem = FrontEndManager(); auto fem = FrontEndManager();
FrontEnd::Ptr frontend; FrontEnd::Ptr frontend;
ASSERT_NO_THROW(frontend = fem.load_by_framework(PADDLE_FE)); ASSERT_NO_THROW(frontend = fem.load_by_framework(PADDLE_FE));
@ -231,7 +225,6 @@ TEST(Paddle_Places, check_producing_consuming_ops_of_model_outputs) {
// check data flow [ output port -> tensor -> input port ] // check data flow [ output port -> tensor -> input port ]
TEST(Paddle_Places, check_data_flow) { TEST(Paddle_Places, check_data_flow) {
FrontEndTestUtils::setupTestEnv();
auto fem = FrontEndManager(); auto fem = FrontEndManager();
FrontEnd::Ptr frontend; FrontEnd::Ptr frontend;
ASSERT_NO_THROW(frontend = fem.load_by_framework(PADDLE_FE)); ASSERT_NO_THROW(frontend = fem.load_by_framework(PADDLE_FE));
@ -271,7 +264,6 @@ TEST(Paddle_Places, check_data_flow) {
// -> input_port_N] // -> input_port_N]
// input_port, input_port_2, ... input_port_N are equal data // input_port, input_port_2, ... input_port_N are equal data
TEST(Paddle_Places, check_tensor_to_multiple_ports) { TEST(Paddle_Places, check_tensor_to_multiple_ports) {
FrontEndTestUtils::setupTestEnv();
auto fem = FrontEndManager(); auto fem = FrontEndManager();
FrontEnd::Ptr frontend; FrontEnd::Ptr frontend;
ASSERT_NO_THROW(frontend = fem.load_by_framework(PADDLE_FE)); ASSERT_NO_THROW(frontend = fem.load_by_framework(PADDLE_FE));
@ -298,7 +290,6 @@ TEST(Paddle_Places, check_tensor_to_multiple_ports) {
// consuming ops should be equal for tensor place and producing output port // consuming ops should be equal for tensor place and producing output port
TEST(Paddle_Places, check_consuming_ops) { TEST(Paddle_Places, check_consuming_ops) {
FrontEndTestUtils::setupTestEnv();
auto fem = FrontEndManager(); auto fem = FrontEndManager();
FrontEnd::Ptr frontend; FrontEnd::Ptr frontend;
ASSERT_NO_THROW(frontend = fem.load_by_framework(PADDLE_FE)); ASSERT_NO_THROW(frontend = fem.load_by_framework(PADDLE_FE));
@ -340,7 +331,6 @@ TEST(Paddle_Places, check_consuming_ops) {
} }
TEST(Paddle_Places, check_consuming_ops_2) { TEST(Paddle_Places, check_consuming_ops_2) {
FrontEndTestUtils::setupTestEnv();
auto fem = FrontEndManager(); auto fem = FrontEndManager();
FrontEnd::Ptr frontend; FrontEnd::Ptr frontend;
ASSERT_NO_THROW(frontend = fem.load_by_framework(PADDLE_FE)); ASSERT_NO_THROW(frontend = fem.load_by_framework(PADDLE_FE));
@ -380,7 +370,6 @@ TEST(Paddle_Places, check_consuming_ops_2) {
} }
TEST(Paddle_Places, check_producing_ops) { TEST(Paddle_Places, check_producing_ops) {
FrontEndTestUtils::setupTestEnv();
auto fem = FrontEndManager(); auto fem = FrontEndManager();
FrontEnd::Ptr frontend; FrontEnd::Ptr frontend;
ASSERT_NO_THROW(frontend = fem.load_by_framework(PADDLE_FE)); ASSERT_NO_THROW(frontend = fem.load_by_framework(PADDLE_FE));
@ -403,7 +392,6 @@ TEST(Paddle_Places, check_producing_ops) {
} }
TEST(Paddle_Places, check_input_output_ports_dy_idx) { TEST(Paddle_Places, check_input_output_ports_dy_idx) {
FrontEndTestUtils::setupTestEnv();
auto fem = FrontEndManager(); auto fem = FrontEndManager();
FrontEnd::Ptr frontend; FrontEnd::Ptr frontend;
ASSERT_NO_THROW(frontend = fem.load_by_framework(PADDLE_FE)); ASSERT_NO_THROW(frontend = fem.load_by_framework(PADDLE_FE));
@ -430,7 +418,6 @@ TEST(Paddle_Places, check_input_output_ports_dy_idx) {
} }
TEST(Paddle_Places, check_ops_tensors_by_idx) { TEST(Paddle_Places, check_ops_tensors_by_idx) {
FrontEndTestUtils::setupTestEnv();
auto fem = FrontEndManager(); auto fem = FrontEndManager();
FrontEnd::Ptr frontend; FrontEnd::Ptr frontend;
ASSERT_NO_THROW(frontend = fem.load_by_framework(PADDLE_FE)); ASSERT_NO_THROW(frontend = fem.load_by_framework(PADDLE_FE));

View File

@ -6,6 +6,7 @@
#include <fstream> #include <fstream>
#include "common_test_utils/file_utils.hpp"
#include "openvino/pass/serialize.hpp" #include "openvino/pass/serialize.hpp"
#include "openvino/util/file_util.hpp" #include "openvino/util/file_util.hpp"
#include "read_ir.hpp" #include "read_ir.hpp"
@ -49,7 +50,8 @@ protected:
#ifdef ENABLE_OV_ONNX_FRONTEND #ifdef ENABLE_OV_ONNX_FRONTEND
TEST_F(SerializationDeterministicityTest, BasicModel) { TEST_F(SerializationDeterministicityTest, BasicModel) {
const std::string model = ov::util::path_join({SERIALIZED_ZOO, "ir/add_abc.onnx"}); const std::string model =
CommonTestUtils::getModelFromTestModelZoo(ov::util::path_join({SERIALIZED_ZOO, "ir/add_abc.onnx"}));
auto expected = ov::test::readModel(model, ""); auto expected = ov::test::readModel(model, "");
ov::pass::Serialize(m_out_xml_path_1, m_out_bin_path_1).run_on_model(expected); ov::pass::Serialize(m_out_xml_path_1, m_out_bin_path_1).run_on_model(expected);
@ -65,7 +67,8 @@ TEST_F(SerializationDeterministicityTest, BasicModel) {
} }
TEST_F(SerializationDeterministicityTest, ModelWithMultipleLayers) { TEST_F(SerializationDeterministicityTest, ModelWithMultipleLayers) {
const std::string model = ov::util::path_join({SERIALIZED_ZOO, "ir/addmul_abc.onnx"}); const std::string model =
CommonTestUtils::getModelFromTestModelZoo(ov::util::path_join({SERIALIZED_ZOO, "ir/addmul_abc.onnx"}));
auto expected = ov::test::readModel(model, ""); auto expected = ov::test::readModel(model, "");
ov::pass::Serialize(m_out_xml_path_1, m_out_bin_path_1).run_on_model(expected); ov::pass::Serialize(m_out_xml_path_1, m_out_bin_path_1).run_on_model(expected);
@ -83,8 +86,10 @@ TEST_F(SerializationDeterministicityTest, ModelWithMultipleLayers) {
#endif #endif
TEST_F(SerializationDeterministicityTest, ModelWithMultipleOutputs) { TEST_F(SerializationDeterministicityTest, ModelWithMultipleOutputs) {
const std::string model = ov::util::path_join({SERIALIZED_ZOO, "ir/split_equal_parts_2d.xml"}); const std::string model =
const std::string weights = ov::util::path_join({SERIALIZED_ZOO, "ir/split_equal_parts_2d.bin"}); CommonTestUtils::getModelFromTestModelZoo(ov::util::path_join({SERIALIZED_ZOO, "ir/split_equal_parts_2d.xml"}));
const std::string weights =
CommonTestUtils::getModelFromTestModelZoo(ov::util::path_join({SERIALIZED_ZOO, "ir/split_equal_parts_2d.bin"}));
auto expected = ov::test::readModel(model, weights); auto expected = ov::test::readModel(model, weights);
ov::pass::Serialize(m_out_xml_path_1, m_out_bin_path_1).run_on_model(expected); ov::pass::Serialize(m_out_xml_path_1, m_out_bin_path_1).run_on_model(expected);
@ -100,8 +105,10 @@ TEST_F(SerializationDeterministicityTest, ModelWithMultipleOutputs) {
} }
TEST_F(SerializationDeterministicityTest, ModelWithConstants) { TEST_F(SerializationDeterministicityTest, ModelWithConstants) {
const std::string model = ov::util::path_join({SERIALIZED_ZOO, "ir/add_abc_initializers.xml"}); const std::string model =
const std::string weights = ov::util::path_join({SERIALIZED_ZOO, "ir/add_abc_initializers.bin"}); CommonTestUtils::getModelFromTestModelZoo(ov::util::path_join({SERIALIZED_ZOO, "ir/add_abc_initializers.xml"}));
const std::string weights =
CommonTestUtils::getModelFromTestModelZoo(ov::util::path_join({SERIALIZED_ZOO, "ir/add_abc_initializers.bin"}));
auto expected = ov::test::readModel(model, weights); auto expected = ov::test::readModel(model, weights);
ov::pass::Serialize(m_out_xml_path_1, m_out_bin_path_1).run_on_model(expected); ov::pass::Serialize(m_out_xml_path_1, m_out_bin_path_1).run_on_model(expected);

View File

@ -8,6 +8,7 @@
#include <fstream> #include <fstream>
#include "common_test_utils/file_utils.hpp"
#include "common_test_utils/graph_comparator.hpp" #include "common_test_utils/graph_comparator.hpp"
#include "ngraph/pass/manager.hpp" #include "ngraph/pass/manager.hpp"
#include "ngraph/pass/serialize.hpp" #include "ngraph/pass/serialize.hpp"
@ -39,9 +40,11 @@ public:
} }
void SetUp() override { void SetUp() override {
m_model_path = ov::util::path_join({SERIALIZED_ZOO, "ir/", std::get<0>(GetParam())}); m_model_path = CommonTestUtils::getModelFromTestModelZoo(
ov::util::path_join({SERIALIZED_ZOO, "ir/", std::get<0>(GetParam())}));
if (!std::get<1>(GetParam()).empty()) { if (!std::get<1>(GetParam()).empty()) {
m_binary_path = ov::util::path_join({SERIALIZED_ZOO, "ir/", std::get<1>(GetParam())}); m_binary_path = CommonTestUtils::getModelFromTestModelZoo(
ov::util::path_join({SERIALIZED_ZOO, "ir/", std::get<1>(GetParam())}));
} }
const std::string test_name = GetTestName() + "_" + GetTimestamp(); const std::string test_name = GetTestName() + "_" + GetTimestamp();

View File

@ -46,7 +46,7 @@ set_property(SOURCE
${CMAKE_CURRENT_SOURCE_DIR}/src/manager.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/manager.cpp
APPEND PROPERTY COMPILE_DEFINITIONS APPEND PROPERTY COMPILE_DEFINITIONS
FRONTEND_LIB_PREFIX="${CMAKE_SHARED_LIBRARY_PREFIX}${FRONTEND_NAME_PREFIX}" FRONTEND_LIB_PREFIX="${CMAKE_SHARED_LIBRARY_PREFIX}${FRONTEND_NAME_PREFIX}"
FRONTEND_LIB_SUFFIX="${FRONTEND_NAME_SUFFIX}${IE_BUILD_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}") FRONTEND_LIB_SUFFIX="${FRONTEND_NAME_SUFFIX}${IE_BUILD_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX}${OpenVINO_VERSION_SUFFIX}")
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}_obj) add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}_obj)

View File

@ -24,8 +24,9 @@ target_link_libraries(${TARGET_NAME}
cnpy cnpy
# TODO: replace with nlohmann_json::nlohmann_json # TODO: replace with nlohmann_json::nlohmann_json
# but LTO fails for some reason # but LTO fails for some reason
nlohmann_json_schema_validator nlohmann_json_schema_validator)
test_builtin_extensions_1 test_builtin_extensions_2)
add_dependencies(${TARGET_NAME} test_builtin_extensions_1 test_builtin_extensions_2)
target_compile_definitions(${TARGET_NAME} target_compile_definitions(${TARGET_NAME}
PRIVATE PRIVATE

View File

@ -7,6 +7,7 @@
#include <openvino/op/util/framework_node.hpp> #include <openvino/op/util/framework_node.hpp>
#include <openvino/opsets/opset8.hpp> #include <openvino/opsets/opset8.hpp>
#include "common_test_utils/file_utils.hpp"
#include "conversion_extension.hpp" #include "conversion_extension.hpp"
#include "utils.hpp" #include "utils.hpp"
@ -29,7 +30,8 @@ void FrontEndConversionExtensionTest::initParamTest() {
} }
inline std::string get_lib_path(const std::string& lib_name) { inline std::string get_lib_path(const std::string& lib_name) {
return ov::util::make_plugin_library_name<char>(ov::util::get_ov_lib_path(), lib_name + IE_BUILD_POSTFIX); return ov::util::make_plugin_library_name<char>(CommonTestUtils::getExecutableDirectory(),
lib_name + IE_BUILD_POSTFIX);
} }
/////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////

View File

@ -10,6 +10,7 @@
#include <nlohmann/json.hpp> #include <nlohmann/json.hpp>
#include <ostream> #include <ostream>
#include "common_test_utils/file_utils.hpp"
#include "utils.hpp" #include "utils.hpp"
using namespace ov::frontend; using namespace ov::frontend;
@ -36,7 +37,8 @@ void FrontEndJsonConfigTest::initParamTest() {
} }
inline std::string get_lib_path(const std::string& lib_name) { inline std::string get_lib_path(const std::string& lib_name) {
return ov::util::make_plugin_library_name<char>(ov::util::get_ov_lib_path(), lib_name + IE_BUILD_POSTFIX); return ov::util::make_plugin_library_name<char>(CommonTestUtils::getExecutableDirectory(),
lib_name + IE_BUILD_POSTFIX);
} }
void FrontEndJsonConfigTest::generate_json_config() { void FrontEndJsonConfigTest::generate_json_config() {

View File

@ -8,7 +8,6 @@ file(GLOB LIBRARY_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
file(GLOB LIBRARY_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) file(GLOB LIBRARY_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp)
set(DEPENDENCIES openvino::runtime::dev offline_transformations) set(DEPENDENCIES openvino::runtime::dev offline_transformations)
set(DEFINITIONS)
if (ENABLE_OV_ONNX_FRONTEND) if (ENABLE_OV_ONNX_FRONTEND)
list(APPEND DEPENDENCIES openvino::frontend::onnx) list(APPEND DEPENDENCIES openvino::frontend::onnx)
@ -26,18 +25,13 @@ if (ENABLE_OV_PADDLE_FRONTEND)
endif() endif()
# Create library # Create library
add_library(${TARGET_NAME} SHARED ${LIBRARY_SRC} ${LIBRARY_HEADERS})
add_library(${TARGET_NAME} MODULE ${LIBRARY_SRC} ${LIBRARY_HEADERS})
target_compile_definitions(${TARGET_NAME} PRIVATE ${DEFINITIONS}) target_compile_definitions(${TARGET_NAME} PRIVATE ${DEFINITIONS})
target_link_libraries(${TARGET_NAME} PRIVATE ${DEPENDENCIES}) target_link_libraries(${TARGET_NAME} PRIVATE ${DEPENDENCIES})
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}) add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
if(WIN32) install(TARGETS ${TARGET_NAME}
install(TARGETS ${TARGET_NAME} LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)
RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL
LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)
else()
install(TARGETS ${TARGET_NAME}
RUNTIME DESTINATION tests/lib COMPONENT tests EXCLUDE_FROM_ALL
LIBRARY DESTINATION tests/lib COMPONENT tests EXCLUDE_FROM_ALL)
endif()

View File

@ -8,18 +8,11 @@ file(GLOB_RECURSE LIBRARY_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
file(GLOB_RECURSE LIBRARY_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) file(GLOB_RECURSE LIBRARY_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp)
# Create library # Create library
add_library(${TARGET_NAME} SHARED ${LIBRARY_SRC} ${LIBRARY_HEADERS}) add_library(${TARGET_NAME} MODULE ${LIBRARY_SRC} ${LIBRARY_HEADERS})
target_link_libraries(${TARGET_NAME} PRIVATE openvino::runtime::dev offline_transformations) target_link_libraries(${TARGET_NAME} PRIVATE openvino::runtime::dev offline_transformations)
add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME}) add_clang_format_target(${TARGET_NAME}_clang FOR_TARGETS ${TARGET_NAME})
if(WIN32) install(TARGETS ${TARGET_NAME}
install(TARGETS ${TARGET_NAME} LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)
RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL
LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)
else()
install(TARGETS ${TARGET_NAME}
RUNTIME DESTINATION tests/lib COMPONENT tests EXCLUDE_FROM_ALL
LIBRARY DESTINATION tests/lib COMPONENT tests EXCLUDE_FROM_ALL)
endif()

View File

@ -68,19 +68,68 @@ namespace {
#ifndef OPENVINO_STATIC_LIBRARY #ifndef OPENVINO_STATIC_LIBRARY
std::string parseXmlConfig(const std::string& xmlFile) { std::string findPluginXML(const std::string& xmlFile) {
std::string xmlConfigFile_ = xmlFile; std::string xmlConfigFile_ = xmlFile;
if (xmlConfigFile_.empty()) { if (xmlConfigFile_.empty()) {
// register plugins from default plugins.xml config const auto ielibraryDir = ie::getInferenceEngineLibraryPath();
// plugins.xml can be found in either:
// 1. openvino-X.Y.Z relative to libopenvino.so folder
std::ostringstream str;
str << "openvino-" << OPENVINO_VERSION_MAJOR << "." << OPENVINO_VERSION_MINOR << "." << OPENVINO_VERSION_PATCH;
const auto subFolder = ov::util::to_file_path(str.str());
// register plugins from default openvino-<openvino version>/plugins.xml config
ov::util::FilePath xmlConfigFileDefault = ov::util::FilePath xmlConfigFileDefault =
FileUtils::makePath(ie::getInferenceEngineLibraryPath(), ov::util::to_file_path("plugins.xml")); FileUtils::makePath(FileUtils::makePath(ielibraryDir, subFolder), ov::util::to_file_path("plugins.xml"));
xmlConfigFile_ = ov::util::from_file_path(xmlConfigFileDefault); if (FileUtils::fileExist(xmlConfigFileDefault))
return xmlConfigFile_ = ov::util::from_file_path(xmlConfigFileDefault);
// 2. in folder with libopenvino.so
xmlConfigFileDefault = FileUtils::makePath(ielibraryDir, ov::util::to_file_path("plugins.xml"));
if (FileUtils::fileExist(xmlConfigFileDefault))
return xmlConfigFile_ = ov::util::from_file_path(xmlConfigFileDefault);
throw ov::Exception("Failed to find plugins.xml file");
} }
return xmlConfigFile_; return xmlConfigFile_;
} }
#endif #endif
ov::util::FilePath getPluginPath(const std::string& pluginName, bool needAddSuffixes = false) {
const auto ieLibraryPath = ie::getInferenceEngineLibraryPath();
auto pluginPath = ov::util::to_file_path(pluginName.c_str());
// 0. user can provide a full path
if (FileUtils::fileExist(pluginPath))
return pluginPath;
if (needAddSuffixes)
pluginPath = FileUtils::makePluginLibraryName({}, pluginPath);
// plugin can be found either:
// 1. in openvino-X.Y.Z folder relative to libopenvino.so
std::ostringstream str;
str << "openvino-" << OPENVINO_VERSION_MAJOR << "." << OPENVINO_VERSION_MINOR << "." << OPENVINO_VERSION_PATCH;
const auto subFolder = ov::util::to_file_path(str.str());
ov::util::FilePath absFilePath = FileUtils::makePath(FileUtils::makePath(ieLibraryPath, subFolder), pluginPath);
if (FileUtils::fileExist(absFilePath))
return absFilePath;
// 2. in the openvino.so location
absFilePath = FileUtils::makePath(ieLibraryPath, pluginPath);
if (FileUtils::fileExist(absFilePath))
return absFilePath;
// 3. in LD_LIBRARY_PATH on Linux / PATH on Windows
return pluginPath;
}
template <typename T = ie::Parameter> template <typename T = ie::Parameter>
Parsed<T> parseDeviceNameIntoConfig(const std::string& deviceName, const std::map<std::string, T>& config = {}) { Parsed<T> parseDeviceNameIntoConfig(const std::string& deviceName, const std::map<std::string, T>& config = {}) {
auto config_ = config; auto config_ = config;
@ -502,19 +551,12 @@ public:
FOREACH_CHILD (pluginNode, devicesNode, "plugin") { FOREACH_CHILD (pluginNode, devicesNode, "plugin") {
std::string deviceName = GetStrAttr(pluginNode, "name"); std::string deviceName = GetStrAttr(pluginNode, "name");
ov::util::FilePath pluginPath = ov::util::to_file_path(GetStrAttr(pluginNode, "location").c_str()); ov::util::FilePath pluginPath = getPluginPath(GetStrAttr(pluginNode, "location"));
if (deviceName.find('.') != std::string::npos) { if (deviceName.find('.') != std::string::npos) {
IE_THROW() << "Device name must not contain dot '.' symbol"; IE_THROW() << "Device name must not contain dot '.' symbol";
} }
// append IR library path for default IE plugins
{
ov::util::FilePath absFilePath = FileUtils::makePath(ie::getInferenceEngineLibraryPath(), pluginPath);
if (FileUtils::fileExist(absFilePath))
pluginPath = absFilePath;
}
// check properties // check properties
auto propertiesNode = pluginNode.child("properties"); auto propertiesNode = pluginNode.child("properties");
std::map<std::string, std::string> config; std::map<std::string, std::string> config;
@ -886,6 +928,15 @@ public:
} }
} }
// BATCH case
{
if (deviceName.find("BATCH:") == 0) {
IE_THROW()
<< "You can get specific metrics with the GetMetric only for the BATCH itself (without devices). "
"To get individual devices's metrics call GetMetric for each device separately";
}
}
auto parsed = parseDeviceNameIntoConfig(deviceName); auto parsed = parseDeviceNameIntoConfig(deviceName);
for (auto o : options) { for (auto o : options) {
parsed._config.insert(o); parsed._config.insert(o);
@ -904,6 +955,9 @@ public:
OPENVINO_ASSERT(device_name.find("AUTO:") != 0, OPENVINO_ASSERT(device_name.find("AUTO:") != 0,
"set_property is supported only for AUTO itself (without devices). " "set_property is supported only for AUTO itself (without devices). "
"You can configure the devices with set_property before creating the AUTO on top."); "You can configure the devices with set_property before creating the AUTO on top.");
OPENVINO_ASSERT(device_name.find("BATCH:") != 0,
"set_property is supported only for BATCH itself (without devices). "
"You can configure the devices with set_property before creating the BATCH on top.");
ExtractAndSetDeviceConfig(properties); ExtractAndSetDeviceConfig(properties);
SetConfigForPlugins(any_copy(properties), device_name); SetConfigForPlugins(any_copy(properties), device_name);
@ -923,14 +977,17 @@ public:
Any get_property(const std::string& device_name, const std::string& name, const AnyMap& arguments) const override { Any get_property(const std::string& device_name, const std::string& name, const AnyMap& arguments) const override {
OPENVINO_ASSERT(device_name.find("HETERO:") != 0, OPENVINO_ASSERT(device_name.find("HETERO:") != 0,
"You can only get_config of the HETERO itself (without devices). " "You can only get_property of the HETERO itself (without devices). "
"get_config is also possible for the individual devices before creating the HETERO on top."); "get_property is also possible for the individual devices before creating the HETERO on top.");
OPENVINO_ASSERT(device_name.find("MULTI:") != 0, OPENVINO_ASSERT(device_name.find("MULTI:") != 0,
"You can only get_config of the MULTI itself (without devices). " "You can only get_property of the MULTI itself (without devices). "
"get_config is also possible for the individual devices before creating the MULTI on top."); "get_property is also possible for the individual devices before creating the MULTI on top.");
OPENVINO_ASSERT(device_name.find("AUTO:") != 0, OPENVINO_ASSERT(device_name.find("AUTO:") != 0,
"You can only get_config of the AUTO itself (without devices). " "You can only get_property of the AUTO itself (without devices). "
"get_config is also possible for the individual devices before creating the AUTO on top."); "get_property is also possible for the individual devices before creating the AUTO on top.");
OPENVINO_ASSERT(device_name.find("BATCH:") != 0,
"You can only get_property of the BATCH itself (without devices). "
"get_property is also possible for the individual devices before creating the BATCH on top.");
if (device_name.empty()) { if (device_name.empty()) {
return get_property_for_core(name); return get_property_for_core(name);
@ -1023,7 +1080,7 @@ public:
if (pluginName == ov::DEFAULT_DEVICE_NAME) if (pluginName == ov::DEFAULT_DEVICE_NAME)
IE_THROW() << "No device is provided, so AUTO device is used by default, which failed loading."; IE_THROW() << "No device is provided, so AUTO device is used by default, which failed loading.";
else else
IE_THROW() << "Device with \"" << deviceName << "\" name is not registered in the InferenceEngine"; IE_THROW() << "Device with \"" << deviceName << "\" name is not registered in the OpenVINO Runtime";
} }
} }
std::lock_guard<std::mutex> lock(get_mutex(deviceName)); std::lock_guard<std::mutex> lock(get_mutex(deviceName));
@ -1141,7 +1198,7 @@ public:
std::lock_guard<std::mutex> lock(get_mutex()); std::lock_guard<std::mutex> lock(get_mutex());
auto it = plugins.find(deviceName); auto it = plugins.find(deviceName);
if (it == plugins.end()) { if (it == plugins.end()) {
IE_THROW() << "Device with \"" << deviceName << "\" name is not registered in the InferenceEngine"; IE_THROW() << "Device with \"" << deviceName << "\" name is not registered in the OpenVINO Runtime";
} }
plugins.erase(deviceName); plugins.erase(deviceName);
@ -1156,24 +1213,14 @@ public:
auto it = pluginRegistry.find(deviceName); auto it = pluginRegistry.find(deviceName);
if (it != pluginRegistry.end()) { if (it != pluginRegistry.end()) {
IE_THROW() << "Device with \"" << deviceName << "\" is already registered in the InferenceEngine"; IE_THROW() << "Device with \"" << deviceName << "\" is already registered in the OpenVINO Runtime";
} }
if (deviceName.find('.') != std::string::npos) { if (deviceName.find('.') != std::string::npos) {
IE_THROW() << "Device name must not contain dot '.' symbol"; IE_THROW() << "Device name must not contain dot '.' symbol";
} }
// append IR library path for default IE plugins PluginDescriptor desc{getPluginPath(pluginName, true)};
ov::util::FilePath pluginPath;
{
pluginPath = FileUtils::makePluginLibraryName({}, ov::util::to_file_path(pluginName.c_str()));
ov::util::FilePath absFilePath = FileUtils::makePath(ie::getInferenceEngineLibraryPath(), pluginPath);
if (FileUtils::fileExist(absFilePath))
pluginPath = absFilePath;
}
PluginDescriptor desc{pluginPath};
pluginRegistry[deviceName] = desc; pluginRegistry[deviceName] = desc;
add_mutex(deviceName); add_mutex(deviceName);
} }
@ -1241,7 +1288,7 @@ public:
} }
if (!configIsSet && !deviceName.empty()) { if (!configIsSet && !deviceName.empty()) {
IE_THROW() << "Device with \"" << deviceName << "\" name is not registered in the InferenceEngine"; IE_THROW() << "Device with \"" << deviceName << "\" name is not registered in the OpenVINO Runtime";
} }
// set config for already created plugins // set config for already created plugins
@ -1552,7 +1599,7 @@ Core::Core(const std::string& xmlConfigFile) {
#ifdef OPENVINO_STATIC_LIBRARY #ifdef OPENVINO_STATIC_LIBRARY
_impl->RegisterPluginsInRegistry(::getStaticPluginsRegistry()); _impl->RegisterPluginsInRegistry(::getStaticPluginsRegistry());
#else #else
RegisterPlugins(ov::parseXmlConfig(xmlConfigFile)); RegisterPlugins(ov::findPluginXML(xmlConfigFile));
#endif #endif
} }
@ -1831,7 +1878,7 @@ Core::Core(const std::string& xmlConfigFile) {
#ifdef OPENVINO_STATIC_LIBRARY #ifdef OPENVINO_STATIC_LIBRARY
_impl->RegisterPluginsInRegistry(::getStaticPluginsRegistry()); _impl->RegisterPluginsInRegistry(::getStaticPluginsRegistry());
#else #else
register_plugins(parseXmlConfig(xmlConfigFile)); register_plugins(findPluginXML(xmlConfigFile));
#endif #endif
} }
@ -2014,6 +2061,7 @@ RemoteContext Core::create_context(const std::string& deviceName, const AnyMap&
OPENVINO_ASSERT(deviceName.find("HETERO") != 0, "HETERO device does not support remote context"); OPENVINO_ASSERT(deviceName.find("HETERO") != 0, "HETERO device does not support remote context");
OPENVINO_ASSERT(deviceName.find("MULTI") != 0, "MULTI device does not support remote context"); OPENVINO_ASSERT(deviceName.find("MULTI") != 0, "MULTI device does not support remote context");
OPENVINO_ASSERT(deviceName.find("AUTO") != 0, "AUTO device does not support remote context"); OPENVINO_ASSERT(deviceName.find("AUTO") != 0, "AUTO device does not support remote context");
OPENVINO_ASSERT(deviceName.find("BATCH") != 0, "BATCH device does not support remote context");
OV_CORE_CALL_STATEMENT({ OV_CORE_CALL_STATEMENT({
auto parsed = parseDeviceNameIntoConfig(deviceName, flatten_sub_properties(deviceName, params)); auto parsed = parseDeviceNameIntoConfig(deviceName, flatten_sub_properties(deviceName, params));
@ -2023,9 +2071,10 @@ RemoteContext Core::create_context(const std::string& deviceName, const AnyMap&
} }
RemoteContext Core::get_default_context(const std::string& deviceName) { RemoteContext Core::get_default_context(const std::string& deviceName) {
OPENVINO_ASSERT(deviceName.find("HETERO") != 0, "HETERO device does not support remote context"); OPENVINO_ASSERT(deviceName.find("HETERO") != 0, "HETERO device does not support default remote context");
OPENVINO_ASSERT(deviceName.find("MULTI") != 0, "MULTI device does not support remote context"); OPENVINO_ASSERT(deviceName.find("MULTI") != 0, "MULTI device does not support default remote context");
OPENVINO_ASSERT(deviceName.find("AUTO") != 0, "AUTO device does not support remote context"); OPENVINO_ASSERT(deviceName.find("AUTO") != 0, "AUTO device does not support default remote context");
OPENVINO_ASSERT(deviceName.find("BATCH") != 0, "BATCH device does not support default remote context");
OV_CORE_CALL_STATEMENT({ OV_CORE_CALL_STATEMENT({
auto parsed = parseDeviceNameIntoConfig(deviceName, AnyMap{}); auto parsed = parseDeviceNameIntoConfig(deviceName, AnyMap{});

View File

@ -90,74 +90,54 @@ class Reader : public IReader {
using ReaderPtr = ov::SoPtr<IReader>; using ReaderPtr = ov::SoPtr<IReader>;
# endif # endif
ReaderPtr ptr; ReaderPtr ptr;
std::once_flag readFlag;
std::string name;
std::string location;
ReaderPtr getReaderPtr() {
std::call_once(readFlag, [&]() {
# ifdef OPENVINO_STATIC_LIBRARY
// call library creator directly, since we are in the same application
InferenceEngine::CreateReader(ptr);
OPENVINO_ASSERT(ptr != nullptr, "Failed to create static version of IR v7 reader");
# else
ov::util::FilePath libraryName = ov::util::to_file_path(location);
ov::util::FilePath readersLibraryPath =
FileUtils::makePluginLibraryName(getInferenceEngineLibraryPath(), libraryName);
if (!FileUtils::fileExist(readersLibraryPath)) {
IE_THROW() << "Please, make sure that Inference Engine reader library exists "
<< ov::util::from_file_path(::FileUtils::makePluginLibraryName({}, libraryName)) << " is in "
<< getIELibraryPath();
}
auto so = ov::util::load_shared_object(readersLibraryPath.c_str());
std::shared_ptr<IReader> plugin_impl;
using createFunc = void(std::shared_ptr<IReader>&);
reinterpret_cast<createFunc*>(ov::util::get_symbol(so, "CreateReader"))(plugin_impl);
ptr = {plugin_impl, so};
# endif // OPENVINO_STATIC_LIBRARY
});
return ptr;
}
ReaderPtr getReaderPtr() const {
return const_cast<Reader*>(this)->getReaderPtr();
}
public: public:
using Ptr = std::shared_ptr<Reader>; using Ptr = std::shared_ptr<Reader>;
Reader(const std::string& name, const std::string location) : name(name), location(location) {} explicit Reader(const std::string& location) {
# ifdef OPENVINO_STATIC_LIBRARY
// call library creator directly, since we are in the same application
InferenceEngine::CreateReader(ptr);
OPENVINO_ASSERT(ptr != nullptr, "Failed to create static version of IR v7 reader");
# else
ov::util::FilePath libraryPath = ov::util::to_file_path(FileUtils::makePluginLibraryName({}, location));
ov::util::FilePath readersLibraryPath = FileUtils::makePath(getInferenceEngineLibraryPath(), libraryPath);
if (FileUtils::fileExist(readersLibraryPath)) {
libraryPath = readersLibraryPath;
}
auto so = ov::util::load_shared_object(libraryPath.c_str());
std::shared_ptr<IReader> plugin_impl;
using createFunc = void(std::shared_ptr<IReader>&);
reinterpret_cast<createFunc*>(ov::util::get_symbol(so, "CreateReader"))(plugin_impl);
ptr = {plugin_impl, so};
# endif // OPENVINO_STATIC_LIBRARY
}
bool supportModel(std::istream& model) const override { bool supportModel(std::istream& model) const override {
OV_ITT_SCOPED_TASK(ov::itt::domains::IE, "Reader::supportModel"); OV_ITT_SCOPED_TASK(ov::itt::domains::IE, "Reader::supportModel");
auto reader = getReaderPtr(); return ptr->supportModel(model);
return reader->supportModel(model);
} }
CNNNetwork read(std::istream& model, const std::vector<IExtensionPtr>& exts) const override { CNNNetwork read(std::istream& model, const std::vector<IExtensionPtr>& exts) const override {
auto reader = getReaderPtr(); return ptr->read(model, exts);
return reader->read(model, exts);
} }
CNNNetwork read(std::istream& model, CNNNetwork read(std::istream& model,
const Blob::CPtr& weights, const Blob::CPtr& weights,
const std::vector<IExtensionPtr>& exts) const override { const std::vector<IExtensionPtr>& exts) const override {
auto reader = getReaderPtr(); return ptr->read(model, weights, exts);
return reader->read(model, weights, exts);
} }
std::vector<std::string> getDataFileExtensions() const override { std::vector<std::string> getDataFileExtensions() const override {
auto reader = getReaderPtr(); return ptr->getDataFileExtensions();
return reader->getDataFileExtensions();
}
std::string getName() const {
return name;
} }
}; };
namespace { namespace {
// Extension to plugins creator Reader::Ptr reader_irv7 = nullptr;
std::multimap<std::string, Reader::Ptr> readers;
void registerReaders() { void registerReaders() {
OV_ITT_SCOPED_TASK(ov::itt::domains::IE, "registerReaders"); OV_ITT_SCOPED_TASK(ov::itt::domains::IE, "registerReaders");
@ -167,42 +147,24 @@ void registerReaders() {
if (initialized) if (initialized)
return; return;
auto create_if_exists = [](const std::string name, const std::string library_name) { initialized = true;
# ifndef OPENVINO_STATIC_LIBRARY
ov::util::FilePath libraryName = ov::util::to_file_path(library_name);
ov::util::FilePath readersLibraryPath =
FileUtils::makePluginLibraryName(getInferenceEngineLibraryPath(), libraryName);
if (!FileUtils::fileExist(readersLibraryPath))
return std::shared_ptr<Reader>();
# endif // !OPENVINO_STATIC_LIBRARY
return std::make_shared<Reader>(name, library_name);
};
// try to load IR reader v7 if library exists // try to load IR reader v7 if library exists
auto irReaderv7 = try {
create_if_exists("IRv7", std::string("inference_engine_ir_v7_reader") + std::string(IE_BUILD_POSTFIX)); reader_irv7 =
if (irReaderv7) std::make_shared<Reader>(std::string("inference_engine_ir_v7_reader") + std::string(IE_BUILD_POSTFIX));
readers.emplace("xml", irReaderv7); } catch (const std::runtime_error&) {
// runtime error is thrown in case of library cannot be loaded
initialized = true; }
} }
void assertIfIRv7LikeModel(std::istream& modelStream) { void assertIfIRv7LikeModel(std::istream& modelStream) {
auto irVersion = details::GetIRVersion(modelStream); auto irVersion = details::GetIRVersion(modelStream);
bool isIRv7 = irVersion > 1 && irVersion <= 7; bool isIRv7 = irVersion > 1 && irVersion <= 7;
if (!isIRv7) if (!isIRv7 || reader_irv7)
return; return;
for (auto&& kvp : readers) {
Reader::Ptr reader = kvp.second;
// if we have reader for IR v7
if (reader->getName() == "IRv7") {
return;
}
}
IE_THROW() << "The support of IR v" << irVersion IE_THROW() << "The support of IR v" << irVersion
<< " has been removed from the product. " << " has been removed from the product. "
"Please, convert the original model using the Model Optimizer which comes with this " "Please, convert the original model using the Model Optimizer which comes with this "
@ -226,60 +188,56 @@ CNNNetwork load_ir_v7_network(const std::string& modelPath,
assertIfIRv7LikeModel(modelStream); assertIfIRv7LikeModel(modelStream);
auto fileExt = modelPath.substr(modelPath.find_last_of(".") + 1); // Check that reader supports the model
for (auto it = readers.lower_bound(fileExt); it != readers.upper_bound(fileExt); it++) { if (reader_irv7 && reader_irv7->supportModel(modelStream)) {
auto reader = it->second; // Find weights
// Check that reader supports the model std::string bPath = binPath;
if (reader->supportModel(modelStream)) { if (bPath.empty()) {
// Find weights auto pathWoExt = modelPath;
std::string bPath = binPath; auto pos = modelPath.rfind('.');
if (bPath.empty()) { if (pos != std::string::npos)
auto pathWoExt = modelPath; pathWoExt = modelPath.substr(0, pos);
auto pos = modelPath.rfind('.'); for (const auto& ext : reader_irv7->getDataFileExtensions()) {
if (pos != std::string::npos) bPath = pathWoExt + "." + ext;
pathWoExt = modelPath.substr(0, pos); if (!FileUtils::fileExist(bPath)) {
for (const auto& ext : reader->getDataFileExtensions()) { bPath.clear();
bPath = pathWoExt + "." + ext; } else {
if (!FileUtils::fileExist(bPath)) { break;
bPath.clear();
} else {
break;
}
} }
} }
if (!bPath.empty()) {
// Open weights file
# if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32)
std::wstring weights_path = ov::util::string_to_wstring(bPath.c_str());
# else
std::string weights_path = bPath;
# endif
std::ifstream binStream;
binStream.open(weights_path, std::ios::binary);
if (!binStream.is_open())
IE_THROW() << "Weights file " << bPath << " cannot be opened!";
binStream.seekg(0, std::ios::end);
size_t fileSize = binStream.tellg();
binStream.seekg(0, std::ios::beg);
Blob::Ptr weights = make_shared_blob<uint8_t>({Precision::U8, {fileSize}, C});
{
OV_ITT_SCOPE(FIRST_INFERENCE, ov::itt::domains::IE_RT, "ReadNetworkWeights");
weights->allocate();
binStream.read(weights->buffer(), fileSize);
binStream.close();
}
// read model with weights
auto network = reader->read(modelStream, weights, exts);
modelStream.close();
return network;
}
// read model without weights
return reader->read(modelStream, exts);
} }
if (!bPath.empty()) {
// Open weights file
# if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32)
std::wstring weights_path = ov::util::string_to_wstring(bPath.c_str());
# else
std::string weights_path = bPath;
# endif
std::ifstream binStream;
binStream.open(weights_path, std::ios::binary);
if (!binStream.is_open())
IE_THROW() << "Weights file " << bPath << " cannot be opened!";
binStream.seekg(0, std::ios::end);
size_t fileSize = binStream.tellg();
binStream.seekg(0, std::ios::beg);
Blob::Ptr weights = make_shared_blob<uint8_t>({Precision::U8, {fileSize}, C});
{
OV_ITT_SCOPE(FIRST_INFERENCE, ov::itt::domains::IE_RT, "ReadNetworkWeights");
weights->allocate();
binStream.read(weights->buffer(), fileSize);
binStream.close();
}
// read model with weights
auto network = reader_irv7->read(modelStream, weights, exts);
modelStream.close();
return network;
}
// read model without weights
return reader_irv7->read(modelStream, exts);
} }
return {}; return {};
@ -537,14 +495,11 @@ CNNNetwork details::ReadNetwork(const std::string& model,
registerReaders(); registerReaders();
assertIfIRv7LikeModel(modelStream); assertIfIRv7LikeModel(modelStream);
for (auto it = readers.begin(); it != readers.end(); it++) { if (reader_irv7 && reader_irv7->supportModel(modelStream)) {
auto reader = it->second; OPENVINO_ASSERT(!newAPI, "Cannot read IR v7 from OpenVINO 2.0 API");
if (reader->supportModel(modelStream)) { if (weights)
OPENVINO_ASSERT(!newAPI, "Cannot read IR v7 from OpenVINO 2.0 API"); return reader_irv7->read(modelStream, weights, exts);
if (weights) return reader_irv7->read(modelStream, exts);
return reader->read(modelStream, weights, exts);
return reader->read(modelStream, exts);
}
} }
} }
#endif // ENABLE_IR_V7_READER #endif // ENABLE_IR_V7_READER

View File

@ -9,7 +9,13 @@ add_library(engines_test_util STATIC EXCLUDE_FROM_ALL ${ENGINES_UTIL_SRC})
ie_faster_build(engines_test_util UNITY) ie_faster_build(engines_test_util UNITY)
target_link_libraries(engines_test_util PUBLIC openvino::runtime openvino::runtime::dev gtest gmock ngraph_test_util) target_link_libraries(engines_test_util PUBLIC openvino::runtime openvino::runtime::dev gtest gmock ngraph_test_util)
target_include_directories(engines_test_util PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(engines_test_util PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..") target_include_directories(engines_test_util
PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}"
"${CMAKE_CURRENT_SOURCE_DIR}/.."
PRIVATE
$<TARGET_PROPERTY:commonTestUtils,INTERFACE_INCLUDE_DIRECTORIES>)
add_clang_format_target(engines_test_util_clang FOR_SOURCES ${ENGINES_UTIL_SRC}) add_clang_format_target(engines_test_util_clang FOR_SOURCES ${ENGINES_UTIL_SRC})

View File

@ -4,6 +4,8 @@
#include "test_case.hpp" #include "test_case.hpp"
#include "common_test_utils/file_utils.hpp"
#include "openvino/util/file_util.hpp"
#include "shared_utils.hpp" #include "shared_utils.hpp"
namespace { namespace {
@ -176,5 +178,17 @@ testing::AssertionResult TestCase::compare_results_with_tolerance_as_fp(float to
return comparison_result; return comparison_result;
} }
TestCase::TestCase(const std::shared_ptr<Function>& function, const std::string& dev) : m_function{function} {
try {
// Register template plugin
m_core.register_plugin(
ov::util::make_plugin_library_name(CommonTestUtils::getExecutableDirectory(),
std::string("openvino_template_plugin") + IE_BUILD_POSTFIX),
"TEMPLATE");
} catch (...) {
}
m_request = m_core.compile_model(function, dev).create_infer_request();
}
} // namespace test } // namespace test
} // namespace ngraph } // namespace ngraph

View File

@ -13,6 +13,7 @@
#include "ngraph/function.hpp" #include "ngraph/function.hpp"
#include "ngraph/ngraph.hpp" #include "ngraph/ngraph.hpp"
#include "openvino/runtime/core.hpp" #include "openvino/runtime/core.hpp"
#include "openvino/util/file_util.hpp"
#include "test_tools.hpp" #include "test_tools.hpp"
namespace ngraph { namespace ngraph {
@ -31,14 +32,7 @@ std::shared_ptr<Function> function_from_ir(const std::string& xml_path, const st
class TestCase { class TestCase {
public: public:
TestCase(const std::shared_ptr<Function>& function, const std::string& dev = "TEMPLATE") : m_function{function} { TestCase(const std::shared_ptr<Function>& function, const std::string& dev = "TEMPLATE");
try {
// Register template plugin
m_core.register_plugin(std::string("openvino_template_plugin") + IE_BUILD_POSTFIX, "TEMPLATE");
} catch (...) {
}
m_request = m_core.compile_model(function, dev).create_infer_request();
}
template <typename T> template <typename T>
void add_input(const Shape& shape, const std::vector<T>& values) { void add_input(const Shape& shape, const std::vector<T>& values) {

View File

@ -33,10 +33,6 @@ if(ENABLE_OV_IR_FRONTEND)
list(APPEND DEPENDENCIES openvino_ir_frontend) list(APPEND DEPENDENCIES openvino_ir_frontend)
endif() endif()
if(ENABLE_IR_V7_READER)
list(APPEND DEPENDENCIES inference_engine_ir_v7_reader)
endif()
if(ENABLE_HETERO) if(ENABLE_HETERO)
list(APPEND DEPENDENCIES openvino_hetero_plugin) list(APPEND DEPENDENCIES openvino_hetero_plugin)
endif() endif()

View File

@ -17,6 +17,7 @@
#include "ie_metric_helpers.hpp" #include "ie_metric_helpers.hpp"
#include "openvino/op/logical_not.hpp" #include "openvino/op/logical_not.hpp"
#include "openvino/util/file_util.hpp"
#include "ie_remote_context.hpp" #include "ie_remote_context.hpp"
#include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp" #include "cpp_interfaces/interface/ie_iexecutable_network_internal.hpp"
#include "cpp_interfaces/interface/ie_iplugin_internal.hpp" #include "cpp_interfaces/interface/ie_iplugin_internal.hpp"
@ -197,9 +198,10 @@ public:
using CheckConfigCb = std::function<void(const std::map<std::string, std::string> &)>; using CheckConfigCb = std::function<void(const std::map<std::string, std::string> &)>;
CheckConfigCb m_checkConfigCb = nullptr; CheckConfigCb m_checkConfigCb = nullptr;
static std::string get_mock_engine_name() { static std::string get_mock_engine_path() {
std::string mockEngineName("mock_engine"); std::string mockEngineName("mock_engine");
return CommonTestUtils::pre + mockEngineName + IE_BUILD_POSTFIX + CommonTestUtils::ext; return ov::util::make_plugin_library_name(CommonTestUtils::getExecutableDirectory(),
mockEngineName + IE_BUILD_POSTFIX);
} }
static std::string generateTestFilePrefix() { static std::string generateTestFilePrefix() {
@ -288,8 +290,8 @@ public:
initParamTest(); initParamTest();
mockPlugin = std::make_shared<MockCachingInferencePlugin>(); mockPlugin = std::make_shared<MockCachingInferencePlugin>();
setupMock(*mockPlugin); setupMock(*mockPlugin);
std::string libraryName = get_mock_engine_name(); std::string libraryPath = get_mock_engine_path();
sharedObjectLoader = ov::util::load_shared_object(libraryName.c_str()); sharedObjectLoader = ov::util::load_shared_object(libraryPath.c_str());
injectProxyEngine = make_std_function<void(IInferencePlugin*)>("InjectProxyEngine"); injectProxyEngine = make_std_function<void(IInferencePlugin*)>("InjectProxyEngine");
FuncTestUtils::TestModel::generateTestModel(modelName, weightsName); FuncTestUtils::TestModel::generateTestModel(modelName, weightsName);
@ -308,7 +310,8 @@ public:
void testLoad(const std::function<void(Core& ie)>& func) { void testLoad(const std::function<void(Core& ie)>& func) {
Core ie; Core ie;
injectProxyEngine(mockPlugin.get()); injectProxyEngine(mockPlugin.get());
ie.RegisterPlugin(std::string("mock_engine") + IE_BUILD_POSTFIX, deviceName); ie.RegisterPlugin(ov::util::make_plugin_library_name(CommonTestUtils::getExecutableDirectory(),
std::string("mock_engine") + IE_BUILD_POSTFIX), deviceName);
func(ie); func(ie);
ie.UnregisterPlugin(deviceName); ie.UnregisterPlugin(deviceName);
} }

View File

@ -8,6 +8,7 @@
#include "openvino/opsets/opset.hpp" #include "openvino/opsets/opset.hpp"
#include "openvino/pass/serialize.hpp" #include "openvino/pass/serialize.hpp"
#include <common_test_utils/file_utils.hpp> #include <common_test_utils/file_utils.hpp>
#include "openvino/util/file_util.hpp"
using namespace InferenceEngine; using namespace InferenceEngine;
@ -154,7 +155,8 @@ public:
void SetUp() override { void SetUp() override {
std::shared_ptr<ov::Model> model = CNNNetworkTests_create_model(); std::shared_ptr<ov::Model> model = CNNNetworkTests_create_model();
ov::pass::Serialize(modelName, weightsName).run_on_model(model); ov::pass::Serialize(modelName, weightsName).run_on_model(model);
core.RegisterPlugin(std::string("mock_engine") + IE_BUILD_POSTFIX, "mock"); ASSERT_NO_THROW(core.RegisterPlugin(ov::util::make_plugin_library_name(CommonTestUtils::getExecutableDirectory(),
std::string("mock_engine") + IE_BUILD_POSTFIX), "mock"));
} }
void TearDown() override { void TearDown() override {

View File

@ -6,7 +6,7 @@
#include <ie_plugin_config.hpp> #include <ie_plugin_config.hpp>
#include <ie_extension.h> #include <ie_extension.h>
#include <file_utils.h> #include "openvino/util/file_util.hpp"
#include <ngraph_functions/subgraph_builders.hpp> #include <ngraph_functions/subgraph_builders.hpp>
#include <functional_test_utils/test_model/test_model.hpp> #include <functional_test_utils/test_model/test_model.hpp>
#include <common_test_utils/file_utils.hpp> #include <common_test_utils/file_utils.hpp>
@ -54,7 +54,7 @@ public:
void safeAddExtension(InferenceEngine::Core & ie) { void safeAddExtension(InferenceEngine::Core & ie) {
try { try {
auto extension = std::make_shared<InferenceEngine::Extension>( auto extension = std::make_shared<InferenceEngine::Extension>(
FileUtils::makePluginLibraryName<char>({}, ov::util::make_plugin_library_name(CommonTestUtils::getExecutableDirectory(),
std::string("template_extension") + IE_BUILD_POSTFIX)); std::string("template_extension") + IE_BUILD_POSTFIX));
ie.AddExtension(extension); ie.AddExtension(extension);
} catch (const InferenceEngine::Exception & ex) { } catch (const InferenceEngine::Exception & ex) {
@ -84,7 +84,8 @@ TEST_F(CoreThreadingTests, RegisterPlugin) {
std::atomic<int> index{0}; std::atomic<int> index{0};
runParallel([&] () { runParallel([&] () {
const std::string deviceName = std::to_string(index++); const std::string deviceName = std::to_string(index++);
ie.RegisterPlugin(std::string("mock_engine") + IE_BUILD_POSTFIX, deviceName); ie.RegisterPlugin(ov::util::make_plugin_library_name(CommonTestUtils::getExecutableDirectory(),
std::string("mock_engine") + IE_BUILD_POSTFIX), deviceName);
ie.GetVersions(deviceName); ie.GetVersions(deviceName);
ie.UnregisterPlugin(deviceName); ie.UnregisterPlugin(deviceName);
}, 4000); }, 4000);
@ -97,12 +98,12 @@ TEST_F(CoreThreadingTests, RegisterPlugins) {
auto getPluginXml = [&] () -> std::tuple<std::string, std::string> { auto getPluginXml = [&] () -> std::tuple<std::string, std::string> {
std::string indexStr = std::to_string(index++); std::string indexStr = std::to_string(index++);
std::string pluginsXML = InferenceEngine::getIELibraryPath() + std::string pluginsXML = "test_plugins" + indexStr + ".xml";
ov::util::FileTraits<char>::file_separator +
"test_plugins" + indexStr + ".xml";
std::ofstream file(pluginsXML); std::ofstream file(pluginsXML);
file << "<ie><plugins><plugin location=\""; file << "<ie><plugins><plugin location=\"";
file << CommonTestUtils::getExecutableDirectory();
file << ov::util::FileTraits<char>::file_separator;
file << ov::util::FileTraits<char>::library_prefix(); file << ov::util::FileTraits<char>::library_prefix();
file << "mock_engine"; file << "mock_engine";
file << IE_BUILD_POSTFIX; file << IE_BUILD_POSTFIX;

View File

@ -24,11 +24,13 @@
#endif #endif
static std::string get_extension_path() { static std::string get_extension_path() {
return FileUtils::makePluginLibraryName<char>({}, std::string("template_extension") + IE_BUILD_POSTFIX); return FileUtils::makePluginLibraryName<char>(CommonTestUtils::getExecutableDirectory(),
std::string("template_extension") + IE_BUILD_POSTFIX);
} }
static std::string get_ov_extension_path() { static std::string get_ov_extension_path() {
return FileUtils::makePluginLibraryName<char>({}, std::string("openvino_template_extension") + IE_BUILD_POSTFIX); return FileUtils::makePluginLibraryName<char>(CommonTestUtils::getExecutableDirectory(),
std::string("openvino_template_extension") + IE_BUILD_POSTFIX);
} }
class CustomOpsSerializationTest : public ::testing::Test { class CustomOpsSerializationTest : public ::testing::Test {

View File

@ -11,7 +11,8 @@
#include <vector> #include <vector>
#include "common_test_utils/test_common.hpp" #include "common_test_utils/test_common.hpp"
#include "file_utils.h" #include "common_test_utils/file_utils.hpp"
#include "openvino/util/file_util.hpp"
#include "ie_iextension.h" #include "ie_iextension.h"
#include "ngraph/op/op.hpp" #include "ngraph/op/op.hpp"
#include "openvino/core/op_extension.hpp" #include "openvino/core/op_extension.hpp"
@ -174,7 +175,8 @@ public:
namespace { namespace {
std::string getOVExtensionPath() { std::string getOVExtensionPath() {
return FileUtils::makePluginLibraryName<char>({}, std::string("openvino_template_extension") + IE_BUILD_POSTFIX); return ov::util::make_plugin_library_name(CommonTestUtils::getExecutableDirectory(),
std::string("openvino_template_extension") + IE_BUILD_POSTFIX);
} }
} // namespace } // namespace

View File

@ -6,6 +6,7 @@
#include <file_utils.h> #include <file_utils.h>
#include "openvino/util/shared_object.hpp" #include "openvino/util/shared_object.hpp"
#include "common_test_utils/file_utils.hpp"
#include <cpp/ie_plugin.hpp> #include <cpp/ie_plugin.hpp>
using namespace ::testing; using namespace ::testing;
@ -14,7 +15,7 @@ using namespace std;
class SharedObjectOVTests : public ::testing::Test { class SharedObjectOVTests : public ::testing::Test {
protected: protected:
std::string get_mock_engine_name() { std::string get_mock_engine_name() {
return FileUtils::makePluginLibraryName<char>({}, return FileUtils::makePluginLibraryName<char>(CommonTestUtils::getExecutableDirectory(),
std::string("mock_engine") + IE_BUILD_POSTFIX); std::string("mock_engine") + IE_BUILD_POSTFIX);
} }

View File

@ -6,6 +6,7 @@
#include <file_utils.h> #include <file_utils.h>
#include "openvino/util/shared_object.hpp" #include "openvino/util/shared_object.hpp"
#include "common_test_utils/file_utils.hpp"
#include <cpp/ie_plugin.hpp> #include <cpp/ie_plugin.hpp>
using namespace std; using namespace std;
@ -15,7 +16,7 @@ using namespace InferenceEngine::details;
class SharedObjectLoaderTests: public ::testing::Test { class SharedObjectLoaderTests: public ::testing::Test {
protected: protected:
std::string get_mock_engine_name() { std::string get_mock_engine_name() {
return FileUtils::makePluginLibraryName<char>({}, return FileUtils::makePluginLibraryName<char>(CommonTestUtils::getExecutableDirectory(),
std::string("mock_engine") + IE_BUILD_POSTFIX); std::string("mock_engine") + IE_BUILD_POSTFIX);
} }

View File

@ -3,6 +3,8 @@
// //
#include "functional_test_utils/core_config.hpp" #include "functional_test_utils/core_config.hpp"
#include "common_test_utils/file_utils.hpp"
#include "openvino/util/file_util.hpp"
#include "conformance.hpp" #include "conformance.hpp"
@ -11,7 +13,8 @@ void CoreConfiguration(LayerTestsUtils::LayerTestsCommon* test) {
auto availableDevices = core->GetAvailableDevices(); auto availableDevices = core->GetAvailableDevices();
std::string targetDevice = std::string(ov::test::conformance::targetDevice); std::string targetDevice = std::string(ov::test::conformance::targetDevice);
if (std::find(availableDevices.begin(), availableDevices.end(), targetDevice) == availableDevices.end()) { if (std::find(availableDevices.begin(), availableDevices.end(), targetDevice) == availableDevices.end()) {
core->RegisterPlugin(ov::test::conformance::targetPluginName, core->RegisterPlugin(ov::util::make_plugin_library_name(CommonTestUtils::getExecutableDirectory(),
std::string(ov::test::conformance::targetPluginName) + IE_BUILD_POSTFIX),
ov::test::conformance::targetDevice); ov::test::conformance::targetDevice);
} }
} }

View File

@ -3,6 +3,8 @@
// //
#include "functional_test_utils/core_config.hpp" #include "functional_test_utils/core_config.hpp"
#include "common_test_utils/file_utils.hpp"
#include "openvino/util/file_util.hpp"
#include "conformance.hpp" #include "conformance.hpp"
@ -11,7 +13,8 @@ void CoreConfiguration(LayerTestsUtils::LayerTestsCommon* test) {
auto availableDevices = core->GetAvailableDevices(); auto availableDevices = core->GetAvailableDevices();
std::string targetDevice = std::string(ov::test::conformance::targetDevice); std::string targetDevice = std::string(ov::test::conformance::targetDevice);
if (std::find(availableDevices.begin(), availableDevices.end(), targetDevice) == availableDevices.end()) { if (std::find(availableDevices.begin(), availableDevices.end(), targetDevice) == availableDevices.end()) {
core->RegisterPlugin(ov::test::conformance::targetPluginName, core->RegisterPlugin(ov::util::make_plugin_library_name(CommonTestUtils::getExecutableDirectory(),
std::string(ov::test::conformance::targetPluginName) + IE_BUILD_POSTFIX),
ov::test::conformance::targetDevice); ov::test::conformance::targetDevice);
} }
} }

View File

@ -7,6 +7,7 @@
#include <ngraph/ngraph.hpp> #include <ngraph/ngraph.hpp>
#include <file_utils.h> #include <file_utils.h>
#include <common_test_utils/test_assertions.hpp> #include <common_test_utils/test_assertions.hpp>
#include "common_test_utils/file_utils.hpp"
class CustomAbsKernel : public InferenceEngine::ILayerExecImpl { class CustomAbsKernel : public InferenceEngine::ILayerExecImpl {
public: public:
@ -199,7 +200,8 @@ TEST(Extension, XmlModelWithCustomAbs) {
static std::string get_extension_path() { static std::string get_extension_path() {
return FileUtils::makePluginLibraryName<char>({}, std::string("template_extension") + IE_BUILD_POSTFIX); return FileUtils::makePluginLibraryName<char>(CommonTestUtils::getExecutableDirectory(),
std::string("template_extension") + IE_BUILD_POSTFIX);
} }

View File

@ -7,6 +7,8 @@
#include "ov_behavior_test_utils.hpp" #include "ov_behavior_test_utils.hpp"
#include "functional_test_utils/plugin_cache.hpp" #include "functional_test_utils/plugin_cache.hpp"
#include "common_test_utils/file_utils.hpp"
#include "openvino/util/file_util.hpp"
namespace BehaviorTestsUtils { namespace BehaviorTestsUtils {
@ -105,9 +107,9 @@ inline InferenceEngine::Core createIECoreWithTemplate() {
PluginCache::get().reset(); PluginCache::get().reset();
InferenceEngine::Core ie; InferenceEngine::Core ie;
#ifndef OPENVINO_STATIC_LIBRARY #ifndef OPENVINO_STATIC_LIBRARY
std::string pluginName = "openvino_template_plugin"; std::string pluginName = "openvino_template_plugin" IE_BUILD_POSTFIX;
pluginName += IE_BUILD_POSTFIX; ie.RegisterPlugin(ov::util::make_plugin_library_name(CommonTestUtils::getExecutableDirectory(), pluginName),
ie.RegisterPlugin(pluginName, CommonTestUtils::DEVICE_TEMPLATE); CommonTestUtils::DEVICE_TEMPLATE);
#endif // !OPENVINO_STATIC_LIBRARY #endif // !OPENVINO_STATIC_LIBRARY
return ie; return ie;
} }

View File

@ -11,6 +11,8 @@
#include "common_test_utils/test_common.hpp" #include "common_test_utils/test_common.hpp"
#include "common_test_utils/test_constants.hpp" #include "common_test_utils/test_constants.hpp"
#include "common_test_utils/common_utils.hpp" #include "common_test_utils/common_utils.hpp"
#include "common_test_utils/file_utils.hpp"
#include "openvino/util/file_util.hpp"
#include "functional_test_utils/plugin_cache.hpp" #include "functional_test_utils/plugin_cache.hpp"
#include "functional_test_utils/ov_plugin_cache.hpp" #include "functional_test_utils/ov_plugin_cache.hpp"
@ -87,7 +89,8 @@ inline ov::Core createCoreWithTemplate() {
#ifndef OPENVINO_STATIC_LIBRARY #ifndef OPENVINO_STATIC_LIBRARY
std::string pluginName = "openvino_template_plugin"; std::string pluginName = "openvino_template_plugin";
pluginName += IE_BUILD_POSTFIX; pluginName += IE_BUILD_POSTFIX;
core.register_plugin(pluginName, CommonTestUtils::DEVICE_TEMPLATE); core.register_plugin(ov::util::make_plugin_library_name(CommonTestUtils::getExecutableDirectory(), pluginName),
CommonTestUtils::DEVICE_TEMPLATE);
#endif // !OPENVINO_STATIC_LIBRARY #endif // !OPENVINO_STATIC_LIBRARY
return core; return core;
} }

View File

@ -10,6 +10,7 @@
#include "common_test_utils/test_assertions.hpp" #include "common_test_utils/test_assertions.hpp"
#include "common_test_utils/file_utils.hpp" #include "common_test_utils/file_utils.hpp"
#include "common_test_utils/unicode_utils.hpp" #include "common_test_utils/unicode_utils.hpp"
#include "openvino/util/file_util.hpp"
#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT #ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT
# include <iostream> # include <iostream>
@ -40,6 +41,9 @@ public:
SKIP_IF_CURRENT_TEST_IS_DISABLED(); SKIP_IF_CURRENT_TEST_IS_DISABLED();
std::tie(pluginName, deviceName) = GetParam(); std::tie(pluginName, deviceName) = GetParam();
pluginName += IE_BUILD_POSTFIX; pluginName += IE_BUILD_POSTFIX;
if (pluginName == (std::string("openvino_template_plugin") + IE_BUILD_POSTFIX)) {
pluginName = ov::util::make_plugin_library_name(CommonTestUtils::getExecutableDirectory(), pluginName);
}
} }
}; };
@ -148,22 +152,28 @@ TEST_P(OVClassBasicTestP, registerNewPluginNoThrows) {
OV_ASSERT_NO_THROW(ie.get_property("NEW_DEVICE_NAME", ov::supported_properties)); OV_ASSERT_NO_THROW(ie.get_property("NEW_DEVICE_NAME", ov::supported_properties));
} }
TEST(OVClassBasicTest, smoke_registerExistingPluginFileThrows) { TEST(OVClassBasicTest, smoke_registerNonExistingPluginFileThrows) {
ov::Core ie = createCoreWithTemplate(); ov::Core ie = createCoreWithTemplate();
ASSERT_THROW(ie.register_plugins("nonExistPlugins.xml"), ov::Exception); ASSERT_THROW(ie.register_plugins("nonExistPlugins.xml"), ov::Exception);
ASSERT_THROW(ie.register_plugins("nonExistPlugins.xml"), ov::Exception);
} }
TEST(OVClassBasicTest, smoke_createNonExistingConfigThrows) { TEST(OVClassBasicTest, smoke_createNonExistingConfigThrows) {
ASSERT_THROW(ov::Core ie("nonExistPlugins.xml"), ov::Exception); ASSERT_THROW(ov::Core ie("nonExistPlugins.xml"), ov::Exception);
} }
#ifdef __linux__ inline std::string getPluginFile() {
std::string filename{"mock_engine_valid.xml"};
std::ostringstream stream;
stream << "<ie><plugins><plugin name=\"mock\" location=\"";
stream << ov::util::make_plugin_library_name(CommonTestUtils::getExecutableDirectory(),
std::string("mock_engine") + IE_BUILD_POSTFIX);
stream << "\"></plugin></plugins></ie>";
CommonTestUtils::createFile(filename, stream.str());
return filename;
}
TEST(OVClassBasicTest, smoke_createMockEngineConfigNoThrows) { TEST(OVClassBasicTest, smoke_createMockEngineConfigNoThrows) {
std::string filename{"mock_engine_valid.xml"}; const std::string filename = getPluginFile();
std::string content{"<ie><plugins><plugin name=\"mock\" location=\"libmock_engine.so\"></plugin></plugins></ie>"};
CommonTestUtils::createFile(filename, content);
OV_ASSERT_NO_THROW(ov::Core ie(filename)); OV_ASSERT_NO_THROW(ov::Core ie(filename));
CommonTestUtils::removeFile(filename.c_str()); CommonTestUtils::removeFile(filename.c_str());
} }
@ -176,14 +186,10 @@ TEST(OVClassBasicTest, smoke_createMockEngineConfigThrows) {
CommonTestUtils::removeFile(filename.c_str()); CommonTestUtils::removeFile(filename.c_str());
} }
#endif
#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT #ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT
TEST_P(OVClassBasicTestP, smoke_registerPluginsXMLUnicodePath) { TEST_P(OVClassBasicTestP, smoke_registerPluginsXMLUnicodePath) {
std::string pluginXML{"mock_engine_valid.xml"}; const std::string pluginXML = getPluginFile();
std::string content{"<ie><plugins><plugin name=\"mock\" location=\"libmock_engine.so\"></plugin></plugins></ie>"};
CommonTestUtils::createFile(pluginXML, content);
for (std::size_t testIndex = 0; testIndex < CommonTestUtils::test_unicode_postfix_vector.size(); testIndex++) { for (std::size_t testIndex = 0; testIndex < CommonTestUtils::test_unicode_postfix_vector.size(); testIndex++) {
GTEST_COUT << testIndex; GTEST_COUT << testIndex;
@ -204,9 +210,7 @@ TEST_P(OVClassBasicTestP, smoke_registerPluginsXMLUnicodePath) {
GTEST_COUT << "Core created " << testIndex << std::endl; GTEST_COUT << "Core created " << testIndex << std::endl;
OV_ASSERT_NO_THROW(ie.register_plugins(::ov::util::wstring_to_string(pluginsXmlW))); OV_ASSERT_NO_THROW(ie.register_plugins(::ov::util::wstring_to_string(pluginsXmlW)));
CommonTestUtils::removeFile(pluginsXmlW); CommonTestUtils::removeFile(pluginsXmlW);
# if defined __linux__ && !defined(__APPLE__)
OV_ASSERT_NO_THROW(ie.get_versions("mock")); // from pluginXML OV_ASSERT_NO_THROW(ie.get_versions("mock")); // from pluginXML
# endif
OV_ASSERT_NO_THROW(ie.get_versions(deviceName)); OV_ASSERT_NO_THROW(ie.get_versions(deviceName));
GTEST_COUT << "Plugin created " << testIndex << std::endl; GTEST_COUT << "Plugin created " << testIndex << std::endl;

View File

@ -12,6 +12,7 @@
#include "common_test_utils/test_assertions.hpp" #include "common_test_utils/test_assertions.hpp"
#include "common_test_utils/file_utils.hpp" #include "common_test_utils/file_utils.hpp"
#include "common_test_utils/unicode_utils.hpp" #include "common_test_utils/unicode_utils.hpp"
#include "openvino/util/file_util.hpp"
#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT #ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT
#include <iostream> #include <iostream>
@ -38,6 +39,9 @@ public:
SKIP_IF_CURRENT_TEST_IS_DISABLED(); SKIP_IF_CURRENT_TEST_IS_DISABLED();
std::tie(pluginName, deviceName) = GetParam(); std::tie(pluginName, deviceName) = GetParam();
pluginName += IE_BUILD_POSTFIX; pluginName += IE_BUILD_POSTFIX;
if (pluginName == (std::string("openvino_template_plugin") + IE_BUILD_POSTFIX)) {
pluginName = ov::util::make_plugin_library_name(CommonTestUtils::getExecutableDirectory(), pluginName);
}
} }
}; };
@ -122,7 +126,7 @@ TEST_P(IEClassBasicTestP, registerNewPluginNoThrows) {
ASSERT_NO_THROW(ie.GetMetric("NEW_DEVICE_NAME", METRIC_KEY(SUPPORTED_CONFIG_KEYS))); ASSERT_NO_THROW(ie.GetMetric("NEW_DEVICE_NAME", METRIC_KEY(SUPPORTED_CONFIG_KEYS)));
} }
TEST(IEClassBasicTest, smoke_registerExistingPluginFileThrows) { TEST(IEClassBasicTest, smoke_registerNonExistingPluginFileThrows) {
InferenceEngine::Core ie = BehaviorTestsUtils::createIECoreWithTemplate(); InferenceEngine::Core ie = BehaviorTestsUtils::createIECoreWithTemplate();
ASSERT_THROW(ie.RegisterPlugins("nonExistPlugins.xml"), InferenceEngine::Exception); ASSERT_THROW(ie.RegisterPlugins("nonExistPlugins.xml"), InferenceEngine::Exception);
} }
@ -131,12 +135,19 @@ TEST(IEClassBasicTest, smoke_createNonExistingConfigThrows) {
ASSERT_THROW(InferenceEngine::Core ie("nonExistPlugins.xml"), InferenceEngine::Exception); ASSERT_THROW(InferenceEngine::Core ie("nonExistPlugins.xml"), InferenceEngine::Exception);
} }
#ifdef __linux__ inline std::string getPluginFile() {
std::string filename{"mock_engine_valid.xml"};
std::ostringstream stream;
stream << "<ie><plugins><plugin name=\"mock\" location=\"";
stream << ov::util::make_plugin_library_name(CommonTestUtils::getExecutableDirectory(),
std::string("mock_engine") + IE_BUILD_POSTFIX);
stream << "\"></plugin></plugins></ie>";
CommonTestUtils::createFile(filename, stream.str());
return filename;
}
TEST(IEClassBasicTest, smoke_createMockEngineConfigNoThrows) { TEST(IEClassBasicTest, smoke_createMockEngineConfigNoThrows) {
std::string filename{"mock_engine_valid.xml"}; const std::string filename = getPluginFile();
std::string content{"<ie><plugins><plugin name=\"mock\" location=\"libmock_engine.so\"></plugin></plugins></ie>"};
CommonTestUtils::createFile(filename, content);
ASSERT_NO_THROW(InferenceEngine::Core ie(filename)); ASSERT_NO_THROW(InferenceEngine::Core ie(filename));
CommonTestUtils::removeFile(filename.c_str()); CommonTestUtils::removeFile(filename.c_str());
} }
@ -149,14 +160,10 @@ TEST(IEClassBasicTest, smoke_createMockEngineConfigThrows) {
CommonTestUtils::removeFile(filename.c_str()); CommonTestUtils::removeFile(filename.c_str());
} }
#endif
#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT #ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT
TEST_P(IEClassBasicTestP, smoke_registerPluginsXMLUnicodePath) { TEST_P(IEClassBasicTestP, smoke_registerPluginsXMLUnicodePath) {
std::string pluginXML{"mock_engine_valid.xml"}; const std::string pluginXML = getPluginFile();
std::string content{"<ie><plugins><plugin name=\"mock\" location=\"libmock_engine.so\"></plugin></plugins></ie>"};
CommonTestUtils::createFile(pluginXML, content);
for (std::size_t testIndex = 0; testIndex < CommonTestUtils::test_unicode_postfix_vector.size(); testIndex++) { for (std::size_t testIndex = 0; testIndex < CommonTestUtils::test_unicode_postfix_vector.size(); testIndex++) {
GTEST_COUT << testIndex; GTEST_COUT << testIndex;
@ -176,9 +183,7 @@ TEST_P(IEClassBasicTestP, smoke_registerPluginsXMLUnicodePath) {
GTEST_COUT << "Core created " << testIndex << std::endl; GTEST_COUT << "Core created " << testIndex << std::endl;
ASSERT_NO_THROW(ie.RegisterPlugins(ov::util::wstring_to_string(pluginsXmlW))); ASSERT_NO_THROW(ie.RegisterPlugins(ov::util::wstring_to_string(pluginsXmlW)));
CommonTestUtils::removeFile(pluginsXmlW); CommonTestUtils::removeFile(pluginsXmlW);
#if defined __linux__ && !defined(__APPLE__) ASSERT_NO_THROW(ie.GetVersions("mock")); // from pluginXM
ASSERT_NO_THROW(ie.GetVersions("mock")); // from pluginXML
#endif
ASSERT_NO_THROW(ie.GetVersions(deviceName)); ASSERT_NO_THROW(ie.GetVersions(deviceName));
GTEST_COUT << "Plugin created " << testIndex << std::endl; GTEST_COUT << "Plugin created " << testIndex << std::endl;

View File

@ -62,7 +62,7 @@ public:
void safeAddExtension(InferenceEngine::Core & ie) { void safeAddExtension(InferenceEngine::Core & ie) {
try { try {
auto extension = std::make_shared<InferenceEngine::Extension>( auto extension = std::make_shared<InferenceEngine::Extension>(
FileUtils::makePluginLibraryName<char>({}, "template_extension")); FileUtils::makePluginLibraryName<char>(CommonTestUtils::getExecutableDirectory(), "template_extension"));
ie.AddExtension(extension); ie.AddExtension(extension);
} catch (const InferenceEngine::Exception & ex) { } catch (const InferenceEngine::Exception & ex) {
ASSERT_STR_CONTAINS(ex.what(), "name: experimental"); ASSERT_STR_CONTAINS(ex.what(), "name: experimental");

View File

@ -7,8 +7,11 @@
#include <ngraph/variant.hpp> #include <ngraph/variant.hpp>
#include "ngraph_functions/builders.hpp" #include "ngraph_functions/builders.hpp"
#include "ngraph_functions/subgraph_builders.hpp" #include "ngraph_functions/subgraph_builders.hpp"
#include "common_test_utils/file_utils.hpp"
#include "openvino/util/file_util.hpp"
#include <random> #include <random>
#include "ie_algorithm.hpp" #include "ie_algorithm.hpp"
namespace HeteroTests { namespace HeteroTests {
static std::vector<std::function<std::shared_ptr<ngraph::Function>()>> builders = { static std::vector<std::function<std::shared_ptr<ngraph::Function>()>> builders = {
@ -115,11 +118,17 @@ void HeteroSyntheticTest::SetUp() {
for (auto&& pluginParameter : std::get<Plugin>(param)) { for (auto&& pluginParameter : std::get<Plugin>(param)) {
bool registred = true; bool registred = true;
try { try {
PluginCache::get().ie()->RegisterPlugin(pluginParameter._location if (pluginParameter._location == "openvino_template_plugin") {
+ IE_BUILD_POSTFIX, pluginParameter._name); PluginCache::get().ie()->RegisterPlugin(ov::util::make_plugin_library_name(
CommonTestUtils::getExecutableDirectory(), pluginParameter._location + IE_BUILD_POSTFIX),
pluginParameter._name);
} else {
PluginCache::get().ie()->RegisterPlugin(pluginParameter._location
+ IE_BUILD_POSTFIX, pluginParameter._name);
}
} catch (InferenceEngine::Exception& ex) { } catch (InferenceEngine::Exception& ex) {
if (std::string{ex.what()}.find("Device with \"" + pluginParameter._name if (std::string{ex.what()}.find("Device with \"" + pluginParameter._name
+ "\" is already registered in the InferenceEngine") + "\" is already registered in the OpenVINO Runtime")
== std::string::npos) { == std::string::npos) {
throw ex; throw ex;
} else { } else {

View File

@ -3,6 +3,8 @@
// //
#include "functional_test_utils/ov_plugin_cache.hpp" #include "functional_test_utils/ov_plugin_cache.hpp"
#include "common_test_utils/file_utils.hpp"
#include "openvino/util/file_util.hpp"
#include <gtest/gtest.h> #include <gtest/gtest.h>
@ -56,7 +58,7 @@ std::shared_ptr<ov::Core> PluginCache::core(const std::string &deviceToCheck) {
try { try {
std::string pluginName = "openvino_template_plugin"; std::string pluginName = "openvino_template_plugin";
pluginName += IE_BUILD_POSTFIX; pluginName += IE_BUILD_POSTFIX;
ov_core->register_plugin(pluginName, "TEMPLATE"); ov_core->register_plugin(ov::util::make_plugin_library_name(CommonTestUtils::getExecutableDirectory(), pluginName), "TEMPLATE");
} catch (...) { } catch (...) {
} }

View File

@ -4,12 +4,14 @@
#include "functional_test_utils/plugin_cache.hpp" #include "functional_test_utils/plugin_cache.hpp"
#include "functional_test_utils/ov_plugin_cache.hpp" #include "functional_test_utils/ov_plugin_cache.hpp"
#include "common_test_utils/file_utils.hpp"
#include <cstdlib> #include <cstdlib>
#include <unordered_map> #include <unordered_map>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <ie_plugin_config.hpp> #include <ie_plugin_config.hpp>
#include "openvino/util/file_util.hpp"
namespace { namespace {
class TestListener : public testing::EmptyTestEventListener { class TestListener : public testing::EmptyTestEventListener {
@ -58,7 +60,7 @@ std::shared_ptr<InferenceEngine::Core> PluginCache::ie(const std::string &device
try { try {
std::string pluginName = "openvino_template_plugin"; std::string pluginName = "openvino_template_plugin";
pluginName += IE_BUILD_POSTFIX; pluginName += IE_BUILD_POSTFIX;
ie_core->RegisterPlugin(pluginName, "TEMPLATE"); ie_core->RegisterPlugin(ov::util::make_plugin_library_name(CommonTestUtils::getExecutableDirectory(), pluginName), "TEMPLATE");
} catch (...) {} } catch (...) {}
if (!deviceToCheck.empty()) { if (!deviceToCheck.empty()) {

View File

@ -40,4 +40,4 @@ target_link_libraries(${TARGET_NAME} PRIVATE inference_engine)
target_compile_definitions(${TARGET_NAME} PRIVATE IMPLEMENT_INFERENCE_ENGINE_PLUGIN) target_compile_definitions(${TARGET_NAME} PRIVATE IMPLEMENT_INFERENCE_ENGINE_PLUGIN)
install(TARGETS ${TARGET_NAME} install(TARGETS ${TARGET_NAME}
LIBRARY DESTINATION ${OV_CPACK_PLUGINSDIR} COMPONENT tests EXCLUDE_FROM_ALL) LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)

View File

@ -16,10 +16,10 @@ addIeTargetTest(
LINK_LIBRARIES LINK_LIBRARIES
PRIVATE PRIVATE
ngraphFunctions ngraphFunctions
gmock gmock
commonTestUtils_s commonTestUtils_s
openvino_intel_gna_plugin_test_static openvino_intel_gna_plugin_test_static
engines_test_util engines_test_util
ADD_CPPLINT ADD_CPPLINT
LABELS LABELS
GNA GNA

View File

@ -5,7 +5,7 @@
set(TARGET_NAME ieUnitTests) set(TARGET_NAME ieUnitTests)
# Find OpenCV components if exist # Find OpenCV components if exist
find_package(OpenCV COMPONENTS core QUIET) find_package(OpenCV QUIET COMPONENTS core)
if(NOT OpenCV_FOUND) if(NOT OpenCV_FOUND)
message(WARNING "OPENCV is disabled or not found, ${TARGET_NAME} needs OpenCV for its build") message(WARNING "OPENCV is disabled or not found, ${TARGET_NAME} needs OpenCV for its build")
else() else()

View File

@ -12,13 +12,14 @@
#include <ngraph/opsets/opset.hpp> #include <ngraph/opsets/opset.hpp>
#include "common_test_utils/test_common.hpp" #include "common_test_utils/test_common.hpp"
#include "common_test_utils/file_utils.hpp"
using namespace InferenceEngine; using namespace InferenceEngine;
using ExtensionTests = ::testing::Test; using ExtensionTests = ::testing::Test;
std::string getExtensionPath() { std::string getExtensionPath() {
return FileUtils::makePluginLibraryName<char>({}, return FileUtils::makePluginLibraryName<char>(CommonTestUtils::getExecutableDirectory(),
std::string("template_extension") + IE_BUILD_POSTFIX); std::string("template_extension") + IE_BUILD_POSTFIX);
} }

View File

@ -4,7 +4,7 @@
set(TARGET fluid_preproc_tests) set(TARGET fluid_preproc_tests)
find_package(OpenCV COMPONENTS gapi core imgproc QUIET) find_package(OpenCV QUIET COMPONENTS gapi core imgproc)
if(NOT OpenCV_FOUND) if(NOT OpenCV_FOUND)
message(WARNING "No suitable OpenCV version detected, ${TARGET} skipped") message(WARNING "No suitable OpenCV version detected, ${TARGET} skipped")
return() return()

View File

@ -98,10 +98,6 @@ cv::String typeToString(int type)
case CV_8UC2 : return "CV_8UC2"; case CV_8UC2 : return "CV_8UC2";
case CV_8UC3 : return "CV_8UC3"; case CV_8UC3 : return "CV_8UC3";
case CV_8UC4 : return "CV_8UC4"; case CV_8UC4 : return "CV_8UC4";
case CV_16FC1 : return "CV_16FC1";
case CV_16FC2 : return "CV_16FC2";
case CV_16FC3 : return "CV_16FC3";
case CV_16FC4 : return "CV_16FC4";
case CV_32FC1 : return "CV_32FC1"; case CV_32FC1 : return "CV_32FC1";
case CV_32FC2 : return "CV_32FC2"; case CV_32FC2 : return "CV_32FC2";
case CV_32FC3 : return "CV_32FC3"; case CV_32FC3 : return "CV_32FC3";

View File

@ -37,7 +37,7 @@ ie_faster_build(${TARGET_NAME}
) )
# Find OpenCV components if exist # Find OpenCV components if exist
find_package(OpenCV COMPONENTS core imgproc QUIET) find_package(OpenCV QUIET COMPONENTS core imgproc)
if(OpenCV_FOUND) if(OpenCV_FOUND)
target_compile_definitions(${TARGET_NAME} PUBLIC USE_OPENCV) target_compile_definitions(${TARGET_NAME} PUBLIC USE_OPENCV)
else() else()

View File

@ -285,7 +285,7 @@ TEST_P(RandomROITest, PreprocRandomROITest)
} }
case Precision::FP16: case Precision::FP16:
{ {
cv::Mat mat(h, w, CV_16FC3, cv::Scalar(0,0, 255)); cv::Mat mat(h, w, CV_16SC3, cv::Scalar(0,0, 255));
cv::randu(mat, cv::Scalar(0, 0, 0), cv::Scalar(255,255, 255)); cv::randu(mat, cv::Scalar(0, 0, 0), cv::Scalar(255,255, 255));
blob = img2Blob<Precision::FP16>(mat, _inputLayout); blob = img2Blob<Precision::FP16>(mat, _inputLayout);
break; break;
@ -314,7 +314,7 @@ TEST_P(RandomROITest, PreprocRandomROITest)
} }
case Precision::FP16: case Precision::FP16:
{ {
cv::Mat mat(h, w, CV_16FC3); cv::Mat mat(h, w, CV_16SC3);
cv::randu(mat, cv::Scalar(0, 0, 0), cv::Scalar(255,255, 255)); cv::randu(mat, cv::Scalar(0, 0, 0), cv::Scalar(255,255, 255));
cv::cvtColor(mat, mat, toCvtColorType(_colorFormat)); cv::cvtColor(mat, mat, toCvtColorType(_colorFormat));
blob = img2Blob<Precision::FP16>(mat, _inputLayout); blob = img2Blob<Precision::FP16>(mat, _inputLayout);
@ -347,7 +347,7 @@ TEST_P(RandomROITest, PreprocRandomROITest)
} }
case Precision::FP16: case Precision::FP16:
{ {
cv::Mat mat(h, w, CV_16FC4); cv::Mat mat(h, w, CV_16SC4);
cv::randu(mat, cv::Scalar(0, 0, 0), cv::Scalar(255,255, 255)); cv::randu(mat, cv::Scalar(0, 0, 0), cv::Scalar(255,255, 255));
cv::cvtColor(mat, mat, toCvtColorType(_colorFormat)); cv::cvtColor(mat, mat, toCvtColorType(_colorFormat));
blob = img2Blob<Precision::FP16>(mat, _inputLayout); blob = img2Blob<Precision::FP16>(mat, _inputLayout);

View File

@ -56,18 +56,7 @@ add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME})
# Install rules # Install rules
# for ieFuncTests
install(TARGETS ${TARGET_NAME} install(TARGETS ${TARGET_NAME}
LIBRARY DESTINATION ${OV_CPACK_PLUGINSDIR} COMPONENT tests EXCLUDE_FROM_ALL) LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)
# for InferenceEngineUnitTest
# For public CI
install(TARGETS ${TARGET_NAME}
LIBRARY DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)
if(NOT WIN32)
# For private CI
install(TARGETS ${TARGET_NAME}
LIBRARY DESTINATION tests/lib COMPONENT tests EXCLUDE_FROM_ALL)
endif()
ov_install_static_lib(${TARGET_NAME} ${OV_CPACK_COMP_CORE}) ov_install_static_lib(${TARGET_NAME} ${OV_CPACK_COMP_CORE})

View File

@ -14,5 +14,5 @@ target_include_directories(${TARGET_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(${TARGET_NAME} PRIVATE StressTestsCommon) target_link_libraries(${TARGET_NAME} PRIVATE StressTestsCommon)
install(TARGETS ${TARGET_NAME} install(TARGETS ${TARGET_NAME}
RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL) RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)

View File

@ -13,5 +13,5 @@ add_executable(${TARGET_NAME} ${HDR} ${SRC})
target_link_libraries(${TARGET_NAME} PRIVATE StressTestsCommon) target_link_libraries(${TARGET_NAME} PRIVATE StressTestsCommon)
install(TARGETS ${TARGET_NAME} install(TARGETS ${TARGET_NAME}
RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL) RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)

View File

@ -13,4 +13,4 @@ add_executable(${TARGET_NAME} ${HDR} ${SRC})
target_link_libraries(${TARGET_NAME} PRIVATE StressTestsCommon) target_link_libraries(${TARGET_NAME} PRIVATE StressTestsCommon)
install(TARGETS ${TARGET_NAME} install(TARGETS ${TARGET_NAME}
RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL) RUNTIME DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)

View File

@ -51,7 +51,13 @@ if(ENABLE_SYSTEM_PUGIXML)
find_package(PugiXML QUIET) find_package(PugiXML QUIET)
if(PugiXML_FOUND) if(PugiXML_FOUND)
set_target_properties(pugixml PROPERTIES IMPORTED_GLOBAL ON) set_target_properties(pugixml PROPERTIES IMPORTED_GLOBAL ON)
add_library(pugixml::static ALIAS pugixml) if(TARGET pugixml::static)
# sometimes pugixml::static target already exists, just need to make it global
set_target_properties(pugixml::static PROPERTIES IMPORTED_GLOBAL ON)
else()
# or create an alias
add_library(pugixml::static ALIAS pugixml)
endif()
else() else()
# reset to prevent improper code generation in OpenVINODeveloperPackage # reset to prevent improper code generation in OpenVINODeveloperPackage
set(ENABLE_SYSTEM_PUGIXML OFF CACHE BOOL "" FORCE) set(ENABLE_SYSTEM_PUGIXML OFF CACHE BOOL "" FORCE)

View File

@ -29,7 +29,7 @@ endif()
target_link_libraries(${TARGET_NAME} PRIVATE openvino::runtime format_reader gflags) target_link_libraries(${TARGET_NAME} PRIVATE openvino::runtime format_reader gflags)
find_package(OpenCV COMPONENTS core QUIET) find_package(OpenCV QUIET COMPONENTS core)
if(NOT OpenCV_FOUND) if(NOT OpenCV_FOUND)
message(WARNING "OpenCV is disabled or not found, ${TARGET_NAME} will be built without OpenCV support. Set OpenCV_DIR") message(WARNING "OpenCV is disabled or not found, ${TARGET_NAME} will be built without OpenCV support. Set OpenCV_DIR")
else() else()

View File

@ -19,22 +19,24 @@ endif()
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/automation/version.txt.in" configure_file("${CMAKE_CURRENT_SOURCE_DIR}/automation/version.txt.in"
"${CMAKE_CURRENT_SOURCE_DIR}/version.txt" @ONLY) "${CMAKE_CURRENT_SOURCE_DIR}/version.txt" @ONLY)
install(FILES requirements_dev.txt if(ENABLE_TESTS)
DESTINATION tests/mo install(FILES requirements_dev.txt
COMPONENT tests DESTINATION tests/mo
EXCLUDE_FROM_ALL) COMPONENT tests
EXCLUDE_FROM_ALL)
install(DIRECTORY unit_tests install(DIRECTORY unit_tests
DESTINATION tests/mo DESTINATION tests/mo
COMPONENT tests COMPONENT tests
EXCLUDE_FROM_ALL) EXCLUDE_FROM_ALL)
install(DIRECTORY automation install(DIRECTORY automation
DESTINATION tests/mo DESTINATION tests/mo
COMPONENT tests COMPONENT tests
EXCLUDE_FROM_ALL) EXCLUDE_FROM_ALL)
install(FILES .coveragerc install(FILES .coveragerc
DESTINATION tests/mo DESTINATION tests/mo
COMPONENT tests COMPONENT tests
EXCLUDE_FROM_ALL) EXCLUDE_FROM_ALL)
endif()