New layout for time_tests (#2321)

* Change folders' layout for `time_tests`

* Refactoring of namings in `time_tests`
This commit is contained in:
Vitaliy Urusovskij
2020-09-18 18:53:49 +03:00
committed by GitHub
parent 676ce76650
commit 20266276ec
13 changed files with 33 additions and 27 deletions

View File

@@ -20,5 +20,4 @@ endif()
find_package(InferenceEngineDeveloperPackage REQUIRED) find_package(InferenceEngineDeveloperPackage REQUIRED)
add_subdirectory(time-testhelper)
add_subdirectory(src) add_subdirectory(src)

View File

@@ -21,6 +21,6 @@ cmake .. -DInferenceEngineDeveloperPackage_DIR=$(realpath ../../../build) && mak
2. Run test: 2. Run test:
``` bash ``` bash
./run_executable.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
``` ```

View File

@@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
""" """
This script runs TimeTests executable several times to aggregate This script runs timetest executable several times and aggregate
collected statistics. collected statistics.
""" """
@@ -86,11 +86,11 @@ def generate_tmp_path():
return path return path
def run_executable(args: dict, log=None): def run_timetest(args: dict, log=None):
"""Run provided executable several times and aggregate collected statistics""" """Run provided executable several times and aggregate collected statistics"""
if log is None: if log is None:
log = logging.getLogger('run_executable') log = logging.getLogger('run_timetest')
cmd_common = prepare_executable_cmd(args) cmd_common = prepare_executable_cmd(args)
@@ -114,7 +114,7 @@ def run_executable(args: dict, log=None):
def cli_parser(): def cli_parser():
"""parse command-line arguments""" """parse command-line arguments"""
parser = argparse.ArgumentParser(description='Run TimeTests executable') parser = argparse.ArgumentParser(description='Run timetest executable')
parser.add_argument('executable', parser.add_argument('executable',
type=Path, type=Path,
help='binary to execute') help='binary to execute')
@@ -149,7 +149,7 @@ if __name__ == "__main__":
logging.basicConfig(format="[ %(levelname)s ] %(message)s", logging.basicConfig(format="[ %(levelname)s ] %(message)s",
level=logging.DEBUG, stream=sys.stdout) level=logging.DEBUG, stream=sys.stdout)
exit_code, aggr_stats = run_executable(dict(args._get_kwargs()), log=logging) # pylint: disable=protected-access exit_code, aggr_stats = run_timetest(dict(args._get_kwargs()), log=logging) # pylint: disable=protected-access
if args.stats_path: if args.stats_path:
# Save aggregated results to a file # Save aggregated results to a file

View File

@@ -2,18 +2,5 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
# add dummy `time_tests` target combines all time tests add_subdirectory(timetests)
add_custom_target(time_tests) add_subdirectory(timetests_helper)
# Build test from every source file.
# Test target name is source file name without extension.
FILE(GLOB tests "*.cpp")
foreach(test_source ${tests})
get_filename_component(test_name ${test_source} NAME_WE)
add_executable(${test_name} ${test_source})
target_link_libraries(${test_name} PRIVATE IE::inference_engine time-testhelper)
add_dependencies(time_tests ${test_name})
endforeach()

View File

@@ -0,0 +1,19 @@
# Copyright (C) 2020 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
# add dummy `time_tests` target combines all time tests
add_custom_target(time_tests)
# Build test from every source file.
# Test target name is source file name without extension.
FILE(GLOB tests "*.cpp")
foreach(test_source ${tests})
get_filename_component(test_name ${test_source} NAME_WE)
add_executable(${test_name} ${test_source})
target_link_libraries(${test_name} PRIVATE IE::inference_engine timetests_helper)
add_dependencies(time_tests ${test_name})
endforeach()

View File

@@ -5,7 +5,7 @@
#include <inference_engine.hpp> #include <inference_engine.hpp>
#include <iostream> #include <iostream>
#include "time-testhelper/timer.h" #include "timetests_helper/timer.h"
using namespace InferenceEngine; using namespace InferenceEngine;
/** /**

View File

@@ -2,12 +2,12 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
set (TARGET_NAME "time-testhelper") set (TARGET_NAME "timetests_helper")
find_package(gflags REQUIRED) find_package(gflags REQUIRED)
file (GLOB SRC *.cpp) file (GLOB SRC *.cpp)
add_library(${TARGET_NAME} STATIC ${SRC}) add_library(${TARGET_NAME} STATIC ${SRC})
target_include_directories(${TARGET_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") target_include_directories(${TARGET_NAME} PUBLIC "${CMAKE_SOURCE_DIR}/include")
target_link_libraries(${TARGET_NAME} gflags) target_link_libraries(${TARGET_NAME} gflags)

View File

@@ -4,7 +4,7 @@
#include "cli.h" #include "cli.h"
#include "statistics_writer.h" #include "statistics_writer.h"
#include "time-testhelper/timer.h" #include "timetests_helper/timer.h"
#include <iostream> #include <iostream>

View File

@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
// //
#include "time-testhelper/timer.h" #include "timetests_helper/timer.h"
#include <chrono> #include <chrono>
#include <fstream> #include <fstream>
#include <memory> #include <memory>

View File

@@ -0,0 +1 @@
#TODO: fill