Moved ittapi to thirdparty (#4164)

This commit is contained in:
Ilya Churaev 2021-02-04 11:13:44 +03:00 committed by GitHub
parent 956c6dd35f
commit 939ddeac41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 48 additions and 32 deletions

View File

@ -142,8 +142,8 @@ function(openvino_developer_export_targets)
"A list of OpenVINO exported components" FORCE)
endfunction()
add_subdirectory(openvino)
add_subdirectory(thirdparty)
add_subdirectory(openvino)
build_ngraph()
add_subdirectory(inference-engine)
add_subdirectory(model-optimizer)

View File

@ -18,37 +18,6 @@ set(TARGET_NAME itt)
file(GLOB_RECURSE SOURCES "src/*.cpp" "src/*.hpp")
if(ENABLE_PROFILING_ITT)
if(DEFINED INTEL_VTUNE_DIR OR DEFINED ENV{INTEL_VTUNE_DIR})
find_package(ITT
PATHS "${CMAKE_CURRENT_SOURCE_DIR}/cmake"
NO_DEFAULT_PATH)
if(NOT ITT_FOUND)
message(WARNING "Profiling option enabled, but no ITT library was found under INTEL_VTUNE_DIR")
endif()
else()
include(FetchContent)
FetchContent_Declare(
ext_ittapi
GIT_REPOSITORY https://github.com/intel/ittapi.git
GIT_TAG v3.18.6
)
FetchContent_GetProperties(ext_ittapi)
if(NOT ext_ittapi_POPULATED)
FetchContent_Populate(ext_ittapi)
add_subdirectory(${ext_ittapi_SOURCE_DIR} ${ext_ittapi_BINARY_DIR})
endif()
target_compile_definitions(ittnotify INTERFACE ENABLE_PROFILING_ITT)
if (UNIX)
target_compile_options(ittnotify PRIVATE -Wno-undef)
endif()
openvino_developer_export_targets(COMPONENT openvino_common TARGETS ittnotify)
endif()
endif()
add_library(${TARGET_NAME} STATIC ${SOURCES})
add_library(openvino::itt ALIAS ${TARGET_NAME})

View File

@ -14,4 +14,5 @@
# limitations under the License.
# ******************************************************************************
add_subdirectory(ittapi)
add_subdirectory(itt_collector)

46
thirdparty/ittapi/CMakeLists.txt vendored Normal file
View File

@ -0,0 +1,46 @@
# ******************************************************************************
# Copyright 2017-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ******************************************************************************
if(ENABLE_PROFILING_ITT)
if(DEFINED INTEL_VTUNE_DIR OR DEFINED ENV{INTEL_VTUNE_DIR})
find_package(ITT
PATHS "${CMAKE_CURRENT_SOURCE_DIR}/cmake"
NO_DEFAULT_PATH)
if(NOT ITT_FOUND)
message(WARNING "Profiling option enabled, but no ITT library was found under INTEL_VTUNE_DIR")
endif()
else()
include(FetchContent)
FetchContent_Declare(
ext_ittapi
GIT_REPOSITORY https://github.com/intel/ittapi.git
GIT_TAG v3.18.6
)
FetchContent_GetProperties(ext_ittapi)
if(NOT ext_ittapi_POPULATED)
FetchContent_Populate(ext_ittapi)
add_subdirectory(${ext_ittapi_SOURCE_DIR} ${ext_ittapi_BINARY_DIR})
endif()
target_compile_definitions(ittnotify INTERFACE ENABLE_PROFILING_ITT)
if (UNIX)
target_compile_options(ittnotify PRIVATE -Wno-undef)
endif()
openvino_developer_export_targets(COMPONENT openvino_common TARGETS ittnotify)
endif()
endif()