Make time && stress tests independent from IEDeveloperPackage (#7411)

* Specify own CXX configuration for time && stress tests

* Included os_flags for build gflags

* Updated README

* Updated commands for build tests in README

* Use new cmake config
This commit is contained in:
Ilya Sharikov 2021-09-16 12:54:41 +03:00 committed by GitHub
parent ffa07eb6f3
commit 5847b35ed2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 25 additions and 42 deletions

View File

@ -4,6 +4,13 @@
cmake_minimum_required(VERSION 3.13) cmake_minimum_required(VERSION 3.13)
set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CXX_EXTENSIONS OFF)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
endif()
if (CMAKE_BUILD_TYPE STREQUAL "") if (CMAKE_BUILD_TYPE STREQUAL "")
message(STATUS "CMAKE_BUILD_TYPE not defined, 'Release' will be used") message(STATUS "CMAKE_BUILD_TYPE not defined, 'Release' will be used")
set(CMAKE_BUILD_TYPE "Release") set(CMAKE_BUILD_TYPE "Release")
@ -12,7 +19,8 @@ endif()
# Define directory where artifacts will be placed # Define directory where artifacts will be placed
set(OUTPUT_ROOT ${CMAKE_CURRENT_SOURCE_DIR}) set(OUTPUT_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
find_package(InferenceEngineDeveloperPackage REQUIRED) # Search OpenVINO Inference Engine installed
find_package(OpenVINO REQUIRED)
set(OpenVINO_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../") set(OpenVINO_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../")

View File

@ -32,27 +32,13 @@ one at a time to mitigate memory statistics pollution. You can use
### Building Tests ### Building Tests
Stress tests should be built in 2 steps. To build the tests, you need to have OpenVINO™ installed or build from source.
Before build the tests, open a terminal, set OpenVINO™ environment, and after that
1. Build `openvino` run the commands below:
Build `openvino` as usual but with `-DENABLE_TESTS=ON`.
2. Build `stress_tests`
Stress tests depend from the Inference Engine Developer Package located in the
`openvino` build directory.
In the command line snippet bellow, it is assumed that the Inference Engine
Developer Package CMake module can be found in the directory `build` under
`openvino` repository root.
``` bash ``` bash
( source <OpenVINO_install_dir>/bin/setupvars.sh
export OPENVINO_BUILD_DIR=$(git rev-parse --show-toplevel)/build mkdir build && cd build
mkdir -p build && cd build && \ cmake .. && make -j$(nproc)
cmake -DInferenceEngineDeveloperPackage_DIR=$OPENVINO_BUILD_DIR .. && make -j$(nproc) \
)
``` ```
### Preparing Test Data ### Preparing Test Data

View File

@ -9,6 +9,7 @@ file (GLOB_RECURSE HDR *.h)
add_library(${TARGET_NAME} STATIC ${SRC} ${HDR}) add_library(${TARGET_NAME} STATIC ${SRC} ${HDR})
include(${OpenVINO_SOURCE_DIR}cmake/developer_package/compile_flags/os_flags.cmake)
target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(${OpenVINO_SOURCE_DIR}/thirdparty/gflags add_subdirectory(${OpenVINO_SOURCE_DIR}/thirdparty/gflags

View File

@ -4,6 +4,13 @@
cmake_minimum_required(VERSION 3.13) cmake_minimum_required(VERSION 3.13)
set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CXX_EXTENSIONS OFF)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set (CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
endif()
set (CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the build type") set (CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the build type")
project(time_tests) project(time_tests)
@ -11,16 +18,7 @@ project(time_tests)
set(OpenVINO_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../") set(OpenVINO_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../")
# Search OpenVINO Inference Engine installed # Search OpenVINO Inference Engine installed
find_package(InferenceEngine) find_package(OpenVINO REQUIRED)
if(NOT InferenceEngine_FOUND)
# Define directory where artifacts will be placed
set(OUTPUT_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
# Search OpenVINO Inference Engine via InferenceEngineDeveloperPackage_DIR
# in order to provide backward compatibility with old OpenVINO packages
find_package(InferenceEngineDeveloperPackage REQUIRED)
endif()
add_subdirectory(src) add_subdirectory(src)

View File

@ -15,21 +15,11 @@ the commands below:
1. Build tests: 1. Build tests:
``` bash ``` bash
source <OpenVINO_install_dir>/bin/setupvars.sh
mkdir build && cd build mkdir build && cd build
cmake .. && make time_tests cmake .. && make time_tests
``` ```
If you don't have OpenVINO™ installed you need to have the `build` folder, which
is created when you configure and build OpenVINO™ from sources:
``` bash
cmake .. -DInferenceEngine_DIR=$(realpath ../../../build) && make time_tests
```
For old versions of OpenVINO™ from sources use `-DInferenceEngineDeveloperPackage_DIR`:
``` bash
cmake .. -DInferenceEngineDeveloperPackage_DIR=$(realpath ../../../build) && make time_tests
```
2. Run test: 2. Run test:
``` bash ``` bash
./scripts/run_timetest.py ../../bin/intel64/Release/timetest_infer -m model.xml -d CPU ./scripts/run_timetest.py ../../bin/intel64/Release/timetest_infer -m model.xml -d CPU