From db395155b31b1d19408da32b0f47475815e5ec91 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Fri, 15 Sep 2023 06:53:32 +0400 Subject: [PATCH] Removed warnings suppressions for extra modukes (#16479) --- cmake/developer_package/frontends/frontends.cmake | 2 +- cmake/extra_modules.cmake | 6 ------ src/inference/tests/functional/CMakeLists.txt | 8 ++++---- src/inference/tests/unit/CMakeLists.txt | 9 ++++----- src/plugins/intel_cpu/CMakeLists.txt | 1 + src/plugins/intel_gpu/src/graph/broadcast.cpp | 5 ++++- src/plugins/intel_gpu/src/graph/dft.cpp | 8 +++++++- .../src/graph/impls/onednn/reorder_onednn.cpp | 5 +++-- .../tests/functional/op_reference/reorg_yolo.cpp | 10 ++++++++++ 9 files changed, 34 insertions(+), 20 deletions(-) diff --git a/cmake/developer_package/frontends/frontends.cmake b/cmake/developer_package/frontends/frontends.cmake index c772ed706b7..964dc6da443 100644 --- a/cmake/developer_package/frontends/frontends.cmake +++ b/cmake/developer_package/frontends/frontends.cmake @@ -228,7 +228,7 @@ macro(ov_add_frontend) # protobuf generated code emits -Wsuggest-override error if(SUGGEST_OVERRIDE_SUPPORTED) - target_compile_options(${TARGET_NAME} PRIVATE -Wno-suggest-override) + target_compile_options(${TARGET_NAME} PRIVATE $<$:-Wno-suggest-override>) endif() # install protobuf if it is not installed yet diff --git a/cmake/extra_modules.cmake b/cmake/extra_modules.cmake index c0a5e2288f5..afc1dc335b3 100644 --- a/cmake/extra_modules.cmake +++ b/cmake/extra_modules.cmake @@ -132,12 +132,6 @@ endif()\n") ov_dev_package_no_errors() ov_deprecated_no_errors() - if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - # 'argument': conversion from 'size_t' to 'int', possible loss of data - ov_add_compiler_flags(/wd4267) - ov_add_compiler_flags(/wd4244) - endif() - # add each extra module foreach(module_path IN LISTS extra_modules) if(module_path) diff --git a/src/inference/tests/functional/CMakeLists.txt b/src/inference/tests/functional/CMakeLists.txt index 8ebd3f806bd..66f819df8e8 100644 --- a/src/inference/tests/functional/CMakeLists.txt +++ b/src/inference/tests/functional/CMakeLists.txt @@ -2,12 +2,12 @@ # SPDX-License-Identifier: Apache-2.0 # -if(SUGGEST_OVERRIDE_SUPPORTED) - ov_add_compiler_flags(-Wno-suggest-override) -endif() - set(TARGET_NAME ov_inference_functional_tests) +if(SUGGEST_OVERRIDE_SUPPORTED) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-suggest-override") +endif() + set(DEPENDENCIES mock_engine template_extension diff --git a/src/inference/tests/unit/CMakeLists.txt b/src/inference/tests/unit/CMakeLists.txt index 575623073a1..9aff0e1adbe 100644 --- a/src/inference/tests/unit/CMakeLists.txt +++ b/src/inference/tests/unit/CMakeLists.txt @@ -4,6 +4,10 @@ set(TARGET_NAME ov_inference_unit_tests) +if(SUGGEST_OVERRIDE_SUPPORTED) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-suggest-override") +endif() + ov_add_test_target( NAME ${TARGET_NAME} ROOT ${CMAKE_CURRENT_SOURCE_DIR} @@ -15,8 +19,3 @@ ov_add_test_target( LABELS OV ) - -check_cxx_compiler_flag(-Wno-suggest-override SUPPORT_WNO_SUGGEST_OVERRIDE) -if(SUPPORT_WNO_SUGGEST_OVERRIDE) - ov_add_compiler_flags(-Wno-suggest-override) -endif() diff --git a/src/plugins/intel_cpu/CMakeLists.txt b/src/plugins/intel_cpu/CMakeLists.txt index b2a2e0fab32..72784b79327 100644 --- a/src/plugins/intel_cpu/CMakeLists.txt +++ b/src/plugins/intel_cpu/CMakeLists.txt @@ -10,6 +10,7 @@ set(TARGET_NAME "openvino_intel_cpu_plugin") if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") # C4267, 4244 issues from oneDNN headers conversion from 'XXX' to 'YYY', possible loss of data + ov_add_compiler_flags(/wd4018) ov_add_compiler_flags(/wd4267) ov_add_compiler_flags(/wd4244) # mkldnn headers: '<<': result of 32-bit shift implicitly converted to 64 bits diff --git a/src/plugins/intel_gpu/src/graph/broadcast.cpp b/src/plugins/intel_gpu/src/graph/broadcast.cpp index fdce54766b2..e4e5b369dab 100644 --- a/src/plugins/intel_gpu/src/graph/broadcast.cpp +++ b/src/plugins/intel_gpu/src/graph/broadcast.cpp @@ -22,7 +22,10 @@ layout broadcast_inst::calc_output_layout(broadcast_node const& node, kernel_imp auto desc = impl_param.typed_desc(); if (!desc->target_shape.empty()) { - std::vector dims_converted(desc->target_shape.begin(), desc->target_shape.end()); + std::vector dims_converted(desc->target_shape.size()); + std::transform(desc->target_shape.begin(), desc->target_shape.end(), dims_converted.begin(), [](size_t value) { + return static_cast(value); + }); for (size_t i = dims_converted.size(); i < 4; i++) dims_converted.push_back(1); // extend shape to 4d diff --git a/src/plugins/intel_gpu/src/graph/dft.cpp b/src/plugins/intel_gpu/src/graph/dft.cpp index 406cce3374e..6b52ff8403f 100644 --- a/src/plugins/intel_gpu/src/graph/dft.cpp +++ b/src/plugins/intel_gpu/src/graph/dft.cpp @@ -14,7 +14,13 @@ layout dft_inst::calc_output_layout(const dft_node& node, const kernel_impl_para const auto primitive = impl_param.typed_desc(); const auto input_layout = impl_param.get_input_layout(); - std::vector dims_converted(primitive->output_shape.begin(), primitive->output_shape.end()); + std::vector dims_converted(primitive->output_shape.size()); + std::transform(primitive->output_shape.begin(), + primitive->output_shape.end(), + dims_converted.begin(), + [](size_t value) { + return static_cast(value); + }); // Extend shape to 4d by pushing ones at the end (needed to support less than 4d cases) for (auto i = dims_converted.size(); i < 4; ++i) { diff --git a/src/plugins/intel_gpu/src/graph/impls/onednn/reorder_onednn.cpp b/src/plugins/intel_gpu/src/graph/impls/onednn/reorder_onednn.cpp index 433e043067f..97fdb612e89 100644 --- a/src/plugins/intel_gpu/src/graph/impls/onednn/reorder_onednn.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/onednn/reorder_onednn.cpp @@ -32,8 +32,9 @@ protected: int input_idx = DNNL_ARG_FROM; for (size_t i = 0; i < instance.inputs_memory_count(); i++) { auto& input = instance.input_memory(i); - auto offset = onednn::get_offset(instance.get_input_layout(i), _pd.dnnl::primitive_desc_base::src_desc(i)); - args.insert({input_idx++, input.get_onednn_memory(_pd.dnnl::primitive_desc_base::src_desc(i), offset)}); + auto offset = onednn::get_offset(instance.get_input_layout(i), + _pd.dnnl::primitive_desc_base::src_desc(static_cast(i))); + args.insert({input_idx++, input.get_onednn_memory(_pd.dnnl::primitive_desc_base::src_desc(static_cast(i)), offset)}); } { diff --git a/src/plugins/template/tests/functional/op_reference/reorg_yolo.cpp b/src/plugins/template/tests/functional/op_reference/reorg_yolo.cpp index 5e8f713425e..ddea9ce114b 100644 --- a/src/plugins/template/tests/functional/op_reference/reorg_yolo.cpp +++ b/src/plugins/template/tests/functional/op_reference/reorg_yolo.cpp @@ -11,6 +11,12 @@ using namespace reference_tests; using namespace ov; namespace { + +#ifdef _MSC_VER +# pragma warning(push) +# pragma warning(disable : 4244) +#endif + struct ReorgYoloParams { template ReorgYoloParams(const ov::Strides& stride, @@ -38,6 +44,10 @@ struct ReorgYoloParams { std::string testcaseName; }; +#ifdef _MSC_VER +# pragma warning(pop) +#endif + class ReferenceReorgYoloLayerTest : public testing::TestWithParam, public CommonReferenceTest { public: void SetUp() override {