diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 5469e02a9ea..f14298f15eb 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -31,10 +31,6 @@ set_property(SOURCE ${MIXED_SRC} $/src $) - -if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - ie_add_compiler_flags(/wd4244) -endif() # Create named folders for the sources within the .vcproj # Empty name lists them directly under the .vcproj @@ -112,7 +108,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") endif() target_link_options(ngraph_obj ${link_type} "/IGNORE:4217,4286") - ie_add_compiler_flags(/wd4267) endif() # some sources are located in ngraph, while headers are in inference_engine_transformations diff --git a/src/core/reference/include/ngraph/runtime/reference/gather.hpp b/src/core/reference/include/ngraph/runtime/reference/gather.hpp index 95cdc73c83e..82a7fb50188 100644 --- a/src/core/reference/include/ngraph/runtime/reference/gather.hpp +++ b/src/core/reference/include/ngraph/runtime/reference/gather.hpp @@ -34,7 +34,7 @@ void gather(const T* const data, int64_t axis_size = data_shape[axis]; int64_t data_offset, out_offset, idx; // for out of bound indices is filled with zeros - std::fill(out, out + shape_size(out_shape), 0); + std::fill(out, out + shape_size(out_shape), T{0}); for (int64_t batch = 0; batch < batch_size; batch++) for (int64_t outer_idx = 0; outer_idx < outer_size; outer_idx++) { diff --git a/src/core/reference/include/ngraph/runtime/reference/grid_sample.hpp b/src/core/reference/include/ngraph/runtime/reference/grid_sample.hpp index f2662d56173..ed3afda4601 100644 --- a/src/core/reference/include/ngraph/runtime/reference/grid_sample.hpp +++ b/src/core/reference/include/ngraph/runtime/reference/grid_sample.hpp @@ -133,10 +133,11 @@ DATA_ET bilinear(const DATA_ET* data, const auto x_topleft = std::floor(x_d); const auto dy = y_d - y_topleft; const auto dx = x_d - x_topleft; - const auto v00 = get_padded(data, data_shape, n, c, y_topleft, x_topleft); - const auto v01 = get_padded(data, data_shape, n, c, y_topleft, x_topleft + 1); - const auto v10 = get_padded(data, data_shape, n, c, y_topleft + 1, x_topleft); - const auto v11 = get_padded(data, data_shape, n, c, y_topleft + 1, x_topleft + 1); + const auto v00 = get_padded(data, data_shape, n, c, static_cast(y_topleft), static_cast(x_topleft)); + const auto v01 = get_padded(data, data_shape, n, c, static_cast(y_topleft), static_cast(x_topleft + 1)); + const auto v10 = get_padded(data, data_shape, n, c, static_cast(y_topleft + 1), static_cast(x_topleft)); + const auto v11 = + get_padded(data, data_shape, n, c, static_cast(y_topleft + 1), static_cast(x_topleft + 1)); const auto q0 = (1 - dx) * v00 + dx * v01; const auto q1 = (1 - dx) * v10 + dx * v11; @@ -204,7 +205,13 @@ DATA_ET bicubic(const DATA_ET* data, const auto x_topleft = std::floor(x_d); const auto dy = y_d - y_topleft; const auto dx = x_d - x_topleft; - const auto s = gather_4x4(data, data_shape, n, c, y_topleft - 1, x_topleft - 1, get_padded); + const auto s = gather_4x4(data, + data_shape, + n, + c, + static_cast(y_topleft - 1), + static_cast(x_topleft - 1), + get_padded); const auto cy = cubic_coeffs(dy); const auto cx = cubic_coeffs(dx); diff --git a/src/core/shape_inference/include/space_to_batch_shape_inference.hpp b/src/core/shape_inference/include/space_to_batch_shape_inference.hpp index 7cc04ec0ac3..9b239e00fc5 100644 --- a/src/core/shape_inference/include/space_to_batch_shape_inference.hpp +++ b/src/core/shape_inference/include/space_to_batch_shape_inference.hpp @@ -59,7 +59,7 @@ std::vector shape_infer(const SpaceToBatch* op, auto blocks = get_input_const_data_as(op, 1, constant_data); if (blocks) { - TVal block_prod = std::accumulate(begin(*blocks), end(*blocks), 1, std::multiplies()); + TVal block_prod = std::accumulate(begin(*blocks), end(*blocks), int64_t(1), std::multiplies()); out_shape.push_back(data_shape[0] * block_prod); } else { out_shape.emplace_back(dim::inf_bound); diff --git a/src/core/shape_inference/include/tile_shape_inference.hpp b/src/core/shape_inference/include/tile_shape_inference.hpp index abc220b999c..465e4a42397 100644 --- a/src/core/shape_inference/include/tile_shape_inference.hpp +++ b/src/core/shape_inference/include/tile_shape_inference.hpp @@ -11,6 +11,15 @@ namespace ov { namespace op { namespace v0 { +template +struct NegativeToZero { + NegativeToZero() = default; + template + T operator()(const U u) const { + return static_cast(std::max(0, ov::util::InTypeRange()(u))); + } +}; + template std::vector shape_infer(const Tile* op, const std::vector& input_shapes, @@ -28,9 +37,7 @@ std::vector shape_infer(const Tile* op, T output_shape; // Get repeats and pre process values - auto negative_repeats_to_zero = [](const TDimValue v) -> TDimValue { - return std::max(0, ov::util::InTypeRange()(v)); - }; + constexpr auto negative_repeats_to_zero = NegativeToZero(); auto repeats = get_input_const_data_as_shape(op, 1, constant_data, negative_repeats_to_zero);