From 3863656f446bdaa1fa7664127e315fcd97d0ef7e Mon Sep 17 00:00:00 2001 From: "Somsikov, Andrey" Date: Mon, 1 Jun 2020 10:26:34 +0300 Subject: [PATCH] Use ittnotify from thirdparty VTune ittnotify lack of support aarch64. Switching to use ittnotify in sources to support any target architecture. --- 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, 6 insertions(+), 61 deletions(-) delete mode 100644 inference-engine/cmake/FindITT.cmake diff --git a/inference-engine/cmake/FindITT.cmake b/inference-engine/cmake/FindITT.cmake deleted file mode 100644 index 6c4003d..0000000 --- a/inference-engine/cmake/FindITT.cmake +++ /dev/null @@ -1,57 +0,0 @@ -# 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 0988229..c76af08 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) - find_package(ITT REQUIRED) + set(INTEL_ITT_LIBS IE::ittnotify) 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 7a5c7b5..659251e 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_dependent_option (ENABLE_PROFILING_ITT "ITT tracing of IE and plugins internals" ON "NOT CMAKE_CROSSCOMPILING" OFF) +ie_option (ENABLE_PROFILING_ITT "ITT tracing of IE and plugins internals" ON) # "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 d3bdb35..d377c34 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' | + 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 '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 f94453e..bcb9e27 100644 --- a/inference-engine/thirdparty/CMakeLists.txt +++ b/inference-engine/thirdparty/CMakeLists.txt @@ -46,6 +46,7 @@ function(build_with_lto) add_subdirectory(stb_lib) add_subdirectory(ade) add_subdirectory(fluid/modules/gapi) + add_subdirectory(ittnotify) target_include_directories(pugixml INTERFACE "$") @@ -54,7 +55,7 @@ function(build_with_lto) # developer package - ie_developer_export_targets(ade fluid pugixml) + ie_developer_export_targets(ade fluid pugixml ittnotify) 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 270d944..b782d44 100644 --- a/inference-engine/thirdparty/ittnotify/CMakeLists.txt +++ b/inference-engine/thirdparty/ittnotify/CMakeLists.txt @@ -48,6 +48,7 @@ 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