From f15096e101ccc8e9181f51abaef80a2578c92072 Mon Sep 17 00:00:00 2001 From: azhogov Date: Tue, 2 Jun 2020 12:50:06 +0300 Subject: [PATCH] Revert "Use ittnotify from thirdparty" This reverts commit 3863656f446bdaa1fa7664127e315fcd97d0ef7e. --- inference-engine/cmake/FindITT.cmake | 57 ++++++++++++++++++++++ inference-engine/cmake/developer_package_ie.cmake | 2 +- inference-engine/cmake/features_ie.cmake | 2 +- inference-engine/scripts/run_code_checks.sh | 2 +- inference-engine/thirdparty/CMakeLists.txt | 3 +- .../thirdparty/ittnotify/CMakeLists.txt | 1 - 6 files changed, 61 insertions(+), 6 deletions(-) create mode 100644 inference-engine/cmake/FindITT.cmake diff --git a/inference-engine/cmake/FindITT.cmake b/inference-engine/cmake/FindITT.cmake new file mode 100644 index 0000000..6c4003d --- /dev/null +++ b/inference-engine/cmake/FindITT.cmake @@ -0,0 +1,57 @@ +# Copyright (C) 2018-2020 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 +# + +unset(ITT_INCLUDE_DIR CACHE) +unset(ITT_LIB CACHE) + +if(NOT DEFINED INTEL_VTUNE_DIR AND DEFINED ENV{INTEL_VTUNE_DIR}) + set(INTEL_VTUNE_DIR "$ENV{INTEL_VTUNE_DIR}") +endif() +if(NOT DEFINED INTEL_VTUNE_DIR) + if(EXISTS "/opt/intel/vtune_amplifier_xe/include") + set(INTEL_VTUNE_DIR "/opt/intel/vtune_amplifier_xe") + elseif(EXISTS "/opt/intel/vtune_amplifier/include") + set(INTEL_VTUNE_DIR "/opt/intel/vtune_amplifier") + elseif (EXISTS "C:/Program Files (x86)/IntelSWTools/VTune Amplifier XE") + set(INTEL_VTUNE_DIR "C:/Program Files (x86)/IntelSWTools/VTune Amplifier XE") + elseif (EXISTS "C:/Program Files (x86)/IntelSWTools/VTune Amplifier") + set(INTEL_VTUNE_DIR "C:/Program Files (x86)/IntelSWTools/VTune Amplifier") + elseif (EXISTS "$ENV{HOME}/intel/vtune_amplifier_2019") + set(INTEL_VTUNE_DIR "$ENV{HOME}/intel/vtune_amplifier_2019") + endif() +endif() + +if(DEFINED INTEL_VTUNE_DIR) + message(STATUS "INTEL_VTUNE_DIR = ${INTEL_VTUNE_DIR}") + + find_path(ITT_INCLUDE_DIR + FILES + ittnotify.h + PATHS "${INTEL_VTUNE_DIR}/include/") + + find_library(ITT_LIB + "libittnotify${CMAKE_STATIC_LIBRARY_SUFFIX}" + PATHS ${INTEL_VTUNE_DIR}/lib64) + + set(Located_ITT_LIBS ${ITT_LIB}) + set(Located_ITT_INCLUDE_DIRS ${ITT_INCLUDE_DIR}) +else() + message(STATUS "INTEL_VTUNE_DIR is not defined") +endif() + +# Handle find_package() arguments, and set INTEL_ITT_FOUND +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(INTEL_ITT + REQUIRED_VARS + Located_ITT_INCLUDE_DIRS + Located_ITT_LIBS) + +if(INTEL_ITT_FOUND) + add_library(ittnotify STATIC IMPORTED GLOBAL) + set_target_properties(ittnotify PROPERTIES IMPORTED_LOCATION "${Located_ITT_LIBS}" + INTERFACE_INCLUDE_DIRECTORIES ${Located_ITT_INCLUDE_DIRS} + INTERFACE_COMPILE_DEFINITIONS ENABLE_PROFILING_ITT) + + set(INTEL_ITT_LIBS ittnotify ${CMAKE_DL_LIBS}) +endif() diff --git a/inference-engine/cmake/developer_package_ie.cmake b/inference-engine/cmake/developer_package_ie.cmake index c76af08..0988229 100644 --- a/inference-engine/cmake/developer_package_ie.cmake +++ b/inference-engine/cmake/developer_package_ie.cmake @@ -6,7 +6,7 @@ include(cpplint) include(clang_format) if(ENABLE_PROFILING_ITT) - set(INTEL_ITT_LIBS IE::ittnotify) + find_package(ITT REQUIRED) endif() set(TBB_FIND_RELEASE_ONLY ${ENABLE_TBB_RELEASE_ONLY}) diff --git a/inference-engine/cmake/features_ie.cmake b/inference-engine/cmake/features_ie.cmake index 659251e..7a5c7b5 100644 --- a/inference-engine/cmake/features_ie.cmake +++ b/inference-engine/cmake/features_ie.cmake @@ -11,7 +11,7 @@ ie_dependent_option (ENABLE_GNA "GNA support for inference engine" ON "NOT APPLE ie_dependent_option (ENABLE_CLDNN_TESTS "Enable clDNN unit tests" OFF "ENABLE_CLDNN" OFF) -ie_option (ENABLE_PROFILING_ITT "ITT tracing of IE and plugins internals" ON) +ie_dependent_option (ENABLE_PROFILING_ITT "ITT tracing of IE and plugins internals" ON "NOT CMAKE_CROSSCOMPILING" OFF) # "MKL-DNN library might use MKL-ML or OpenBLAS for gemm tasks: MKL|OPENBLAS|JIT" if (ENABLE_MKL_DNN) diff --git a/inference-engine/scripts/run_code_checks.sh b/inference-engine/scripts/run_code_checks.sh index d377c34..d3bdb35 100755 --- a/inference-engine/scripts/run_code_checks.sh +++ b/inference-engine/scripts/run_code_checks.sh @@ -33,7 +33,7 @@ function run_cpplint() { -readability/todo, -readability/fn_size " $(find ${SOURCE_DIR} -name '*.h' -or -name '*.cc' -or -name '*.c' -or -name '*.cpp' -or -name '*.hpp' | - grep -v 'inference-engine/bin\|inference-engine/build\|inference-engine/report\|inference-engine/scripts\|inference-engine/temp\|inference-engine/tests_deprecated/\|gtest\|inference-engine/ie_bridges\|pugixml\|inference-engine/tools/vpu_perfcheck\|thirdparty/gflags\|thirdparty/ade\|thirdparty/fluid\|thirdparty/mkl-dnn\|thirdparty/movidius\|thirdparty/ocv\|thirdparty/plugixml\|thirdparty/std_lib\|thirdparty/clDNN/common\|thirdparty/clDNN/tutorial\|thirdparty/clDNN/utils\|thirdparty/ittnotify' | + grep -v 'inference-engine/bin\|inference-engine/build\|inference-engine/report\|inference-engine/scripts\|inference-engine/temp\|inference-engine/tests_deprecated/\|gtest\|inference-engine/ie_bridges\|pugixml\|inference-engine/tools/vpu_perfcheck\|thirdparty/gflags\|thirdparty/ade\|thirdparty/fluid\|thirdparty/mkl-dnn\|thirdparty/movidius\|thirdparty/ocv\|thirdparty/plugixml\|thirdparty/std_lib\|thirdparty/clDNN/common\|thirdparty/clDNN/tutorial\|thirdparty/clDNN/utils' | grep 'include\|src\|inference-engine/samples\|thirdparty/clDNN/kernel_selector\|thirdparty/clDNN/api\|thirdparty/clDNN/api_extension\|inference-engine/tests_' ) 2>&1 | sed 's/"/\"/g' >&1| sed 's/&1| sed 's/>/\>/g' >&1| sed "s/'/\'/g" >&1| sed 's/\&/\&/g' >&1| python ${CURRENT_DIR}/cpplint_to_cppcheckxml.py &> ${CPPLINT_REPORT_DIR}/cpplint-cppcheck-result.xml diff --git a/inference-engine/thirdparty/CMakeLists.txt b/inference-engine/thirdparty/CMakeLists.txt index bcb9e27..f94453e 100644 --- a/inference-engine/thirdparty/CMakeLists.txt +++ b/inference-engine/thirdparty/CMakeLists.txt @@ -46,7 +46,6 @@ function(build_with_lto) add_subdirectory(stb_lib) add_subdirectory(ade) add_subdirectory(fluid/modules/gapi) - add_subdirectory(ittnotify) target_include_directories(pugixml INTERFACE "$") @@ -55,7 +54,7 @@ function(build_with_lto) # developer package - ie_developer_export_targets(ade fluid pugixml ittnotify) + ie_developer_export_targets(ade fluid pugixml) if(TARGET pugixml_mt) ie_developer_export_targets(pugixml_mt) set_target_properties(pugixml_mt PROPERTIES FOLDER thirdparty) diff --git a/inference-engine/thirdparty/ittnotify/CMakeLists.txt b/inference-engine/thirdparty/ittnotify/CMakeLists.txt index b782d44..270d944 100644 --- a/inference-engine/thirdparty/ittnotify/CMakeLists.txt +++ b/inference-engine/thirdparty/ittnotify/CMakeLists.txt @@ -48,7 +48,6 @@ if (ANDROID) endif() SET_TARGET_PROPERTIES(ittnotify PROPERTIES LINKER_LANGUAGE C) -SET_TARGET_PROPERTIES(ittnotify PROPERTIES INTERFACE_COMPILE_DEFINITIONS ENABLE_PROFILING_ITT) target_include_directories(ittnotify PUBLIC include src/ittnotify -- 2.7.4