add itt_collector build (#6859)
* add itt_collector build * changed format for itt_collector build * replace build_dir with sea_itt_lib_path * change type of build_target * replace os.join with Path * change built_target arg type
This commit is contained in:
@@ -139,10 +139,13 @@ def openvino_ref(request, artifacts):
|
||||
|
||||
log.info("--openvino_ref is not specified. Preparing instrumented build at %s", build_dir)
|
||||
|
||||
build_target = {"sea_itt_lib": Path(build_dir / "thirdparty" / "itt_collector" / "sea_itt_lib")}
|
||||
|
||||
return_code, output = make_build(
|
||||
openvino_root_dir,
|
||||
build_dir,
|
||||
openvino_ref_path,
|
||||
build_target=build_target,
|
||||
cmake_additional_args=["-DSELECTIVE_BUILD=COLLECT"],
|
||||
log=log
|
||||
)
|
||||
|
||||
@@ -15,7 +15,6 @@ from install_pkg import get_openvino_environment # pylint: disable=import-error
|
||||
from path_utils import get_lib_path # pylint: disable=import-error
|
||||
from proc_utils import cmd_exec # pylint: disable=import-error
|
||||
|
||||
|
||||
SESSION_INFO_FILE = "cc_tests.json"
|
||||
infer_tool = str((Path(getsourcefile(lambda: 0)) / ".." / "tools" / "infer_tool.py").resolve())
|
||||
|
||||
@@ -75,15 +74,19 @@ def run_infer(models, out_dir, install_dir):
|
||||
return return_code, output
|
||||
|
||||
|
||||
def make_build(openvino_root_dir, build_dir, install_dir, cmake_additional_args=None, log=None):
|
||||
def make_build(openvino_root_dir, build_dir, install_dir, build_target: dict = None, cmake_additional_args=None,
|
||||
log=None):
|
||||
"""Parametrized build and install OpenVINO package."""
|
||||
additional_args_line = " ".join(cmake_additional_args) + " " if cmake_additional_args else ""
|
||||
build_target_arg_line = [f"cmake --build {build_target[target]} --target {target} && " for target in
|
||||
build_target.keys()] if build_target else ""
|
||||
nproc = multiprocessing.cpu_count()
|
||||
cmd = (
|
||||
f"cmake -DENABLE_PROFILING_ITT=ON -DCMAKE_BUILD_TYPE=Release "
|
||||
f"-DPYTHON_EXECUTABLE={sys.executable} {additional_args_line}"
|
||||
f"-S {openvino_root_dir} -B {build_dir} &&"
|
||||
f"-S {openvino_root_dir} -B {build_dir} && "
|
||||
f"cmake --build {build_dir} -j{nproc} && "
|
||||
f"{' '.join(build_target_arg_line)}"
|
||||
f"cmake --install {build_dir} --prefix {install_dir}"
|
||||
)
|
||||
return cmd_exec([cmd], shell=True, log=log)
|
||||
|
||||
Reference in New Issue
Block a user