Skip to content

Commit db39515

Browse files
Removed warnings suppressions for extra modukes (openvinotoolkit#16479)
1 parent ba67db6 commit db39515

File tree

9 files changed

+33
-19
lines changed

9 files changed

+33
-19
lines changed

cmake/developer_package/frontends/frontends.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ macro(ov_add_frontend)
228228

229229
# protobuf generated code emits -Wsuggest-override error
230230
if(SUGGEST_OVERRIDE_SUPPORTED)
231-
target_compile_options(${TARGET_NAME} PRIVATE -Wno-suggest-override)
231+
target_compile_options(${TARGET_NAME} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-Wno-suggest-override>)
232232
endif()
233233

234234
# install protobuf if it is not installed yet

cmake/extra_modules.cmake

-6
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,6 @@ endif()\n")
132132
ov_dev_package_no_errors()
133133
ov_deprecated_no_errors()
134134

135-
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
136-
# 'argument': conversion from 'size_t' to 'int', possible loss of data
137-
ov_add_compiler_flags(/wd4267)
138-
ov_add_compiler_flags(/wd4244)
139-
endif()
140-
141135
# add each extra module
142136
foreach(module_path IN LISTS extra_modules)
143137
if(module_path)

src/inference/tests/functional/CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
# SPDX-License-Identifier: Apache-2.0
33
#
44

5+
set(TARGET_NAME ov_inference_functional_tests)
6+
57
if(SUGGEST_OVERRIDE_SUPPORTED)
6-
ov_add_compiler_flags(-Wno-suggest-override)
8+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-suggest-override")
79
endif()
810

9-
set(TARGET_NAME ov_inference_functional_tests)
10-
1111
set(DEPENDENCIES
1212
mock_engine
1313
template_extension

src/inference/tests/unit/CMakeLists.txt

+4-5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
set(TARGET_NAME ov_inference_unit_tests)
66

7+
if(SUGGEST_OVERRIDE_SUPPORTED)
8+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-suggest-override")
9+
endif()
10+
711
ov_add_test_target(
812
NAME ${TARGET_NAME}
913
ROOT ${CMAKE_CURRENT_SOURCE_DIR}
@@ -15,8 +19,3 @@ ov_add_test_target(
1519
LABELS
1620
OV
1721
)
18-
19-
check_cxx_compiler_flag(-Wno-suggest-override SUPPORT_WNO_SUGGEST_OVERRIDE)
20-
if(SUPPORT_WNO_SUGGEST_OVERRIDE)
21-
ov_add_compiler_flags(-Wno-suggest-override)
22-
endif()

src/plugins/intel_cpu/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ set(TARGET_NAME "openvino_intel_cpu_plugin")
1010

1111
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
1212
# C4267, 4244 issues from oneDNN headers conversion from 'XXX' to 'YYY', possible loss of data
13+
ov_add_compiler_flags(/wd4018)
1314
ov_add_compiler_flags(/wd4267)
1415
ov_add_compiler_flags(/wd4244)
1516
# mkldnn headers: '<<': result of 32-bit shift implicitly converted to 64 bits

src/plugins/intel_gpu/src/graph/broadcast.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ layout broadcast_inst::calc_output_layout(broadcast_node const& node, kernel_imp
2222
auto desc = impl_param.typed_desc<broadcast>();
2323

2424
if (!desc->target_shape.empty()) {
25-
std::vector<tensor::value_type> dims_converted(desc->target_shape.begin(), desc->target_shape.end());
25+
std::vector<tensor::value_type> dims_converted(desc->target_shape.size());
26+
std::transform(desc->target_shape.begin(), desc->target_shape.end(), dims_converted.begin(), [](size_t value) {
27+
return static_cast<tensor::value_type>(value);
28+
});
2629
for (size_t i = dims_converted.size(); i < 4; i++)
2730
dims_converted.push_back(1); // extend shape to 4d
2831

src/plugins/intel_gpu/src/graph/dft.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ layout dft_inst::calc_output_layout(const dft_node& node, const kernel_impl_para
1414
const auto primitive = impl_param.typed_desc<dft>();
1515
const auto input_layout = impl_param.get_input_layout();
1616

17-
std::vector<tensor::value_type> dims_converted(primitive->output_shape.begin(), primitive->output_shape.end());
17+
std::vector<tensor::value_type> dims_converted(primitive->output_shape.size());
18+
std::transform(primitive->output_shape.begin(),
19+
primitive->output_shape.end(),
20+
dims_converted.begin(),
21+
[](size_t value) {
22+
return static_cast<int>(value);
23+
});
1824

1925
// Extend shape to 4d by pushing ones at the end (needed to support less than 4d cases)
2026
for (auto i = dims_converted.size(); i < 4; ++i) {

src/plugins/intel_gpu/src/graph/impls/onednn/reorder_onednn.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ struct reorder_onednn : typed_primitive_onednn_impl<reorder, dnnl::reorder::prim
3232
int input_idx = DNNL_ARG_FROM;
3333
for (size_t i = 0; i < instance.inputs_memory_count(); i++) {
3434
auto& input = instance.input_memory(i);
35-
auto offset = onednn::get_offset(instance.get_input_layout(i), _pd.dnnl::primitive_desc_base::src_desc(i));
36-
args.insert({input_idx++, input.get_onednn_memory(_pd.dnnl::primitive_desc_base::src_desc(i), offset)});
35+
auto offset = onednn::get_offset(instance.get_input_layout(i),
36+
_pd.dnnl::primitive_desc_base::src_desc(static_cast<int>(i)));
37+
args.insert({input_idx++, input.get_onednn_memory(_pd.dnnl::primitive_desc_base::src_desc(static_cast<int>(i)), offset)});
3738
}
3839

3940
{

src/plugins/template/tests/functional/op_reference/reorg_yolo.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ using namespace reference_tests;
1111
using namespace ov;
1212

1313
namespace {
14+
15+
#ifdef _MSC_VER
16+
# pragma warning(push)
17+
# pragma warning(disable : 4244)
18+
#endif
19+
1420
struct ReorgYoloParams {
1521
template <class IT>
1622
ReorgYoloParams(const ov::Strides& stride,
@@ -38,6 +44,10 @@ struct ReorgYoloParams {
3844
std::string testcaseName;
3945
};
4046

47+
#ifdef _MSC_VER
48+
# pragma warning(pop)
49+
#endif
50+
4151
class ReferenceReorgYoloLayerTest : public testing::TestWithParam<ReorgYoloParams>, public CommonReferenceTest {
4252
public:
4353
void SetUp() override {

0 commit comments

Comments
 (0)