Skip to content

Commit 56fe26f

Browse files
Introduce protopipe (#27087)
### Details: - Publishing protopipe to open-source ### Tickets: - E-143100
1 parent 43df0b6 commit 56fe26f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+6327
-1
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@
7878
[submodule "src/plugins/intel_npu/thirdparty/level-zero-ext"]
7979
path = src/plugins/intel_npu/thirdparty/level-zero-ext
8080
url = https://github.com/intel/level-zero-npu-extensions.git
81+
[submodule "src/plugins/intel_npu/thirdparty/yaml-cpp"]
82+
path = src/plugins/intel_npu/thirdparty/yaml-cpp
83+
url = https://github.com/jbeder/yaml-cpp.git
8184
[submodule "thirdparty/telemetry"]
8285
path = thirdparty/telemetry
8386
url = https://github.com/openvinotoolkit/telemetry.git

scripts/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ set(shellcheck_skip_list
1212
"${OpenVINO_SOURCE_DIR}/thirdparty"
1313
"${OpenVINO_SOURCE_DIR}/src/plugins/intel_cpu/thirdparty"
1414
"${OpenVINO_SOURCE_DIR}/src/plugins/intel_gpu/thirdparty"
15+
"${OpenVINO_SOURCE_DIR}/src/plugins/intel_npu/thirdparty"
1516
"${OpenVINO_SOURCE_DIR}/src/bindings/python/thirdparty/pybind11"
1617
"${TEMP}")
1718

src/plugins/intel_npu/cmake/features.cmake

+2
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ if(NOT BUILD_SHARED_LIBS AND NOT ENABLE_MLIR_COMPILER AND NOT ENABLE_DRIVER_COMP
2020
endif()
2121

2222
ov_dependent_option(ENABLE_IMD_BACKEND "Enable InferenceManagerDemo based NPU AL backend" OFF "NOT WIN32;NOT CMAKE_CROSSCOMPILING" OFF)
23+
24+
ov_dependent_option(ENABLE_INTEL_NPU_PROTOPIPE "Enable Intel NPU Protopipe tool" ON "ENABLE_INTEL_NPU_INTERNAL" OFF)

src/plugins/intel_npu/thirdparty/CMakeLists.txt

+12
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,15 @@ if(ENABLE_ZEROAPI_BACKEND)
1212
add_library(LevelZero::NPUExt ALIAS level-zero-ext)
1313
install(TARGETS level-zero-ext EXPORT "${PROJECT_NAME}Targets")
1414
endif()
15+
16+
#
17+
# yaml-cpp
18+
#
19+
20+
if(ENABLE_INTEL_NPU_PROTOPIPE)
21+
add_subdirectory(yaml-cpp EXCLUDE_FROM_ALL)
22+
# NB: Suppress warnings in yaml-cpp
23+
if(SUGGEST_OVERRIDE_SUPPORTED)
24+
target_compile_options(yaml-cpp PRIVATE -Wno-suggest-override)
25+
endif()
26+
endif()
Submodule yaml-cpp added at da82fd9

src/plugins/intel_npu/tools/CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@
66
add_subdirectory(common)
77
add_subdirectory(compile_tool)
88
add_subdirectory(single-image-test)
9+
10+
if (ENABLE_INTEL_NPU_PROTOPIPE)
11+
add_subdirectory(protopipe)
12+
endif()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#
2+
# Copyright (C) 2023-2024 Intel Corporation.
3+
# SPDX-License-Identifier: Apache 2.0
4+
#
5+
6+
set(TARGET_NAME protopipe)
7+
8+
if (NOT DEFINED PROJECT_NAME)
9+
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
10+
project(protopipe_standalone)
11+
include("cmake/standalone.cmake")
12+
return()
13+
endif()
14+
15+
#
16+
# Dependencies
17+
#
18+
19+
find_package(OpenCV QUIET COMPONENTS gapi)
20+
if(OpenCV_VERSION VERSION_LESS 4.9)
21+
message(STATUS "NPU ${TARGET_NAME} tool is disabled due to missing dependencies: gapi from OpenCV >= 4.9.")
22+
return()
23+
endif()
24+
25+
if (WIN32)
26+
# WA: add_tool_target expects to have all dependencies as cmake targets.
27+
add_library(winmm INTERFACE)
28+
target_link_libraries(winmm INTERFACE "winmm.lib")
29+
endif()
30+
31+
#
32+
# Define the target
33+
#
34+
35+
set(PROTOPIPE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
36+
37+
ov_add_target(ADD_CPPLINT
38+
TYPE EXECUTABLE
39+
NAME ${TARGET_NAME}
40+
ROOT ${CMAKE_CURRENT_SOURCE_DIR}
41+
ADDITIONAL_SOURCE_DIRS ${PROTOPIPE_SOURCE_DIR}
42+
INCLUDES ${PROTOPIPE_SOURCE_DIR}
43+
LINK_LIBRARIES
44+
PRIVATE
45+
Threads::Threads
46+
gflags
47+
yaml-cpp
48+
openvino::runtime
49+
opencv_gapi
50+
winmm)
51+
52+
53+
54+
set_target_properties(${TARGET_NAME} PROPERTIES
55+
FOLDER ${CMAKE_CURRENT_SOURCE_DIR}
56+
CXX_STANDARD 17)
57+
58+
#
59+
# Install
60+
#
61+
62+
install(TARGETS ${TARGET_NAME}
63+
RUNTIME DESTINATION "tools/${TARGET_NAME}"
64+
COMPONENT ${NPU_INTERNAL_COMPONENT}
65+
${OV_CPACK_COMP_NPU_INTERNAL_EXCLUDE_ALL})
66+
67+
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
68+
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/README.md"
69+
DESTINATION "tools/${TARGET_NAME}"
70+
COMPONENT ${NPU_INTERNAL_COMPONENT}
71+
${OV_CPACK_COMP_NPU_INTERNAL_EXCLUDE_ALL})
72+
endif()

0 commit comments

Comments
 (0)