OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
[Build] Update compilation options to support DPCPP + Windows config (#26320)
Vladimir Paramuzova5e3c5e8542c
diff --git a/cmake/developer_package/compile_flags/os_flags.cmake b/cmake/developer_package/compile_flags/os_flags.cmakeindex bb80787ee3d..cdb861e6f03 100644--- a/cmake/developer_package/compile_flags/os_flags.cmake+++ b/cmake/developer_package/compile_flags/os_flags.cmake@@ -14,13 +14,13 @@ include(CheckCXXCompilerFlag)macro(ov_disable_deprecated_warnings)if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")set(ov_c_cxx_deprecated "/wd4996")- elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")+ elseif(OV_COMPILER_IS_INTEL_LLVM)if(WIN32)- set(ov_c_cxx_deprecated "/Qdiag-disable:1478,1786")+ set(ov_c_cxx_deprecated "/Wno-deprecated-declarations")else()- set(ov_c_cxx_deprecated "-diag-disable=1478,1786")+ set(ov_c_cxx_deprecated "-Wno-deprecated-declarations")endif()- elseif(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_INTEL_LLVM)+ elseif(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX)set(ov_c_cxx_deprecated "-Wno-deprecated-declarations")else()message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")@@ -42,13 +42,13 @@ macro(ov_deprecated_no_errors)if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")# show 4996 only for /w4set(ov_c_cxx_deprecated_no_errors "/wd4996")- elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")+ elseif(OV_COMPILER_IS_INTEL_LLVM)if(WIN32)- set(ov_c_cxx_deprecated_no_errors "/Qdiag-warning:1478,1786")+ set(ov_c_cxx_deprecated_no_errors "/Wno-error=deprecated-declarations")else()- set(ov_c_cxx_deprecated_no_errors "-diag-warning=1478,1786")+ set(ov_c_cxx_deprecated_no_errors "-Wno-error=deprecated-declarations")endif()- elseif(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_INTEL_LLVM)+ elseif(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX)set(ov_c_cxx_deprecated_no_errors "-Wno-error=deprecated-declarations")# Suppress #warning messagesset(ov_c_cxx_deprecated_no_errors "${ov_c_cxx_deprecated_no_errors} -Wno-cpp")@@ -68,7 +68,7 @@ endmacro()# Exports flags for 3rdparty modules, but without errors#macro(ov_dev_package_no_errors)- if(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_INTEL_LLVM)+ if(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX OR (OV_COMPILER_IS_INTEL_LLVM AND UNIX))set(ov_c_cxx_dev_no_errors "-Wno-all")if(SUGGEST_OVERRIDE_SUPPORTED)set(ov_cxx_dev_no_errors "-Wno-error=suggest-override")@@ -76,7 +76,7 @@ macro(ov_dev_package_no_errors)endif()if(CMAKE_COMPILE_WARNING_AS_ERROR AND WIN32)- if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")+ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" OR OV_COMPILER_IS_INTEL_LLVM)if(CMAKE_VERSION VERSION_LESS 3.24)ov_add_compiler_flags(/WX-)endif()@@ -99,7 +99,7 @@ endmacro()macro(ov_sse42_optimization_flags flags)if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")# No such option for MSVC 2019- elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel" OR OV_COMPILER_IS_INTEL_LLVM)+ elseif(OV_COMPILER_IS_INTEL_LLVM)if(WIN32)set(${flags} /QxSSE4.2)else()@@ -123,13 +123,13 @@ endmacro()macro(ov_avx2_optimization_flags flags)if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")set(${flags} /arch:AVX2)- elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")+ elseif(OV_COMPILER_IS_INTEL_LLVM)if(WIN32)set(${flags} /QxCORE-AVX2)else()set(${flags} -xCORE-AVX2)endif()- elseif(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_INTEL_LLVM)+ elseif(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX)set(${flags} -mavx2 -mfma -mf16c)else()message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")@@ -145,13 +145,9 @@ endmacro()macro(ov_avx512_optimization_flags flags)if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")set(${flags} /arch:AVX512)- elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")- if(WIN32)- set(${flags} /QxCOMMON-AVX512)- else()- set(${flags} -xCOMMON-AVX512)- endif()- elseif(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_INTEL_LLVM)+ elseif(OV_COMPILER_IS_INTEL_LLVM AND WIN32)+ set(${flags} /QxCOMMON-AVX512)+ elseif(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX OR (OV_COMPILER_IS_INTEL_LLVM AND UNIX))set(${flags} -mavx512f -mavx512bw -mavx512vl -mfma -mf16c)else()message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")@@ -162,7 +158,7 @@ endmacro()# ov_arm_neon_optimization_flags(<output flags>)#macro(ov_arm_neon_optimization_flags flags)- if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")+ if(OV_COMPILER_IS_INTEL_LLVM)message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")# nothing to define; works out of box@@ -197,9 +193,9 @@ function(ov_disable_all_warnings)foreach(target IN LISTS ARGN)get_target_property(target_type ${target} TYPE)- if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")+ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" OR (OV_COMPILER_IS_INTEL_LLVM AND WIN32))target_compile_options(${target} PRIVATE /WX-)- elseif(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR OV_COMPILER_IS_INTEL_LLVM)+ elseif(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR (OV_COMPILER_IS_INTEL_LLVM AND UNIX))target_compile_options(${target} PRIVATE -w)# required for LTOset(link_interface INTERFACE_LINK_OPTIONS)@@ -209,11 +205,6 @@ function(ov_disable_all_warnings)if(CMAKE_COMPILER_IS_GNUCXX)set_target_properties(${target} PROPERTIES ${link_interface} "-Wno-error=maybe-uninitialized;-Wno-maybe-uninitialized")endif()- elseif(UNIX AND CMAKE_CXX_COMPILER_ID STREQUAL "Intel")- # 193: zero used for undefined preprocessing identifier "XXX"- # 1011: missing return statement at end of non-void function "XXX"- # 2415: variable "xxx" of static storage duration was declared but never referenced- target_compile_options(${target} PRIVATE -diag-disable=warn,193,1011,2415)endif()endforeach()endfunction()@@ -236,9 +227,9 @@ endmacro()# Forced includes certain header file to all target source files#function(ov_force_include target scope header_file)- if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")+ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" OR (OV_COMPILER_IS_INTEL_LLVM AND WIN32))target_compile_options(${target} ${scope} /FI"${header_file}")- elseif(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_INTEL_LLVM)+ elseif(OV_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_GNUCXX OR (OV_COMPILER_IS_INTEL_LLVM AND UNIX))target_compile_options(${target} ${scope} -include "${header_file}")else()message(WARNING "Unsupported CXX compiler ${CMAKE_CXX_COMPILER_ID}")@@ -318,7 +309,7 @@ set(CMAKE_VISIBILITY_INLINES_HIDDEN ON)if(CMAKE_CL_64)# Default char Type Is unsigned# ov_add_compiler_flags(/J)-elseif(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR OV_COMPILER_IS_INTEL_LLVM)+elseif(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR (OV_COMPILER_IS_INTEL_LLVM AND UNIX))ov_add_compiler_flags(-fsigned-char)endif()@@ -401,40 +392,17 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}")string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")-elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel" AND WIN32)+elseif(OV_COMPILER_IS_INTEL_LLVM AND WIN32)## Warnings as errors#- if(CMAKE_COMPILE_WARNING_AS_ERROR AND CMAKE_VERSION VERSION_LESS 3.24)- ov_add_compiler_flags(/Qdiag-warning:47,1740,1786)- endif()+ ov_add_compiler_flags(/WX)## Disable noisy warnings#-- # 161: unrecognized pragma- ov_add_compiler_flags(/Qdiag-disable:161)- # 177: variable was declared but never referenced- ov_add_compiler_flags(/Qdiag-disable:177)- # 556: not matched type of assigned function pointer- ov_add_compiler_flags(/Qdiag-disable:556)- # 1744: field of class type without a DLL interface used in a class with a DLL interface- ov_add_compiler_flags(/Qdiag-disable:1744)- # 1879: unimplemented pragma ignored- ov_add_compiler_flags(/Qdiag-disable:1879)- # 2586: decorated name length exceeded, name was truncated- ov_add_compiler_flags(/Qdiag-disable:2586)- # 2651: attribute does not apply to any entity- ov_add_compiler_flags(/Qdiag-disable:2651)- # 3180: unrecognized OpenMP pragma- ov_add_compiler_flags(/Qdiag-disable:3180)- # 11075: To get full report use -Qopt-report:4 -Qopt-report-phase ipo- ov_add_compiler_flags(/Qdiag-disable:11075)- # 15335: was not vectorized: vectorization possible but seems inefficient.- # Use vector always directive or /Qvec-threshold0 to override- ov_add_compiler_flags(/Qdiag-disable:15335)+ ov_disable_deprecated_warnings()else()## Common enabled warnings@@ -454,7 +422,7 @@ else()# - https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html# - https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.htmlif((CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8) OR- (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10) OR OV_COMPILER_IS_INTEL_LLVM)+ (OV_COMPILER_IS_CLANG AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10) OR OV_COMPILER_IS_INTEL_LLVM)# Enable __FILE__ trim only for release modeset(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ffile-prefix-map=${OV_NATIVE_PROJECT_ROOT_DIR}/= -ffile-prefix-map=${OV_RELATIVE_BIN_PATH}/=")set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffile-prefix-map=${OV_NATIVE_PROJECT_ROOT_DIR}/= -ffile-prefix-map=${OV_RELATIVE_BIN_PATH}/=")@@ -472,13 +440,9 @@ else()# Disable noisy warnings#- if(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")- # 177: function "XXX" was declared but never referenced- ov_add_compiler_flags(-diag-disable=remark,177,2196)- endif()-if(OV_COMPILER_IS_INTEL_LLVM)ov_add_compiler_flags(-Wno-tautological-constant-compare)+ ov_disable_deprecated_warnings()endif()#diff --git a/cmake/developer_package/compile_flags/sdl.cmake b/cmake/developer_package/compile_flags/sdl.cmakeindex 4bc0edd33c4..34ad5904519 100644--- a/cmake/developer_package/compile_flags/sdl.cmake+++ b/cmake/developer_package/compile_flags/sdl.cmake@@ -2,8 +2,7 @@# SPDX-License-Identifier: Apache-2.0#-if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR OV_COMPILER_IS_INTEL_LLVM OR- (UNIX AND CMAKE_CXX_COMPILER_ID STREQUAL "Intel"))+if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR (UNIX AND OV_COMPILER_IS_INTEL_LLVM))set(OV_C_CXX_FLAGS "${OV_C_CXX_FLAGS} -Wformat -Wformat-security")if (NOT ENABLE_SANITIZER)@@ -32,21 +31,18 @@ if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR OV_COMPILER_IS_INTEL_LLVMif(NOT MINGW AND NOT APPLE)set(OV_LINKER_FLAGS "${OV_LINKER_FLAGS} -z noexecstack -z relro -z now")endif()- elseif(OV_COMPILER_IS_CLANG OR OV_COMPILER_IS_INTEL_LLVM)+ elseif(OV_COMPILER_IS_CLANG)if(EMSCRIPTEN)- # emcc does not support fortification+ # emcc does not support fortification# https://stackoverflow.com/questions/58854858/undefined-symbol-stack-chk-guard-in-libopenh264-so-when-building-ffmpeg-witelse()set(OV_C_CXX_FLAGS "${OV_C_CXX_FLAGS} -fstack-protector-all")endif()- elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")- if (NOT ENABLE_SANITIZER)- set(OV_C_CXX_FLAGS "${OV_C_CXX_FLAGS} -Wl,--strip-all")- endif()+ elseif(OV_COMPILER_IS_INTEL_LLVM)set(OV_C_CXX_FLAGS "${OV_C_CXX_FLAGS} -fstack-protector-strong")set(OV_LINKER_FLAGS "${OV_LINKER_FLAGS} -z noexecstack -z relro -z now")endif()-elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")+elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" OR (OV_COMPILER_IS_INTEL_LLVM AND WIN32))set(OV_C_CXX_FLAGS "${OV_C_CXX_FLAGS} /sdl /guard:cf")set(OV_LINKER_FLAGS "${OV_LINKER_FLAGS} /guard:cf")endif()diff --git a/cmake/developer_package/cross_compile/native_compile.cmake b/cmake/developer_package/cross_compile/native_compile.cmakeindex 2055e617342..b580234d267 100644--- a/cmake/developer_package/cross_compile/native_compile.cmake+++ b/cmake/developer_package/cross_compile/native_compile.cmake@@ -62,7 +62,7 @@ function(ov_native_compile_external_project)endif()# compile flags- if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR OV_COMPILER_IS_INTEL_LLVM)+ if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR (OV_COMPILER_IS_INTEL_LLVM AND UNIX))set(compile_flags "-Wno-undef -Wno-error -Wno-deprecated-declarations")endif()diff --git a/cmake/developer_package/frontends/frontends.cmake b/cmake/developer_package/frontends/frontends.cmakeindex 87efaea0ceb..876d3f334a2 100644--- a/cmake/developer_package/frontends/frontends.cmake+++ b/cmake/developer_package/frontends/frontends.cmake@@ -212,7 +212,7 @@ macro(ov_add_frontend)endif()# remove -Wmissing-declarations warning, because of frontends implementation specific- if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR OV_COMPILER_IS_INTEL_LLVM)+ if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR (OV_COMPILER_IS_INTEL_LLVM AND UNIX))target_compile_options(${TARGET_NAME} PRIVATE -Wno-missing-declarations)endif()diff --git a/samples/cpp/CMakeLists.txt b/samples/cpp/CMakeLists.txtindex fe6c6c2109c..c3a01fe41f8 100644--- a/samples/cpp/CMakeLists.txt+++ b/samples/cpp/CMakeLists.txt@@ -76,12 +76,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")# disable some noisy warningsset (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4251 /wd4275 /wd4267 /wd4819")-elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")- if(WIN32)- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Qdiag-disable:177")- else()- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -diag-disable:177")- endif()endif()if(APPLE)diff --git a/src/CMakeLists.txt b/src/CMakeLists.txtindex 288e297411a..210a653862d 100644--- a/src/CMakeLists.txt+++ b/src/CMakeLists.txt@@ -8,6 +8,10 @@ if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG)ov_add_compiler_flags(-Wmissing-declarations)endif()+if(OV_COMPILER_IS_INTEL_LLVM)+ ov_disable_deprecated_warnings()+endif()+include(cmake/install_tbb.cmake)# CC library should be registered before other cc targetsdiff --git a/src/plugins/intel_cpu/thirdparty/CMakeLists.txt b/src/plugins/intel_cpu/thirdparty/CMakeLists.txtindex 6f5f7a93e93..8ba38985d59 100644--- a/src/plugins/intel_cpu/thirdparty/CMakeLists.txt+++ b/src/plugins/intel_cpu/thirdparty/CMakeLists.txt@@ -90,7 +90,7 @@ function(ov_add_onednn)link_libraries(TBB::tbb)endif()- if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR OV_COMPILER_IS_INTEL_LLVM)+ if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR (OV_COMPILER_IS_INTEL_LLVM AND UNIX))ov_add_compiler_flags(-Wno-error)ov_add_compiler_flags(-Wno-undef)ov_add_compiler_flags(-Wno-missing-declarations)@@ -109,8 +109,6 @@ function(ov_add_onednn)ov_add_compiler_flags(-Wno-deprecated-this-capture)ov_add_compiler_flags(-Wno-deprecated-enum-enum-conversion)endif()- elseif(UNIX AND CMAKE_CXX_COMPILER_ID STREQUAL "Intel")- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -diag-disable=10121")elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")# C4849 OpenMP 'reduction' clause ignored in 'simd' directiveov_add_compiler_flags(/wd4849)diff --git a/src/plugins/intel_gpu/CMakeLists.txt b/src/plugins/intel_gpu/CMakeLists.txtindex 795d259b277..f07a1bfbd23 100644--- a/src/plugins/intel_gpu/CMakeLists.txt+++ b/src/plugins/intel_gpu/CMakeLists.txt@@ -9,7 +9,17 @@ endif()set (TARGET_NAME "openvino_intel_gpu_plugin")if(OV_COMPILER_IS_INTEL_LLVM)+ # For windows we need to disable warning as error option to make FindSYCL.cmake work+ if (WIN32)+ ov_add_compiler_flags(/WX-)+ endif()+find_package(IntelSYCL REQUIRED)++ if (WIN32)+ ov_add_compiler_flags(/WX)+ ov_add_compiler_flags(/Wno-ignored-attributes)+ endif()endif()if((CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG) AND CMAKE_CXX_STANDARD GREATER_EQUAL 20)diff --git a/src/plugins/intel_gpu/src/graph/impls/sycl/impl_example.cpp b/src/plugins/intel_gpu/src/graph/impls/sycl/impl_example.cppindex b918182a60c..4f118b36a8f 100644--- a/src/plugins/intel_gpu/src/graph/impls/sycl/impl_example.cpp+++ b/src/plugins/intel_gpu/src/graph/impls/sycl/impl_example.cpp@@ -58,18 +58,18 @@ template<typename AType, typename WType, typename ZPType, typename ScaleType, tyfloat dzp_value = dzp_s.value_or(0.0f);return queue.submit([=](::sycl::handler& cgh) {cgh.parallel_for(::sycl::range<3>(out_shape[0], out_shape[1], out_shape[2]), [=](::sycl::id<3> index) {- const uint b = index[0];- const uint m = index[1];- const uint n = index[2];+ const uint32_t b = index[0];+ const uint32_t m = index[1];+ const uint32_t n = index[2];using accum_t = typename AccumulatorType<AType, WType>::type;accum_t accumulator = 0.0f;- const uint dst_index = n + m*N + b*N*M;- for (uint y = 0; y < K; ++y) {- const uint input0_offset = y + m*K + b*M*K;- const uint decomp_offset = (y / group_size % groups_num)*N + n % N;- const uint filter_offset = y + n*K;- const uint zp_offset = 0;+ const uint32_t dst_index = n + m*N + b*N*M;+ for (uint32_t y = 0; y < K; ++y) {+ const uint32_t input0_offset = y + m*K + b*M*K;+ const uint32_t decomp_offset = (y / group_size % groups_num)*N + n % N;+ const uint32_t filter_offset = y + n*K;+ const uint32_t zp_offset = 0;accum_t zp_val = has_value ? static_cast<accum_t>(dzp_value) : static_cast<accum_t>(zp[zp_offset]);@@ -102,17 +102,17 @@ template<typename AType, typename WType, typename ZPType, typename ScaleType, tyreturn queue.submit([=](::sycl::handler& cgh) {cgh.parallel_for(::sycl::range<3>(out_shape[0], out_shape[1], out_shape[2]), [=](::sycl::id<3> index) {- const uint b = index[0];- const uint m = index[1];- const uint n = index[2];+ const uint32_t b = index[0];+ const uint32_t m = index[1];+ const uint32_t n = index[2];using accum_t = typename AccumulatorType<AType, WType>::type;accum_t accumulator = 0.0f;- for (uint y = 0; y < K; ++y) {- const uint input0_offset = y + m*K + b*M*K;- const uint zp_offset = (y / group_size % groups_num)*N + n % N;- const uint decomp_offset = (y / group_size % groups_num)*N + n % N;- const uint filter_offset = y + n*K;+ for (uint32_t y = 0; y < K; ++y) {+ const uint32_t input0_offset = y + m*K + b*M*K;+ const uint32_t zp_offset = (y / group_size % groups_num)*N + n % N;+ const uint32_t decomp_offset = (y / group_size % groups_num)*N + n % N;+ const uint32_t filter_offset = y + n*K;accum_t zp_val = has_value ? static_cast<accum_t>(dzp_value) : static_cast<accum_t>(zp[zp_offset]);accum_t scale = s[decomp_offset];@@ -120,7 +120,7 @@ template<typename AType, typename WType, typename ZPType, typename ScaleType, tyaccum_t filter_val = (filter_compressed - zp_val) * scale;accumulator += a[input0_offset] * filter_val;}- const uint dst_index = n + m*N + b*N*M;+ const uint32_t dst_index = n + m*N + b*N*M;dst[dst_index] = accumulator;});});diff --git a/src/plugins/intel_gpu/tests/unit/CMakeLists.txt b/src/plugins/intel_gpu/tests/unit/CMakeLists.txtindex 2c7a4b12735..caa7f3b0064 100644--- a/src/plugins/intel_gpu/tests/unit/CMakeLists.txt+++ b/src/plugins/intel_gpu/tests/unit/CMakeLists.txt@@ -11,7 +11,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")ov_add_compiler_flags(/wd4305)endif()-if(OV_COMPILER_IS_INTEL_LLVM)+if(OV_COMPILER_IS_INTEL_LLVM AND UNIX)set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=lld")string(REPLACE "-pie" "" CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")endif()diff --git a/src/plugins/intel_gpu/thirdparty/CMakeLists.txt b/src/plugins/intel_gpu/thirdparty/CMakeLists.txtindex 3f0a4d60a9d..d54ccd4e4e6 100644--- a/src/plugins/intel_gpu/thirdparty/CMakeLists.txt+++ b/src/plugins/intel_gpu/thirdparty/CMakeLists.txt@@ -30,7 +30,7 @@ if(ENABLE_ONEDNN_FOR_GPU)message(WARNING "Intel GPU plugin unsupported architecture: ${CMAKE_SYSTEM_PROCESSOR}")endif()- if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR OV_COMPILER_IS_INTEL_LLVM)+ if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR (OV_COMPILER_IS_INTEL_LLVM AND UNIX))ov_add_compiler_flags(-Wno-undef)ov_add_compiler_flags(-Wno-missing-declarations)if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11 AND CMAKE_COMPILER_IS_GNUCXX)diff --git a/src/plugins/intel_npu/thirdparty/CMakeLists.txt b/src/plugins/intel_npu/thirdparty/CMakeLists.txtindex a2e2b30f1c1..c2edf548c29 100644--- a/src/plugins/intel_npu/thirdparty/CMakeLists.txt+++ b/src/plugins/intel_npu/thirdparty/CMakeLists.txt@@ -31,4 +31,7 @@ if(ENABLE_ZEROAPI_BACKEND)endif()set(CMAKE_COMPILE_WARNING_AS_ERROR OFF)add_subdirectory(level-zero EXCLUDE_FROM_ALL)++ # This VERSION file created by L0 may cause compilation issue of oneTBB headers, so remove it+ file(REMOVE "${CMAKE_BINARY_DIR}/VERSION")endif()diff --git a/thirdparty/dependencies.cmake b/thirdparty/dependencies.cmakeindex 9d7b16aeb8b..e8f28deb539 100644--- a/thirdparty/dependencies.cmake+++ b/thirdparty/dependencies.cmake@@ -358,7 +358,7 @@ if(ENABLE_OV_PADDLE_FRONTEND OR ENABLE_OV_ONNX_FRONTEND OR ENABLE_OV_TF_FRONTENDif(ENABLE_SYSTEM_PROTOBUF)set(link_type INTERFACE)endif()- if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR OV_COMPILER_IS_INTEL_LLVM)+ if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR (OV_COMPILER_IS_INTEL_LLVM AND UNIX))get_target_property(original_name ${target_name} ALIASED_TARGET)if(TARGET ${original_name})# during build protobuf's cmake creates aliased targets@@ -452,11 +452,13 @@ if(ENABLE_SNAPPY_COMPRESSION)ov_add_compiler_flags(/wd4245)# 'var' : conversion from 'size_t' to 'type', possible loss of dataov_add_compiler_flags(/wd4267)- elseif(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR OV_COMPILER_IS_INTEL_LLVM)+ elseif(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR (OV_COMPILER_IS_INTEL_LLVM AND UNIX))# we need to pass -Wextra first, then -Wno-sign-compare# otherwise, snappy's CMakeLists.txt will do it for usov_add_compiler_flags(-Wextra)ov_add_compiler_flags(-Wno-sign-compare)+ elseif(OV_COMPILER_IS_INTEL_LLVM AND WIN32)+ ov_add_compiler_flags(/WX-)endif()add_subdirectory(thirdparty/snappy EXCLUDE_FROM_ALL)diff --git a/thirdparty/gtest/CMakeLists.txt b/thirdparty/gtest/CMakeLists.txtindex 5323e677fcd..081f17f7eb6 100644--- a/thirdparty/gtest/CMakeLists.txt+++ b/thirdparty/gtest/CMakeLists.txt@@ -45,7 +45,7 @@ foreach(target gtest gtest_main gmock gmock_main)string(REPLACE "-Zi" " " _target_cxx_flags ${_target_cxx_flags})set_target_properties(${target} PROPERTIES COMPILE_FLAGS "${_target_cxx_flags}")endif()- elseif(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR CMAKE_CXX_COMPILER_ID STREQUAL "Intel")+ elseif(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR (OV_COMPILER_IS_INTEL_LLVM AND UNIX))target_compile_options(${target} PRIVATE -Wno-undef)if(CMAKE_COMPILER_IS_GNUCXX)target_compile_options(${target} PRIVATE -Wno-deprecated-copy)diff --git a/thirdparty/ocl/CMakeLists.txt b/thirdparty/ocl/CMakeLists.txtindex 95c6eb072c7..39141d7be1f 100644--- a/thirdparty/ocl/CMakeLists.txt+++ b/thirdparty/ocl/CMakeLists.txt@@ -34,6 +34,15 @@ if(NOT DEFINED USE_DYNAMIC_VCXX_RUNTIME)set(USE_DYNAMIC_VCXX_RUNTIME ON)endif()+#+# Suppress warnings+#+if(OV_COMPILER_IS_INTEL_LLVM AND WIN32)+ ov_add_compiler_flags("/Wno-macro-redefined")+ ov_add_compiler_flags("/Wno-nonportable-include-path")+ ov_add_compiler_flags("/Wno-comment")+endif()+## Build OpenCL ICD loader#diff --git a/thirdparty/protobuf/CMakeLists.txt b/thirdparty/protobuf/CMakeLists.txtindex 7e178deaae4..9f10f647f02 100644--- a/thirdparty/protobuf/CMakeLists.txt+++ b/thirdparty/protobuf/CMakeLists.txt@@ -8,7 +8,7 @@set(BUILD_SHARED_LIBS OFF)-if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR OV_COMPILER_IS_INTEL_LLVM)+if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR (OV_COMPILER_IS_INTEL_LLVM AND UNIX))ov_add_compiler_flags(-Wno-all)if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 11 AND CMAKE_COMPILER_IS_GNUCXX)ov_add_compiler_flags(-Wno-stringop-overflow)@@ -56,8 +56,7 @@ set(Protobuf_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/protobuf/src)# to hide libprotobuf warningstarget_include_directories(libprotobuf-lite SYSTEM PRIVATE "${Protobuf_INCLUDE_DIRS}")-if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR- CMAKE_CXX_COMPILER_ID STREQUAL "Intel")+if(CMAKE_COMPILER_IS_GNUCXX OR OV_COMPILER_IS_CLANG OR OV_COMPILER_IS_INTEL_LLVM)if(protobuf_BUILD_PROTOC_BINARIES)list(APPEND _protoc_libs protoc libprotoc libprotobuf)set_target_properties(${_protoc_libs} PROPERTIESdiff --git a/thirdparty/zlib/CMakeLists.txt b/thirdparty/zlib/CMakeLists.txtindex bf3d810e923..908c82b954b 100644--- a/thirdparty/zlib/CMakeLists.txt+++ b/thirdparty/zlib/CMakeLists.txt@@ -9,10 +9,6 @@ if(CMAKE_C_COMPILER_ID STREQUAL "MSVC")set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /wd4995 /wd4244 /wd4996")else()set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-all")- if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")- #266: function "XXX" declared implicitly- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -diag-disable=266")- endif()if(CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$")include(CheckCCompilerFlag)check_c_compiler_flag("-Wdeprecated-non-prototype" DEPRECATED_NO_PROTOTYPE)