From 1d62f0141dcfff64ba67678a110b666abaee7f74 Mon Sep 17 00:00:00 2001 From: Ilya Churaev Date: Tue, 5 Sep 2023 21:31:52 +0400 Subject: [PATCH] Rename cmake ie_ macros and ie_parallel script (#19606) * Rename cmake ie_ macros and ie_parallel script * Add warning messages --- cmake/developer_package/IEDevScriptsConfig.cmake | 7 ++++--- src/cmake/install_tbb.cmake | 2 +- src/cmake/openvino.cmake | 6 +++--- src/cmake/{ie_parallel.cmake => ov_parallel.cmake} | 9 +++++++-- src/common/low_precision_transformations/CMakeLists.txt | 2 +- src/common/preprocessing/src/CMakeLists.txt | 6 +++--- src/common/snippets/CMakeLists.txt | 2 +- src/common/transformations/CMakeLists.txt | 2 +- src/core/CMakeLists.txt | 2 +- src/core/reference/CMakeLists.txt | 2 +- src/inference/CMakeLists.txt | 8 ++++---- src/plugins/auto/CMakeLists.txt | 4 ++-- src/plugins/auto/tests/unit/CMakeLists.txt | 2 +- src/plugins/auto_batch/tests/functional/CMakeLists.txt | 2 +- src/plugins/auto_batch/tests/unit/CMakeLists.txt | 2 +- src/plugins/intel_cpu/CMakeLists.txt | 6 +++--- src/plugins/intel_cpu/tests/functional/CMakeLists.txt | 2 +- .../intel_cpu/tests/functional/specific_tests.cmake | 2 +- .../intel_cpu/tests/functional/target_per_test.cmake | 4 ++-- src/plugins/intel_gna/CMakeLists.txt | 2 +- src/plugins/intel_gpu/src/graph/CMakeLists.txt | 2 +- src/plugins/intel_gpu/src/runtime/CMakeLists.txt | 2 +- src/plugins/intel_gpu/tests/unit/CMakeLists.txt | 2 +- 23 files changed, 43 insertions(+), 37 deletions(-) rename src/cmake/{ie_parallel.cmake => ov_parallel.cmake} (98%) diff --git a/cmake/developer_package/IEDevScriptsConfig.cmake b/cmake/developer_package/IEDevScriptsConfig.cmake index 66d784b2d33..4f6a195b293 100644 --- a/cmake/developer_package/IEDevScriptsConfig.cmake +++ b/cmake/developer_package/IEDevScriptsConfig.cmake @@ -255,7 +255,7 @@ get_linux_name(LINUX_OS_NAME) # macro to mark target as conditionally compiled -function(ie_mark_target_as_cc TARGET_NAME) +function(ov_mark_target_as_cc TARGET_NAME) set(cc_library openvino::conditional_compilation) if(TARGET IE::conditional_compilation) set(cc_library IE::conditional_compilation) @@ -275,8 +275,9 @@ function(ie_mark_target_as_cc TARGET_NAME) add_dependencies(${TARGET_NAME} conditional_compilation_gen) endfunction() -function(ov_mark_target_as_cc) - ie_mark_target_as_cc(${ARGN}) +function(ie_mark_target_as_cc TARGET_NAME) + message(WARNING "This function is deprecated. Please use ov_mark_target_as_cc(TARGET_NAME) instead.") + ov_mark_target_as_cc(${TARGET_NAME}) endfunction() include(python_requirements) diff --git a/src/cmake/install_tbb.cmake b/src/cmake/install_tbb.cmake index bd4acb1a4b4..d5e3e7037ed 100644 --- a/src/cmake/install_tbb.cmake +++ b/src/cmake/install_tbb.cmake @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 # -include(cmake/ie_parallel.cmake) +include(cmake/ov_parallel.cmake) # pre-find TBB: need to provide TBB_IMPORTED_TARGETS used for installation ov_find_package_tbb() diff --git a/src/cmake/openvino.cmake b/src/cmake/openvino.cmake index 872358e3a68..685a5e50051 100644 --- a/src/cmake/openvino.cmake +++ b/src/cmake/openvino.cmake @@ -64,8 +64,8 @@ if(WIN32) set_target_properties(${TARGET_NAME} PROPERTIES COMPILE_PDB_NAME ${TARGET_NAME}) endif() -set_ie_threading_interface_for(${TARGET_NAME}) -ie_mark_target_as_cc(${TARGET_NAME}) +ov_set_threading_interface_for(${TARGET_NAME}) +ov_mark_target_as_cc(${TARGET_NAME}) # must be called after all target_link_libraries ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME} EXTRA ${TBB_IMPORTED_TARGETS}) @@ -107,7 +107,7 @@ target_compile_definitions(${TARGET_NAME}_dev INTERFACE target_link_libraries(${TARGET_NAME}_dev INTERFACE ${TARGET_NAME} openvino::core::dev) -set_ie_threading_interface_for(${TARGET_NAME}_dev) +ov_set_threading_interface_for(${TARGET_NAME}_dev) set_target_properties(${TARGET_NAME}_dev PROPERTIES EXPORT_NAME runtime::dev) openvino_developer_export_targets(COMPONENT core TARGETS openvino::runtime::dev) diff --git a/src/cmake/ie_parallel.cmake b/src/cmake/ov_parallel.cmake similarity index 98% rename from src/cmake/ie_parallel.cmake rename to src/cmake/ov_parallel.cmake index 62e5d2d06f4..2d66146c699 100644 --- a/src/cmake/ie_parallel.cmake +++ b/src/cmake/ov_parallel.cmake @@ -242,7 +242,7 @@ macro(ov_find_package_tbb) endif() endmacro() -function(set_ie_threading_interface_for TARGET_NAME) +function(ov_set_threading_interface_for TARGET_NAME) if(THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO" AND NOT TBB_FOUND) # find TBB ov_find_package_tbb() @@ -331,7 +331,7 @@ function(set_ie_threading_interface_for TARGET_NAME) endif () if (NOT OpenVINO_SOURCE_DIR) - # TODO: dead code since ie_parallel.cmake is not used outside of OpenVINO build + # TODO: dead code since ov_parallel.cmake is not used outside of OpenVINO build if (WIN32) set(lib_rel_path ${IE_LIB_REL_DIR}) set(lib_dbg_path ${IE_LIB_DBG_DIR}) @@ -398,4 +398,9 @@ function(set_ie_threading_interface_for TARGET_NAME) find_package(Threads REQUIRED) ie_target_link_libraries(${TARGET_NAME} ${LINK_TYPE} Threads::Threads) endif() +endfunction(ov_set_threading_interface_for) + +function(set_ie_threading_interface_for TARGET_NAME) + message(WARNING "This function is deprecated. Please use ov_set_threading_interface_for(TARGET_NAME) instead.") + ov_set_threading_interface_for(${TARGET_NAME}) endfunction(set_ie_threading_interface_for) diff --git a/src/common/low_precision_transformations/CMakeLists.txt b/src/common/low_precision_transformations/CMakeLists.txt index fea803cc7fd..bacf03ce3b8 100644 --- a/src/common/low_precision_transformations/CMakeLists.txt +++ b/src/common/low_precision_transformations/CMakeLists.txt @@ -33,7 +33,7 @@ target_include_directories(${TARGET_NAME}_obj PRIVATE $ $) - set_ie_threading_interface_for(${TARGET_NAME}_obj) + ov_set_threading_interface_for(${TARGET_NAME}_obj) add_cpplint_target(${TARGET_NAME}_obj_cpplint FOR_TARGETS ${TARGET_NAME}_obj) @@ -135,7 +135,7 @@ endif() add_library(${TARGET_NAME} ${library_type} ${library_sources}) -set_ie_threading_interface_for(${TARGET_NAME}) +ov_set_threading_interface_for(${TARGET_NAME}) if(ENABLE_GAPI_PREPROCESSING) target_compile_definitions(${TARGET_NAME} PUBLIC ENABLE_GAPI_PREPROCESSING) @@ -182,7 +182,7 @@ if(ENABLE_GAPI_PREPROCESSING) add_library(${TARGET_NAME}_s STATIC EXCLUDE_FROM_ALL $) - set_ie_threading_interface_for(${TARGET_NAME}_s) + ov_set_threading_interface_for(${TARGET_NAME}_s) target_include_directories(${TARGET_NAME}_s INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}") diff --git a/src/common/snippets/CMakeLists.txt b/src/common/snippets/CMakeLists.txt index 31726fcd9ef..ceb0374e085 100644 --- a/src/common/snippets/CMakeLists.txt +++ b/src/common/snippets/CMakeLists.txt @@ -36,7 +36,7 @@ target_include_directories(${TARGET_NAME} PUBLIC $ need to mark this library as important for ABI free ov_abi_free_target(ngraph_obj) diff --git a/src/core/reference/CMakeLists.txt b/src/core/reference/CMakeLists.txt index c9039f1b4d5..3e42d75747c 100644 --- a/src/core/reference/CMakeLists.txt +++ b/src/core/reference/CMakeLists.txt @@ -25,7 +25,7 @@ ie_faster_build(${TARGET_NAME} UNITY PCH PRIVATE "src/precomp.hpp") -set_ie_threading_interface_for(${TARGET_NAME}) +ov_set_threading_interface_for(${TARGET_NAME}) target_compile_definitions(${TARGET_NAME} PRIVATE XBYAK_NO_OP_NAMES XBYAK64) diff --git a/src/inference/CMakeLists.txt b/src/inference/CMakeLists.txt index d50bc84013a..0234bbb51c3 100644 --- a/src/inference/CMakeLists.txt +++ b/src/inference/CMakeLists.txt @@ -101,7 +101,7 @@ target_compile_definitions(${TARGET_NAME}_plugin_api INTERFACE target_link_libraries(${TARGET_NAME}_plugin_api INTERFACE openvino::pugixml openvino::itt openvino::util) -set_ie_threading_interface_for(${TARGET_NAME}_plugin_api) +ov_set_threading_interface_for(${TARGET_NAME}_plugin_api) file(GLOB_RECURSE plugin_api_src "${CMAKE_CURRENT_SOURCE_DIR}/dev_api/*.hpp" "${CMAKE_CURRENT_SOURCE_DIR}/dev_api/*.h") @@ -155,12 +155,12 @@ target_include_directories(${TARGET_NAME}_obj PRIVATE $) target_link_libraries(${TARGET_NAME}_obj PRIVATE openvino::itt openvino::util openvino::core::dev) -ie_mark_target_as_cc(${TARGET_NAME}_obj) +ov_mark_target_as_cc(${TARGET_NAME}_obj) # IE is public API => need to mark this library as important for ABI free ov_abi_free_target(${TARGET_NAME}_obj) -set_ie_threading_interface_for(${TARGET_NAME}_obj) +ov_set_threading_interface_for(${TARGET_NAME}_obj) if (TBBBIND_2_5_FOUND) target_link_libraries(${TARGET_NAME}_obj PRIVATE ${TBBBIND_2_5_IMPORTED_TARGETS}) endif() @@ -184,7 +184,7 @@ add_library(${TARGET_NAME}_s STATIC EXCLUDE_FROM_ALL $<$:$> $) -set_ie_threading_interface_for(${TARGET_NAME}_s) +ov_set_threading_interface_for(${TARGET_NAME}_s) if (TBBBIND_2_5_FOUND) target_link_libraries(${TARGET_NAME}_s PRIVATE ${TBBBIND_2_5_IMPORTED_TARGETS}) endif() diff --git a/src/plugins/auto/CMakeLists.txt b/src/plugins/auto/CMakeLists.txt index 312ac4a7966..6eeb4ea4ef2 100644 --- a/src/plugins/auto/CMakeLists.txt +++ b/src/plugins/auto/CMakeLists.txt @@ -39,9 +39,9 @@ if(ENABLE_TESTS) add_subdirectory(tests) endif() -set_ie_threading_interface_for(${TARGET_NAME}) +ov_set_threading_interface_for(${TARGET_NAME}) # must be called after all target_link_libraries ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME}) -set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO}) \ No newline at end of file +set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO}) diff --git a/src/plugins/auto/tests/unit/CMakeLists.txt b/src/plugins/auto/tests/unit/CMakeLists.txt index b967ef3fb70..e4b392c8146 100644 --- a/src/plugins/auto/tests/unit/CMakeLists.txt +++ b/src/plugins/auto/tests/unit/CMakeLists.txt @@ -27,4 +27,4 @@ ov_add_test_target( ) ov_add_version_defines(${OpenVINO_SOURCE_DIR}/src/plugins/auto/src/plugin.cpp ${TARGET_NAME}) -set_ie_threading_interface_for(${TARGET_NAME}) +ov_set_threading_interface_for(${TARGET_NAME}) diff --git a/src/plugins/auto_batch/tests/functional/CMakeLists.txt b/src/plugins/auto_batch/tests/functional/CMakeLists.txt index 41ed2140234..7c5137f9b56 100644 --- a/src/plugins/auto_batch/tests/functional/CMakeLists.txt +++ b/src/plugins/auto_batch/tests/functional/CMakeLists.txt @@ -22,4 +22,4 @@ addIeTargetTest( Auto_Batch ) -set_ie_threading_interface_for(${TARGET_NAME}) +ov_set_threading_interface_for(${TARGET_NAME}) diff --git a/src/plugins/auto_batch/tests/unit/CMakeLists.txt b/src/plugins/auto_batch/tests/unit/CMakeLists.txt index e1b21734284..4b44fc47fa9 100644 --- a/src/plugins/auto_batch/tests/unit/CMakeLists.txt +++ b/src/plugins/auto_batch/tests/unit/CMakeLists.txt @@ -31,4 +31,4 @@ addIeTargetTest( ) ov_add_version_defines(${OpenVINO_SOURCE_DIR}/src/plugins/auto_batch/src/plugin.cpp ${TARGET_NAME}) -set_ie_threading_interface_for(${TARGET_NAME}) +ov_set_threading_interface_for(${TARGET_NAME}) diff --git a/src/plugins/intel_cpu/CMakeLists.txt b/src/plugins/intel_cpu/CMakeLists.txt index 3212bdefc7d..1279bfd1269 100644 --- a/src/plugins/intel_cpu/CMakeLists.txt +++ b/src/plugins/intel_cpu/CMakeLists.txt @@ -113,7 +113,7 @@ elseif(RISCV64) set_target_properties(${TARGET_NAME} PROPERTIES OUTPUT_NAME "openvino_riscv_cpu_plugin") endif() -ie_mark_target_as_cc(${TARGET_NAME}) +ov_mark_target_as_cc(${TARGET_NAME}) target_link_libraries(${TARGET_NAME} PRIVATE dnnl openvino::shape_inference @@ -139,7 +139,7 @@ cross_compiled_file(${TARGET_NAME} # system dependencies must go last target_link_libraries(${TARGET_NAME} PRIVATE openvino::pugixml) -set_ie_threading_interface_for(${TARGET_NAME}) +ov_set_threading_interface_for(${TARGET_NAME}) # must be called after all target_link_libraries ie_add_api_validator_post_build_step(TARGET ${TARGET_NAME}) @@ -173,7 +173,7 @@ if(BUILD_SHARED_LIBS) target_include_directories(${TARGET_NAME}_obj SYSTEM PUBLIC $) endif() - set_ie_threading_interface_for(${TARGET_NAME}_obj) + ov_set_threading_interface_for(${TARGET_NAME}_obj) target_compile_definitions(${TARGET_NAME}_obj PRIVATE USE_STATIC_IE IMPLEMENT_INFERENCE_ENGINE_PLUGIN IMPLEMENT_INFERENCE_EXTENSION_API diff --git a/src/plugins/intel_cpu/tests/functional/CMakeLists.txt b/src/plugins/intel_cpu/tests/functional/CMakeLists.txt index 281c6eb8b19..f79ca573045 100644 --- a/src/plugins/intel_cpu/tests/functional/CMakeLists.txt +++ b/src/plugins/intel_cpu/tests/functional/CMakeLists.txt @@ -54,7 +54,7 @@ addIeTargetTest( LABELS CPU ) -set_ie_threading_interface_for(${TARGET_NAME}) +ov_set_threading_interface_for(${TARGET_NAME}) include(specific_tests.cmake) include(target_per_test.cmake) diff --git a/src/plugins/intel_cpu/tests/functional/specific_tests.cmake b/src/plugins/intel_cpu/tests/functional/specific_tests.cmake index 25dfe9291d7..1a3025966a4 100644 --- a/src/plugins/intel_cpu/tests/functional/specific_tests.cmake +++ b/src/plugins/intel_cpu/tests/functional/specific_tests.cmake @@ -53,5 +53,5 @@ if(DEFINED ENABLE_CPU_SUBSET_TESTS_PATH) CPU ) - set_ie_threading_interface_for(${SUBSET_TARGET_NAME}) + ov_set_threading_interface_for(${SUBSET_TARGET_NAME}) endif() diff --git a/src/plugins/intel_cpu/tests/functional/target_per_test.cmake b/src/plugins/intel_cpu/tests/functional/target_per_test.cmake index f5ebcfc40f5..4d783a270f8 100644 --- a/src/plugins/intel_cpu/tests/functional/target_per_test.cmake +++ b/src/plugins/intel_cpu/tests/functional/target_per_test.cmake @@ -39,7 +39,7 @@ function(create_target_per_test_for_directory TEST_DIR TARGET_PREFIX) CPU ) - set_ie_threading_interface_for(${TEST_TARGET_NAME}) + ov_set_threading_interface_for(${TEST_TARGET_NAME}) # avoid building binaries for every test in case target 'all' is used set_target_properties(${TEST_TARGET_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) @@ -78,7 +78,7 @@ function(create_target_per_test_for_directory TEST_DIR TARGET_PREFIX) CPU ) - set_ie_threading_interface_for(${TEST_TARGET_NAME}) + ov_set_threading_interface_for(${TEST_TARGET_NAME}) # avoid building binaries for every test in case target 'all' is used set_target_properties(${TEST_TARGET_NAME} PROPERTIES EXCLUDE_FROM_ALL ON) diff --git a/src/plugins/intel_gna/CMakeLists.txt b/src/plugins/intel_gna/CMakeLists.txt index 0c20423448f..f2befa4d323 100644 --- a/src/plugins/intel_gna/CMakeLists.txt +++ b/src/plugins/intel_gna/CMakeLists.txt @@ -46,7 +46,7 @@ ov_add_plugin(NAME ${TARGET_NAME} ADD_CLANG_FORMAT) # Enable support of CC for the plugin -ie_mark_target_as_cc(${TARGET_NAME}) +ov_mark_target_as_cc(${TARGET_NAME}) target_link_libraries(${TARGET_NAME} PRIVATE inference_engine_legacy Threads::Threads libGNA) diff --git a/src/plugins/intel_gpu/src/graph/CMakeLists.txt b/src/plugins/intel_gpu/src/graph/CMakeLists.txt index 0b2093d2a04..3831742ace5 100644 --- a/src/plugins/intel_gpu/src/graph/CMakeLists.txt +++ b/src/plugins/intel_gpu/src/graph/CMakeLists.txt @@ -48,7 +48,7 @@ if(COMMAND add_cpplint_target) add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME}) endif() -set_ie_threading_interface_for(${TARGET_NAME}) +ov_set_threading_interface_for(${TARGET_NAME}) set_target_properties(${TARGET_NAME} PROPERTIES INTERPROCEDURAL_OPTIMIZATION_RELEASE ${ENABLE_LTO}) diff --git a/src/plugins/intel_gpu/src/runtime/CMakeLists.txt b/src/plugins/intel_gpu/src/runtime/CMakeLists.txt index c442f65575d..47c9139a4f9 100644 --- a/src/plugins/intel_gpu/src/runtime/CMakeLists.txt +++ b/src/plugins/intel_gpu/src/runtime/CMakeLists.txt @@ -44,7 +44,7 @@ target_compile_options(${TARGET_NAME} PRIVATE add_cpplint_target(${TARGET_NAME}_cpplint FOR_TARGETS ${TARGET_NAME}) -set_ie_threading_interface_for(${TARGET_NAME}) +ov_set_threading_interface_for(${TARGET_NAME}) target_link_libraries(${TARGET_NAME} PRIVATE OpenCL::OpenCL diff --git a/src/plugins/intel_gpu/tests/unit/CMakeLists.txt b/src/plugins/intel_gpu/tests/unit/CMakeLists.txt index fd5d039fe87..1cdcbd91c0f 100644 --- a/src/plugins/intel_gpu/tests/unit/CMakeLists.txt +++ b/src/plugins/intel_gpu/tests/unit/CMakeLists.txt @@ -48,7 +48,7 @@ set(SOURCES_ALL add_executable(${TARGET_NAME} ${SOURCES_ALL}) -set_ie_threading_interface_for(${TARGET_NAME}) +ov_set_threading_interface_for(${TARGET_NAME}) # Workaround to avoid warnings during LTO build if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")