Use ittnotify from thirdparty
authorSomsikov, Andrey <andrey.somsikov@intel.com>
Mon, 1 Jun 2020 07:26:34 +0000 (10:26 +0300)
committerAndrey Somsikov <andrey.somsikov@gmail.com>
Mon, 1 Jun 2020 17:53:39 +0000 (20:53 +0300)
VTune ittnotify lack of support aarch64. Switching to use ittnotify
in sources to support any target architecture.

inference-engine/cmake/FindITT.cmake [deleted file]
inference-engine/cmake/developer_package_ie.cmake
inference-engine/cmake/features_ie.cmake
inference-engine/scripts/run_code_checks.sh
inference-engine/thirdparty/CMakeLists.txt
inference-engine/thirdparty/ittnotify/CMakeLists.txt

diff --git a/inference-engine/cmake/FindITT.cmake b/inference-engine/cmake/FindITT.cmake
deleted file mode 100644 (file)
index 6c4003d..0000000
+++ /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()
index 0988229..c76af08 100644 (file)
@@ -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})
index 7a5c7b5..659251e 100644 (file)
@@ -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)
index d3bdb35..d377c34 100755 (executable)
@@ -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/"/\&quot;/g' >&1| sed 's/</\&lt;/g' >&1| sed 's/>/\&gt;/g' >&1| sed "s/'/\&apos;/g" >&1|
         sed 's/\&/\&amp;/g' >&1| python ${CURRENT_DIR}/cpplint_to_cppcheckxml.py &> ${CPPLINT_REPORT_DIR}/cpplint-cppcheck-result.xml
index f94453e..bcb9e27 100644 (file)
@@ -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 "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/pugixml/src>")
 
@@ -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)
index 270d944..b782d44 100644 (file)
@@ -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