From 98225681948e90137ef1a03e7550041a1e2f22c8 Mon Sep 17 00:00:00 2001 From: Taylor Yeonbok Lee Date: Fri, 24 Feb 2023 18:48:12 -0800 Subject: [PATCH 1/3] Fix build error in clang++ (#15948) --- src/plugins/intel_gpu/src/graph/impls/ocl/primitive_base.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/primitive_base.hpp b/src/plugins/intel_gpu/src/graph/impls/ocl/primitive_base.hpp index bbe4368485d07b..10c1ee1cf40b3f 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/primitive_base.hpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/primitive_base.hpp @@ -277,7 +277,7 @@ struct typed_primitive_impl_ocl : public typed_primitive_impl { } } - void set_kernels(std::map& kernels) { + void set_kernels(std::map& kernels) override { if (is_cpu()) return; From bd8c7506f05794f868698e953eca8633302e8890 Mon Sep 17 00:00:00 2001 From: Artyom Anokhov Date: Sat, 25 Feb 2023 11:54:50 +0100 Subject: [PATCH 2/3] requirements-dev: top-limited setuptools with 65.7.0 (#15946) --- src/bindings/python/wheel/requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bindings/python/wheel/requirements-dev.txt b/src/bindings/python/wheel/requirements-dev.txt index 780102df1548f8..2ac9ed6f6dca1b 100644 --- a/src/bindings/python/wheel/requirements-dev.txt +++ b/src/bindings/python/wheel/requirements-dev.txt @@ -1,3 +1,3 @@ -setuptools>=53.0.0 +setuptools>=53.0.0,<=65.7.0 wheel>=0.38.1 patchelf; sys_platform == 'linux' and platform_machine == 'x86_64' From c0ef9a862e5cb440760b6fea2e0b1bf69b2c9ee7 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Sat, 25 Feb 2023 16:33:08 +0400 Subject: [PATCH 3/3] Fix for apiValidator when more than 1 target needs to be checked (#15950) --- .../api_validator/api_validator.cmake | 86 ++++++++++++------- .../api_validator/api_validator_run.cmake | 30 +++---- .../intel_gna/cmake/libGNAConfig.cmake | 46 +++++++--- 3 files changed, 104 insertions(+), 58 deletions(-) diff --git a/cmake/developer_package/api_validator/api_validator.cmake b/cmake/developer_package/api_validator/api_validator.cmake index 929f9fdbda46a5..fe3683ca9affb6 100644 --- a/cmake/developer_package/api_validator/api_validator.cmake +++ b/cmake/developer_package/api_validator/api_validator.cmake @@ -5,16 +5,22 @@ if(WIN32) set(PROGRAMFILES_ENV "ProgramFiles(X86)") file(TO_CMAKE_PATH $ENV{${PROGRAMFILES_ENV}} PROGRAMFILES) - set(UWP_SDK_PATH "${PROGRAMFILES}/Windows Kits/10/bin/${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}/x64") - message(STATUS "Trying to find apivalidator in: ${UWP_SDK_PATH}") - find_host_program(UWP_API_VALIDATOR + set(WDK_PATHS "${PROGRAMFILES}/Windows Kits/10/bin/${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}/x64" + "${PROGRAMFILES}/Windows Kits/10/bin/x64") + + message(STATUS "Trying to find apivalidator in: ") + foreach(wdk_path IN LISTS WDK_PATHS) + message(" * ${wdk_path}") + endforeach() + + find_host_program(ONECORE_API_VALIDATOR NAMES apivalidator - PATHS "${UWP_SDK_PATH}" - DOC "ApiValidator for UWP compliance") + PATHS ${WDK_PATHS} + DOC "ApiValidator for OneCore compliance") - if(UWP_API_VALIDATOR) - message(STATUS "Found apivalidator: ${UWP_API_VALIDATOR}") + if(ONECORE_API_VALIDATOR) + message(STATUS "Found apivalidator: ${ONECORE_API_VALIDATOR}") endif() endif() @@ -51,10 +57,15 @@ endfunction() set(VALIDATED_TARGETS "" CACHE INTERNAL "") function(_ov_add_api_validator_post_build_step) - set(UWP_API_VALIDATOR_APIS "${PROGRAMFILES}/Windows Kits/10/build/universalDDIs/x64/UniversalDDIs.xml") - set(UWP_API_VALIDATOR_EXCLUSION "${UWP_SDK_PATH}/BinaryExclusionlist.xml") - - if((NOT UWP_API_VALIDATOR) OR (WINDOWS_STORE OR WINDOWS_PHONE)) + find_file(ONECORE_API_VALIDATOR_APIS NAMES UniversalDDIs.xml + PATHS "${PROGRAMFILES}/Windows Kits/10/build/${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}/universalDDIs/x64" + "${PROGRAMFILES}/Windows Kits/10/build/universalDDIs/x64" + DOC "Path to UniversalDDIs.xml file") + find_file(ONECORE_API_VALIDATOR_EXCLUSION NAMES BinaryExclusionlist.xml + PATHS ${WDK_PATHS} + DOC "Path to BinaryExclusionlist.xml file") + + if((NOT ONECORE_API_VALIDATOR) OR (WINDOWS_STORE OR WINDOWS_PHONE)) return() endif() @@ -84,11 +95,18 @@ function(_ov_add_api_validator_post_build_step) # apply check macro(api_validator_get_target_name) - get_target_property(IS_IMPORTED ${target} IMPORTED) + get_target_property(is_imported ${target} IMPORTED) get_target_property(orig_target ${target} ALIASED_TARGET) - if(IS_IMPORTED) - get_target_property(target_location ${target} LOCATION) - get_filename_component(target_name "${target_location}" NAME_WE) + if(is_imported) + get_target_property(imported_configs ${target} IMPORTED_CONFIGURATIONS) + foreach(imported_config RELEASE RELWITHDEBINFO DEBUG) + if(imported_config IN_LIST imported_configs) + get_target_property(target_location ${target} IMPORTED_LOCATION_${imported_config}) + get_filename_component(target_name "${target_location}" NAME_WE) + break() + endif() + endforeach() + unset(imported_configs) elseif(TARGET "${orig_target}") set(target_name ${orig_target}) set(target_location $) @@ -96,30 +114,40 @@ function(_ov_add_api_validator_post_build_step) set(target_name ${target}) set(target_location $) endif() + + unset(orig_target) + unset(is_imported) endmacro() foreach(target IN LISTS API_VALIDATOR_TARGETS) api_validator_get_target_name() - if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.21 AND OV_GENERATOR_MULTI_CONFIG) - set(output_file "${CMAKE_BINARY_DIR}/api_validator/$/${target_name}.txt") + if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.20 AND OV_GENERATOR_MULTI_CONFIG) + set(output_file "${OpenVINO_BINARY_DIR}/api_validator/$/${target_name}.txt") else() - set(output_file "${CMAKE_BINARY_DIR}/api_validator/${target_name}.txt") + set(output_file "${OpenVINO_BINARY_DIR}/api_validator/${target_name}.txt") endif() - add_custom_command(TARGET ${API_VALIDATOR_TARGET} POST_BUILD - COMMAND ${CMAKE_COMMAND} --config $ - -D UWP_API_VALIDATOR=${UWP_API_VALIDATOR} - -D UWP_API_VALIDATOR_TARGET=${target_location} - -D UWP_API_VALIDATOR_APIS=${UWP_API_VALIDATOR_APIS} - -D UWP_API_VALIDATOR_EXCLUSION=${UWP_API_VALIDATOR_EXCLUSION} - -D UWP_API_VALIDATOR_OUTPUT=${output_file} + list(APPEND post_build_commands + ${CMAKE_COMMAND} --config $ + -D ONECORE_API_VALIDATOR=${ONECORE_API_VALIDATOR} + -D ONECORE_API_VALIDATOR_TARGET=${target_location} + -D ONECORE_API_VALIDATOR_APIS=${ONECORE_API_VALIDATOR_APIS} + -D ONECORE_API_VALIDATOR_EXCLUSION=${ONECORE_API_VALIDATOR_EXCLUSION} + -D ONECORE_API_VALIDATOR_OUTPUT=${output_file} -D CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} - -P "${IEDevScripts_DIR}/api_validator/api_validator_run.cmake" - BYPRODUCTS ${output_file} - COMMENT "[apiValidator] Check ${target_name} for OneCore compliance" - VERBATIM) + -P "${IEDevScripts_DIR}/api_validator/api_validator_run.cmake") + list(APPEND byproducts_files ${output_file}) + + unset(target_name) + unset(target_location) endforeach() + add_custom_command(TARGET ${API_VALIDATOR_TARGET} POST_BUILD + COMMAND ${post_build_commands} + BYPRODUCTS ${byproducts_files} + COMMENT "[apiValidator] Check ${API_VALIDATOR_TARGET} and dependencies for OneCore compliance" + VERBATIM) + # update list of validated libraries list(APPEND VALIDATED_TARGETS ${API_VALIDATOR_TARGETS}) diff --git a/cmake/developer_package/api_validator/api_validator_run.cmake b/cmake/developer_package/api_validator/api_validator_run.cmake index 3781e17c1ed3ac..998c354118d4eb 100644 --- a/cmake/developer_package/api_validator/api_validator_run.cmake +++ b/cmake/developer_package/api_validator/api_validator_run.cmake @@ -4,9 +4,9 @@ cmake_policy(SET CMP0012 NEW) -foreach(var UWP_API_VALIDATOR UWP_API_VALIDATOR_TARGET - UWP_API_VALIDATOR_APIS UWP_API_VALIDATOR_EXCLUSION - UWP_API_VALIDATOR_OUTPUT CMAKE_TOOLCHAIN_FILE) +foreach(var ONECORE_API_VALIDATOR ONECORE_API_VALIDATOR_TARGET + ONECORE_API_VALIDATOR_APIS ONECORE_API_VALIDATOR_EXCLUSION + ONECORE_API_VALIDATOR_OUTPUT CMAKE_TOOLCHAIN_FILE) if(NOT DEFINED ${var}) message(FATAL_ERROR "Variable ${var} is not defined") endif() @@ -14,18 +14,18 @@ endforeach() # create command -if(NOT EXISTS "${UWP_API_VALIDATOR_APIS}") - message(FATAL_ERROR "${UWP_API_VALIDATOR_APIS} does not exist") +if(NOT EXISTS "${ONECORE_API_VALIDATOR_APIS}") + message(FATAL_ERROR "${ONECORE_API_VALIDATOR_APIS} does not exist") endif() -set(command "${UWP_API_VALIDATOR}" - -SupportedApiXmlFiles:${UWP_API_VALIDATOR_APIS} - -DriverPackagePath:${UWP_API_VALIDATOR_TARGET}) -if(EXISTS "${UWP_API_VALIDATOR_EXCLUSION}") +set(command "${ONECORE_API_VALIDATOR}" + -SupportedApiXmlFiles:${ONECORE_API_VALIDATOR_APIS} + -DriverPackagePath:${ONECORE_API_VALIDATOR_TARGET}) +if(EXISTS "${ONECORE_API_VALIDATOR_EXCLUSION}") list(APPEND command - -BinaryExclusionListXmlFile:${UWP_API_VALIDATOR_EXCLUSION} + -BinaryExclusionListXmlFile:${ONECORE_API_VALIDATOR_EXCLUSION} -StrictCompliance:TRUE) - set(UWP_HAS_BINARY_EXCLUSION ON) + set(ONECORE_HAS_BINARY_EXCLUSION ON) endif() # execute @@ -36,13 +36,13 @@ execute_process(COMMAND ${command} RESULT_VARIABLE exit_code OUTPUT_STRIP_TRAILING_WHITESPACE) -file(WRITE "${UWP_API_VALIDATOR_OUTPUT}" "${output_message}\n\n\n${error_message}") +file(WRITE "${ONECORE_API_VALIDATOR_OUTPUT}" "CMAKE COMMAND: ${command}\n\n\n${output_message}\n\n\n${error_message}") # post-process output -get_filename_component(name "${UWP_API_VALIDATOR_TARGET}" NAME) +get_filename_component(name "${ONECORE_API_VALIDATOR_TARGET}" NAME) -if(NOT UWP_HAS_BINARY_EXCLUSION) +if(NOT ONECORE_HAS_BINARY_EXCLUSION) if(CMAKE_TOOLCHAIN_FILE MATCHES "onecoreuap.toolchain.cmake$") # empty since we compile with static MSVC runtime else() @@ -66,7 +66,7 @@ endif() # write output -if(UWP_HAS_BINARY_EXCLUSION AND NOT exit_code EQUAL 0) +if(ONECORE_HAS_BINARY_EXCLUSION AND NOT exit_code EQUAL 0) message(FATAL_ERROR "${error_message}") endif() diff --git a/src/plugins/intel_gna/cmake/libGNAConfig.cmake b/src/plugins/intel_gna/cmake/libGNAConfig.cmake index 2daac435defcae..0b53d5be514eeb 100644 --- a/src/plugins/intel_gna/cmake/libGNAConfig.cmake +++ b/src/plugins/intel_gna/cmake/libGNAConfig.cmake @@ -2,8 +2,25 @@ # SPDX-License-Identifier: Apache-2.0 # -# module to locate GNA libraries - +# +# The module defines several imported targets: +# +# - (Optional) libGNA::API +# - (Optional) libGNA::KERNEL +# +# And high-level imported interface target: +# +# - libGNA +# +# And the following variables: +# +# - libGNA_API_FOUND +# - libGNA_KERNEL_FOUND +# +# The example usage: +# +# find_package(libGNA COMPONENTS API KERNEL) +# set(libGNA_FOUND TRUE) @@ -27,7 +44,17 @@ if(libGNA_FIND_REQUIRED_KERNEL) if(GNA_KERNEL_LIBRARY) add_library(libGNA::KERNEL SHARED IMPORTED) - set_target_properties(libGNA::KERNEL PROPERTIES IMPORTED_LOCATION ${GNA_KERNEL_LIBRARY}) + set_property(TARGET libGNA::KERNEL APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) + if(WIN32) + set(gna_dll "${CMAKE_SHARED_LIBRARY_PREFIX}${GNA_KERNEL_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}") + set_target_properties(libGNA::KERNEL PROPERTIES + IMPORTED_LOCATION_RELEASE "${libGNA_LIBRARIES_BASE_PATH}/${gna_dll}" + IMPORTED_IMPLIB_RELEASE "${GNA_KERNEL_LIBRARY}") + else() + set_target_properties(libGNA::KERNEL PROPERTIES + IMPORTED_LOCATION_RELEASE "${GNA_KERNEL_LIBRARY}" + INTERFACE_LINK_OPTIONS "-Wl,-rpath-link,${libGNA_LIBRARIES_BASE_PATH}") + endif() set(libGNA_KERNEL_FOUND TRUE) else() message(SEND_ERROR "GNA KERNEL library (${GNA_KERNEL_LIB_NAME}) was not found in ${libGNA_LIBRARIES_BASE_PATH}") @@ -40,7 +67,7 @@ if(libGNA_FIND_REQUIRED_API) NO_CMAKE_FIND_ROOT_PATH) if(libGNA_INCLUDE_DIRS) add_library(libGNA::API INTERFACE IMPORTED) - set_target_properties(libGNA::API PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${libGNA_INCLUDE_DIRS}) + set_target_properties(libGNA::API PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${libGNA_INCLUDE_DIRS}") set(libGNA_API_FOUND TRUE) else() message(SEND_ERROR "GNA API headers (gna2-api.h) was not found in ${GNA_EXT_DIR}/include") @@ -48,15 +75,6 @@ if(libGNA_FIND_REQUIRED_API) endif() add_library(libGNA INTERFACE IMPORTED) -foreach(_lib_name ${libGNA_FIND_COMPONENTS}) +foreach(_lib_name IN LISTS libGNA_FIND_COMPONENTS) set_property(TARGET libGNA APPEND PROPERTY INTERFACE_LINK_LIBRARIES libGNA::${_lib_name}) endforeach(_lib_name) - -if (WIN32) - if(libGNA_FIND_REQUIRED_KERNEL) - set_target_properties(libGNA::KERNEL PROPERTIES - IMPORTED_IMPLIB ${GNA_KERNEL_LIBRARY}) - endif() -else() - set_target_properties(libGNA PROPERTIES INTERFACE_LINK_OPTIONS "-Wl,-rpath-link,${libGNA_LIBRARIES_BASE_PATH}") -endif ()