Fixed Windows warnings for core (#16523)
This commit is contained in:
parent
cabb917b1f
commit
077d0e43f2
@ -31,10 +31,6 @@ set_property(SOURCE ${MIXED_SRC}
|
|||||||
$<TARGET_PROPERTY:inference_engine_obj,SOURCE_DIR>/src
|
$<TARGET_PROPERTY:inference_engine_obj,SOURCE_DIR>/src
|
||||||
$<TARGET_PROPERTY:inference_engine_plugin_api,INTERFACE_INCLUDE_DIRECTORIES>)
|
$<TARGET_PROPERTY:inference_engine_plugin_api,INTERFACE_INCLUDE_DIRECTORIES>)
|
||||||
|
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
|
||||||
ie_add_compiler_flags(/wd4244)
|
|
||||||
endif()
|
|
||||||
# Create named folders for the sources within the .vcproj
|
# Create named folders for the sources within the .vcproj
|
||||||
# Empty name lists them directly under the .vcproj
|
# Empty name lists them directly under the .vcproj
|
||||||
|
|
||||||
@ -112,7 +108,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_link_options(ngraph_obj ${link_type} "/IGNORE:4217,4286")
|
target_link_options(ngraph_obj ${link_type} "/IGNORE:4217,4286")
|
||||||
ie_add_compiler_flags(/wd4267)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# some sources are located in ngraph, while headers are in inference_engine_transformations
|
# some sources are located in ngraph, while headers are in inference_engine_transformations
|
||||||
|
@ -34,7 +34,7 @@ void gather(const T* const data,
|
|||||||
int64_t axis_size = data_shape[axis];
|
int64_t axis_size = data_shape[axis];
|
||||||
int64_t data_offset, out_offset, idx;
|
int64_t data_offset, out_offset, idx;
|
||||||
// for out of bound indices is filled with zeros
|
// 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 batch = 0; batch < batch_size; batch++)
|
||||||
for (int64_t outer_idx = 0; outer_idx < outer_size; outer_idx++) {
|
for (int64_t outer_idx = 0; outer_idx < outer_size; outer_idx++) {
|
||||||
|
@ -133,10 +133,11 @@ DATA_ET bilinear(const DATA_ET* data,
|
|||||||
const auto x_topleft = std::floor(x_d);
|
const auto x_topleft = std::floor(x_d);
|
||||||
const auto dy = y_d - y_topleft;
|
const auto dy = y_d - y_topleft;
|
||||||
const auto dx = x_d - x_topleft;
|
const auto dx = x_d - x_topleft;
|
||||||
const auto v00 = get_padded(data, data_shape, n, c, y_topleft, x_topleft);
|
const auto v00 = get_padded(data, data_shape, n, c, static_cast<long>(y_topleft), static_cast<long>(x_topleft));
|
||||||
const auto v01 = get_padded(data, data_shape, n, c, y_topleft, x_topleft + 1);
|
const auto v01 = get_padded(data, data_shape, n, c, static_cast<long>(y_topleft), static_cast<long>(x_topleft + 1));
|
||||||
const auto v10 = get_padded(data, data_shape, n, c, y_topleft + 1, x_topleft);
|
const auto v10 = get_padded(data, data_shape, n, c, static_cast<long>(y_topleft + 1), static_cast<long>(x_topleft));
|
||||||
const auto v11 = get_padded(data, data_shape, n, c, y_topleft + 1, x_topleft + 1);
|
const auto v11 =
|
||||||
|
get_padded(data, data_shape, n, c, static_cast<long>(y_topleft + 1), static_cast<long>(x_topleft + 1));
|
||||||
|
|
||||||
const auto q0 = (1 - dx) * v00 + dx * v01;
|
const auto q0 = (1 - dx) * v00 + dx * v01;
|
||||||
const auto q1 = (1 - dx) * v10 + dx * v11;
|
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 x_topleft = std::floor(x_d);
|
||||||
const auto dy = y_d - y_topleft;
|
const auto dy = y_d - y_topleft;
|
||||||
const auto dx = x_d - x_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<long>(y_topleft - 1),
|
||||||
|
static_cast<long>(x_topleft - 1),
|
||||||
|
get_padded);
|
||||||
|
|
||||||
const auto cy = cubic_coeffs(dy);
|
const auto cy = cubic_coeffs(dy);
|
||||||
const auto cx = cubic_coeffs(dx);
|
const auto cx = cubic_coeffs(dx);
|
||||||
|
@ -59,7 +59,7 @@ std::vector<TShape> shape_infer(const SpaceToBatch* op,
|
|||||||
|
|
||||||
auto blocks = get_input_const_data_as<TShape, int64_t>(op, 1, constant_data);
|
auto blocks = get_input_const_data_as<TShape, int64_t>(op, 1, constant_data);
|
||||||
if (blocks) {
|
if (blocks) {
|
||||||
TVal block_prod = std::accumulate(begin(*blocks), end(*blocks), 1, std::multiplies<int64_t>());
|
TVal block_prod = std::accumulate(begin(*blocks), end(*blocks), int64_t(1), std::multiplies<int64_t>());
|
||||||
out_shape.push_back(data_shape[0] * block_prod);
|
out_shape.push_back(data_shape[0] * block_prod);
|
||||||
} else {
|
} else {
|
||||||
out_shape.emplace_back(dim::inf_bound);
|
out_shape.emplace_back(dim::inf_bound);
|
||||||
|
@ -11,6 +11,15 @@ namespace ov {
|
|||||||
namespace op {
|
namespace op {
|
||||||
namespace v0 {
|
namespace v0 {
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
struct NegativeToZero {
|
||||||
|
NegativeToZero() = default;
|
||||||
|
template <class U>
|
||||||
|
T operator()(const U u) const {
|
||||||
|
return static_cast<T>(std::max<U>(0, ov::util::InTypeRange<U>()(u)));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
std::vector<T> shape_infer(const Tile* op,
|
std::vector<T> shape_infer(const Tile* op,
|
||||||
const std::vector<T>& input_shapes,
|
const std::vector<T>& input_shapes,
|
||||||
@ -28,9 +37,7 @@ std::vector<T> shape_infer(const Tile* op,
|
|||||||
T output_shape;
|
T output_shape;
|
||||||
|
|
||||||
// Get repeats and pre process values
|
// Get repeats and pre process values
|
||||||
auto negative_repeats_to_zero = [](const TDimValue v) -> TDimValue {
|
constexpr auto negative_repeats_to_zero = NegativeToZero<TDimValue>();
|
||||||
return std::max<TDimValue>(0, ov::util::InTypeRange<TDimValue>()(v));
|
|
||||||
};
|
|
||||||
|
|
||||||
auto repeats = get_input_const_data_as_shape<T>(op, 1, constant_data, negative_repeats_to_zero);
|
auto repeats = get_input_const_data_as_shape<T>(op, 1, constant_data, negative_repeats_to_zero);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user