[CPU]JIRA 93714 fix CPU plugin warning after remove wd4309 wd4018 (#15961)

* Remove warning suppression: wd4018, wd4309

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Remove linux warning suppression no-sign-compare

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* ov::intel_cpu::VectorDims base value type is size_t;
dnnl::memory::dims base value type is int64_t;

All compare data up to int64_t can fix warning and there is potential issue.

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* channelAxis maybe == -1; means: no exist any more.

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Fix recursive macro: "one_of", "everyone_is" sign-compare warning.
Must pass same value type.

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Fix Windows sign unsign compare warning

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* There are 2 instances:

using ov::Dimension::value_type = int64_t
using ov::intel_cpu::StaticDimension::value_type = size_t

All up to int64.

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* linux have too many sign-compare issue.
Complete windows sign-compare firstly.

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Fix clang issues.

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Fix warning.
Because instantiate T1=unsigned int, T2=int

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Fix warning for tests unit reorder_node_test.cpp

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Fix warning : ASSERT_GE(step, 1u);

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Fix tests: warning C4018

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

* Remove auto, using int64_t is more reasonable.

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>

---------

Signed-off-by: Yan, Xiping <xiping.yan@intel.com>
This commit is contained in:
Xiping Yan
2023-03-08 14:41:00 +08:00
committed by GitHub
parent a9cbccd829
commit 68b8d41c43
34 changed files with 133 additions and 127 deletions

View File

@@ -125,17 +125,21 @@ std::vector<TShape> shape_infer(const Pad* op,
}
}
} else {
NODE_VALIDATION_CHECK(op,
pads_begin_rank.is_dynamic() || pads_begin_shape[0].get_length() <= arg_rank_len,
"Number of elements of pads_begin must be >= 0 and <= arg rank "
"(pads_begin_shape[0]: ",
pads_begin_shape[0],
").");
NODE_VALIDATION_CHECK(op,
pads_begin_rank.is_dynamic() || pads_end_shape[0].get_length() <= arg_rank_len,
"Number of elements of pads_end must be >= 0 and <= arg rank (pads_end_shape[0]: ",
pads_end_shape[0],
").");
NODE_VALIDATION_CHECK(
op,
pads_begin_rank.is_dynamic() ||
static_cast<int64_t>(pads_begin_shape[0].get_length()) <= static_cast<int64_t>(arg_rank_len),
"Number of elements of pads_begin must be >= 0 and <= arg rank "
"(pads_begin_shape[0]: ",
pads_begin_shape[0],
").");
NODE_VALIDATION_CHECK(
op,
pads_begin_rank.is_dynamic() ||
static_cast<int64_t>(pads_end_shape[0].get_length()) <= static_cast<int64_t>(arg_rank_len),
"Number of elements of pads_end must be >= 0 and <= arg rank (pads_end_shape[0]: ",
pads_end_shape[0],
").");
output_shape.resize(arg_shape_rank.get_length());
}

View File

@@ -70,11 +70,12 @@ void shape_infer(const Slice* op,
shape_rank);
if (input_rank.is_static()) {
NODE_VALIDATION_CHECK(op,
shape_rank.is_dynamic() || shape[0].get_min_length() <= input_rank.get_length(),
"Slice `",
slice::shape_names[i - 1],
"` input dim size can't be bigger than `data` rank.");
NODE_VALIDATION_CHECK(
op,
shape_rank.is_dynamic() || static_cast<int64_t>(shape[0].get_min_length()) <= input_rank.get_length(),
"Slice `",
slice::shape_names[i - 1],
"` input dim size can't be bigger than `data` rank.");
}
}

View File

@@ -92,7 +92,7 @@ void shape_infer(const VariadicSplit* op,
data_shape[axis]);
}
for (int64_t output = 0; output < num_outputs; ++output) {
for (auto output = 0; output < num_outputs; ++output) {
if (split_lengths.at(output) == -1) {
auto out_shape = data_shape;
out_shape[axis] = Dimension::dynamic();

View File

@@ -16,9 +16,6 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
ie_add_compiler_flags(/wd4244)
# mkldnn headers: '<<': result of 32-bit shift implicitly converted to 64 bits
ie_add_compiler_flags(/wd4334)
# '<': signed/unsigned mismatch
ie_add_compiler_flags(/wd4018)
ie_add_compiler_flags(/wd4309)
endif()
if (WIN32)

View File

@@ -46,7 +46,7 @@ size_t store_emitter_params::hash() const {
}
static int get_aux_regs_as_temp(const size_t byte_size, const bool is_fill = false) {
if (!one_of(byte_size, 64, 32, 16))
if (!one_of(byte_size, 64u, 32u, 16u))
return 1;
if (mayiuse(cpu::x64::avx512_core) && is_fill)
return 1;

View File

@@ -218,8 +218,8 @@ void GraphOptimizer::FuseConvolutionMatMulDeconvAndBias(Graph &graph) {
if (!dimsEqualStrong(biasDims[channelAxis], parentOutDims[channelAxis]))
return false;
for (int i = 0; i < biasDims.size(); i++) {
if (biasDims[i] != 1 && i != channelAxis)
for (size_t i = 0; i < biasDims.size(); i++) {
if (biasDims[i] != 1 && static_cast<int>(i) != channelAxis)
return false;
}
@@ -323,11 +323,11 @@ void GraphOptimizer::FuseDeconvolutionAndSimpleOperation(Graph &graph) {
const auto& strides = deconv->getStride();
const auto& kernel = deconv->getWeightDims();
// WA oneDNN doesn't support fusing post ops after deconvolution with strides over kernel size
bool isSupportedParams = strides[strides.size() - 1] <= kernel[kernel.size() - 1];
bool isSupportedParams = strides[strides.size() - 1] <= static_cast<dnnl_dim_t>(kernel[kernel.size() - 1]);
if (strides.size() > 1)
isSupportedParams &= strides[strides.size() - 2] <= kernel[kernel.size() - 2];
isSupportedParams &= strides[strides.size() - 2] <= static_cast<dnnl_dim_t>(kernel[kernel.size() - 2]);
if (strides.size() > 2)
isSupportedParams &= strides[strides.size() - 3] <= kernel[kernel.size() - 3];
isSupportedParams &= strides[strides.size() - 3] <= static_cast<dnnl_dim_t>(kernel[kernel.size() - 3]);
return isSupportedParams;
};
@@ -376,7 +376,7 @@ void GraphOptimizer::FuseMultiplyAndAdd(Graph &graph) {
auto getChannelAxis = [](const VectorDims& dims) {
auto channelAxis = -1;
for (int i = 0; i < dims.size(); i ++) {
for (size_t i = 0; i < dims.size(); i ++) {
if (dims[i] != 1) {
if (channelAxis != -1) // more than one axis is != 1
return -1;
@@ -587,8 +587,8 @@ void GraphOptimizer::FuseConvolutionAndZeroPoints(Graph &graph) {
if (convNode == nullptr)
IE_THROW() << "Cannot get convolution node " << node->getName();
int IC = node->getInputShapeAtPort(0).getDims()[1];
int OC = node->getOutputShapeAtPort(0).getDims()[1];
auto IC = node->getInputShapeAtPort(0).getDims()[1];
auto OC = node->getOutputShapeAtPort(0).getDims()[1];
if (Shape::UNDEFINED_DIM == IC || Shape::UNDEFINED_DIM == OC)
return false;
@@ -625,7 +625,7 @@ void GraphOptimizer::FuseConvolutionAndZeroPoints(Graph &graph) {
if (zpDims[0] != 1 || !dimsEqualStrong(zpDims[1], IC))
return false;
for (int i = 2; i < zpDims.size(); i++) {
for (size_t i = 2; i < zpDims.size(); i++) {
if (zpDims[i] != 1)
return false;
}
@@ -676,15 +676,15 @@ void GraphOptimizer::FuseConvolutionAndZeroPoints(Graph &graph) {
if (weightsPtr == nullptr)
IE_THROW() << "weightsBlob has not allocated buffer";
ptrdiff_t G = convNode->getGroupNum();
const int groupOffset = convNode->getAlgorithm() == Algorithm::ConvolutionGrouped ? 1 : 0;
auto G = convNode->getGroupNum();
const size_t groupOffset = convNode->getAlgorithm() == Algorithm::ConvolutionGrouped ? 1 : 0;
auto& weightsConstantDims = weightsConstant->outputShapes[0].getStaticDims();
ptrdiff_t OC = weightsConstantDims[0 + groupOffset];
ptrdiff_t IC = weightsConstantDims[1 + groupOffset];
ptrdiff_t KD = weightsConstantDims.size() == (5 + groupOffset) ? weightsConstantDims[weightsConstantDims.size() - 3] : 1;
ptrdiff_t KH = weightsConstantDims.size() == (3 + groupOffset) ? 1 : weightsConstantDims[weightsConstantDims.size() - 2];
ptrdiff_t KW = weightsConstantDims[weightsConstantDims.size() - 1];
auto OC = weightsConstantDims[0 + groupOffset];
auto IC = weightsConstantDims[1 + groupOffset];
auto KD = weightsConstantDims.size() == (5 + groupOffset) ? weightsConstantDims[weightsConstantDims.size() - 3] : 1;
auto KH = weightsConstantDims.size() == (3 + groupOffset) ? 1 : weightsConstantDims[weightsConstantDims.size() - 2];
auto KW = weightsConstantDims[weightsConstantDims.size() - 1];
for (size_t g = 0; g < G; g++) {
for (size_t oc = 0; oc < OC; oc++) {
@@ -717,7 +717,7 @@ void GraphOptimizer::FuseConvolutionAndZeroPoints(Graph &graph) {
}
};
for (int i = 0; i < graphNodes.size(); i++) {
for (size_t i = 0; i < graphNodes.size(); i++) {
auto conv = graphNodes[i];
if (!isSuitableConvNode(conv)) continue;
@@ -870,8 +870,8 @@ void GraphOptimizer::FuseConvolutionAndDWConvolution(Graph &graph) {
dimsEqualStrong(inDims[inDims.size() - 1], outDims[outDims.size() - 1]) &&
dimsEqualStrong(inDims[inDims.size() - 2], outDims[outDims.size() - 2]) &&
is1x1Convolution(conv) && // TODO [oneDNN] : fusing is permitted only with 1x1 convolutions
everyone_is(1, strides[strides.size() - 1], strides[strides.size() - 2]) &&
everyone_is(0, paddings[paddings.size() - 1], paddings[paddings.size() - 2]) &&
everyone_is(1u, strides[strides.size() - 1], strides[strides.size() - 2]) &&
everyone_is(0u, paddings[paddings.size() - 1], paddings[paddings.size() - 2]) &&
!conv->canBeExecutedInInt8();
if (!isSupportedParams) return false;
@@ -917,13 +917,13 @@ void GraphOptimizer::FuseConvolutionAndDWConvolution(Graph &graph) {
const auto stridesSize = convChild->getStride().size();
bool isSupportedParams = dimsEqualStrong(convChild->outputShapes[0].getDims()[1], convChild->getGroupNum()) &&
convChild->outputShapes[0].getDims()[1] != 1 &&
everyone_is(3, convChild->getWeightDims()[weightRank - 1], convChild->getWeightDims()[weightRank - 2]) &&
everyone_is(1, convChild->getPaddingL()[stridesSize - 1], convChild->getPaddingL()[stridesSize - 2]) &&
everyone_is(1, convChild->getPaddingR()[stridesSize - 1], convChild->getPaddingR()[stridesSize - 2]) &&
everyone_is(1, convChild->getDilation()[stridesSize - 1] + 1, convChild->getDilation()[stridesSize - 2] + 1) &&
everyone_is(3u, convChild->getWeightDims()[weightRank - 1], convChild->getWeightDims()[weightRank - 2]) &&
everyone_is(1u, convChild->getPaddingL()[stridesSize - 1], convChild->getPaddingL()[stridesSize - 2]) &&
everyone_is(1u, convChild->getPaddingR()[stridesSize - 1], convChild->getPaddingR()[stridesSize - 2]) &&
everyone_is(1u, convChild->getDilation()[stridesSize - 1] + 1, convChild->getDilation()[stridesSize - 2] + 1) &&
convChild->getStride()[stridesSize - 1] == convChild->getStride()[stridesSize - 2] &&
withBias &&
one_of(convChild->getStride()[stridesSize - 1], 1, 2) &&
one_of(convChild->getStride()[stridesSize - 1], 1u, 2u) &&
childNode->getOutputShapeAtPort(0).getRank() == 4;
return isSupportedParams;
@@ -952,7 +952,7 @@ void GraphOptimizer::FuseConvolutionAndDWConvolution(Graph &graph) {
return (dw_conv_input_size + dw_conv_output_size > L3_cache_size / 2);
};
for (int i = 0; i < graphNodes.size(); i++) {
for (size_t i = 0; i < graphNodes.size(); i++) {
if (!isConvolutionNode(graphNodes[i])) continue;
auto parentConvNode = graphNodes[i];
@@ -1105,7 +1105,7 @@ void GraphOptimizer::FusePoolingAndFakeQuantize(Graph &graph) {
return node->getType() == Type::FakeQuantize && node->getAlgorithm() != Algorithm::FQBinarization;
};
for (int i = 0; i < graphNodes.size(); i++) {
for (size_t i = 0; i < graphNodes.size(); i++) {
auto parent = graphNodes[i];
if (!isSuitableParentNode(parent)) continue;
@@ -1837,9 +1837,9 @@ void GraphOptimizer::FuseClampAndFakeQuantize(Graph &graph) {
std::vector<float> newCropLow(cropLowData.size());
std::vector<float> newCropHigh(cropHighData.size());
for (int i = 0; i < cropLowData.size(); i++)
for (size_t i = 0; i < cropLowData.size(); i++)
newCropLow[i] = std::max(cropLowData[i], eltwiseNode->getAlpha());
for (int i = 0; i < cropHighData.size(); i++)
for (size_t i = 0; i < cropHighData.size(); i++)
newCropHigh[i] = std::min(cropHighData[i], eltwiseNode->getBeta());
fakeQuantizeNode->setCropLow(newCropLow);
@@ -1848,7 +1848,7 @@ void GraphOptimizer::FuseClampAndFakeQuantize(Graph &graph) {
return true;
};
for (int i = 0; i < graphNodes.size(); i++) {
for (size_t i = 0; i < graphNodes.size(); i++) {
auto parent = graphNodes[i];
if (!isSuitableClampNode(parent)) continue;
@@ -1936,7 +1936,7 @@ void GraphOptimizer::FusePerformedAsScaleShiftAndFakeQuantize(Graph &graph) {
scalesBuffer = makeAlignedBuffer(outputDims[channelPos], scalesBuffer, 1);
shiftsBuffer = makeAlignedBuffer(outputDims[channelPos], shiftsBuffer, 1);
for (int i = 0; i < scalesBuffer.size(); i++)
for (size_t i = 0; i < scalesBuffer.size(); i++)
if (scalesBuffer[i] == 0.f)
return false;
@@ -1950,7 +1950,7 @@ void GraphOptimizer::FusePerformedAsScaleShiftAndFakeQuantize(Graph &graph) {
std::vector<float> newInputScale(scalesBuffer.size());
std::vector<float> newInputShift(scalesBuffer.size());
for (int i = 0; i < newCropLow.size(); i++) {
for (size_t i = 0; i < newCropLow.size(); i++) {
float cl = cropLowData.size() == 1 ? cropLowData[0] : cropLowData[i];
float ch = cropHighData.size() == 1 ? cropHighData[0] : cropHighData[i];
@@ -1974,7 +1974,7 @@ void GraphOptimizer::FusePerformedAsScaleShiftAndFakeQuantize(Graph &graph) {
return (*u32data) && (((*u32data) & (0xFF << 23)) == 0);
};
for (int i = 0; i < newInputScale.size(); i++) {
for (size_t i = 0; i < newInputScale.size(); i++) {
float isc = inputScaleData.size() == 1 ? inputScaleData[0] : inputScaleData[i];
newInputScale[i] = isc * scalesBuffer[i];
@@ -1992,7 +1992,7 @@ void GraphOptimizer::FusePerformedAsScaleShiftAndFakeQuantize(Graph &graph) {
}
}
for (int i = 0; i < newInputShift.size(); i++) {
for (size_t i = 0; i < newInputShift.size(); i++) {
float isc = inputScaleData.size() == 1 ? inputScaleData[0] : inputScaleData[i];
float ish = inputShiftData.size() == 1 ? inputShiftData[0] : inputShiftData[i];
@@ -2010,7 +2010,7 @@ void GraphOptimizer::FusePerformedAsScaleShiftAndFakeQuantize(Graph &graph) {
return true;
};
for (int i = 0; i < graphNodes.size(); i++) {
for (size_t i = 0; i < graphNodes.size(); i++) {
auto parent = graphNodes[i];
if (!isSuitableScaleShiftNode(parent)) continue;
@@ -2092,20 +2092,20 @@ void GraphOptimizer::MergeTransposeAndReorder(Graph &graph) {
// revLayoutOrder - reverse permutation for layoutOrder
auto revLayoutOrder = VectorDims(layoutOrder.size());
for (int i = 0; i < revLayoutOrder.size(); i++) {
for (size_t i = 0; i < revLayoutOrder.size(); i++) {
revLayoutOrder[layoutOrder[i]] = i;
}
// newTransposeOrder - Transpose layout-aware permutation
auto newTransposeOrder = VectorDims(transposeOrder.size());
for (int i = 0; i < newTransposeOrder.size(); i++) {
for (size_t i = 0; i < newTransposeOrder.size(); i++) {
newTransposeOrder[i] = layoutOrder[transposeOrder[revLayoutOrder[i]]];
}
// reorderOrder - Reorder layout-aware permutation
auto reorderOrder = VectorDims(outOrder.size());
for (int i = 0; i < reorderOrder.size(); i++) {
for (int j = 0; j < reorderOrder.size(); j++) {
for (size_t i = 0; i < reorderOrder.size(); i++) {
for (size_t j = 0; j < reorderOrder.size(); j++) {
if (outOrder[i] == inOrder[j]) {
reorderOrder[i] = j;
continue;
@@ -2115,12 +2115,12 @@ void GraphOptimizer::MergeTransposeAndReorder(Graph &graph) {
// summaryOrder - resulting Transpose+Reorder permutation
auto summaryOrder = VectorDims(transposeOrder.size());
for (int i = 0; i < summaryOrder.size(); i++) {
for (size_t i = 0; i < summaryOrder.size(); i++) {
summaryOrder[i] = reorderOrder[newTransposeOrder[i]];
}
// check that Transpose+Reorder is the identical permutation
for (int i = 0; i < summaryOrder.size(); i++) {
for (size_t i = 0; i < summaryOrder.size(); i++) {
if (summaryOrder[i] != i) {
return false;
}
@@ -2197,7 +2197,7 @@ void GraphOptimizer::MergeTransposeAndReorder(Graph &graph) {
// inDesc should be permuted before calling reorder
auto & ord = transposeNode->getOrder();
srcPerm = std::vector<int>(ord.size());
for (int i = 0; i < ord.size(); i++) {
for (size_t i = 0; i < ord.size(); i++) {
srcPerm[ord[i]] = i;
}
}
@@ -2219,7 +2219,7 @@ void GraphOptimizer::MergeTransposeAndReorder(Graph &graph) {
}
};
for (int i = 0; i < graphNodes.size(); i++) {
for (size_t i = 0; i < graphNodes.size(); i++) {
auto parentNode = graphNodes[i];
if (!isSuitableParentNode(parentNode)) {
continue;

View File

@@ -131,7 +131,7 @@ DnnlBlockedMemoryDesc::DnnlBlockedMemoryDesc(InferenceEngine::Precision prc, con
}
if (!strides.empty() && !emptyDesc && std::none_of(strides.begin(), strides.end(), [](size_t x) { return Shape::UNDEFINED_DIM == x; })) {
bool inner_block_are_dense = one_of(strides.back(), 0, 1); // stride 1 - is dense case, 0 - broad casted
bool inner_block_are_dense = one_of(strides.back(), 0u, 1u); // stride 1 - is dense case, 0 - broad casted
for (int i = outer_ndims; i < strides.size() - 1; i++) {
inner_block_are_dense &= (strides[i] == strides[i + 1] * blockedDims[i + 1]);
}

View File

@@ -49,7 +49,7 @@ ov::intel_cpu::AlignMatMulInputRanks::AlignMatMulInputRanks() {
auto rankTo = nodeTo.get_partial_shape().size();
std::vector<int64_t> unsqueeze_axes;
for (int64_t j = 0; j < rankTo - rankFrom; ++j)
for (int64_t j = 0; j < static_cast<int64_t>(rankTo - rankFrom); ++j)
unsqueeze_axes.push_back(j);
if (transposedUnsqueeze) // special case for one-dimensional second input

View File

@@ -44,7 +44,7 @@ bool isConvertableToPowerStatic(const std::shared_ptr<BaseOp> &node) {
return false;
auto const_shape = node->get_input_shape(constPort);
return ngraph::shape_size(const_shape) == 1 &&
input_rank.get_length() >= const_shape.size() &&
input_rank.get_length() >= static_cast<int64_t>(const_shape.size()) &&
!ov::intel_cpu::one_of(node->get_input_node_shared_ptr(nonConstPort)->get_type_info(),
ngraph::opset1::NormalizeL2::get_type_info_static(),
ngraph::opset4::Interpolate::get_type_info_static(),
@@ -64,7 +64,9 @@ bool isConvertableToPowerStatic(const std::shared_ptr<ngraph::opset1::Power> &no
if (input_rank.is_dynamic())
return false;
auto const_node = std::dynamic_pointer_cast<ngraph::opset1::Constant>(node->get_input_node_shared_ptr(1));
return const_node && input_rank.get_length() >= const_node->get_shape().size() && ngraph::shape_size(const_node->get_shape()) == 1;
return const_node &&
input_rank.get_length() >= static_cast<ov::Dimension::value_type>(const_node->get_shape().size()) &&
ngraph::shape_size(const_node->get_shape()) == 1;
}
template <class BaseOp>

View File

@@ -126,7 +126,7 @@ void BatchToSpace::batchToSpaceKernel() {
auto outShape5D = getShape5D(outDims);
auto blockShape = getShape5D(blockShapeIn);
if (srcDesc->hasLayoutType(LayoutType::nspc) && one_of(srcDesc->getShape().getRank(), 4, 5)) {
if (srcDesc->hasLayoutType(LayoutType::nspc) && one_of(srcDesc->getShape().getRank(), 4u, 5u)) {
inShape5D.push_back(inShape5D[1]);
inShape5D.erase(inShape5D.begin() + 1);
outShape5D.push_back(outShape5D[1]);
@@ -174,7 +174,7 @@ void BatchToSpace::batchToSpaceKernel() {
oAdd[2] = dimsSize == 5 ? bIdx % blockShapeIn[2] - cropsBeginIn[2] : 0lu;
bIdx = dimsSize == 5 ? bIdx / blockShapeIn[2] : bIdx;
oAdd[1] = bIdx % blockShapeIn[1] - cropsBeginIn[1];
if (srcDesc->hasLayoutType(LayoutType::nspc) && one_of(srcDesc->getShape().getRank(), 4, 5)) {
if (srcDesc->hasLayoutType(LayoutType::nspc) && one_of(srcDesc->getShape().getRank(), 4u, 5u)) {
oAdd.push_back(oAdd[1]);
oAdd.erase(oAdd.begin() + 1);
}

View File

@@ -62,7 +62,7 @@ Concat::Concat(const std::shared_ptr<ngraph::Node>& op, const GraphContext::CPtr
if (axis < 0) {
axis += inRank;
}
if (axis >= inRank || axis < 0) {
if (axis >= static_cast<int64_t>(inRank) || axis < 0) {
IE_THROW() << "Concat node with name '" << getName() << "' has invalid value of axis parameter: " << axis;
}
this->axis = axis;

View File

@@ -1958,18 +1958,18 @@ void Eltwise::initSupportedPrimitiveDescriptors() {
return {config, impl_type};
};
bool isChannelsFirstApplicable = one_of(getOutputShapeAtPort(0).getRank(), 1, 2, 3, 4, 5);
bool isChannelsFirstApplicable = one_of(getOutputShapeAtPort(0).getRank(), 1u, 2u, 3u, 4u, 5u);
for (size_t i = 0; i < getParentEdges().size(); i++) {
isChannelsFirstApplicable = isChannelsFirstApplicable && one_of(getInputShapeAtPort(i).getRank(), 1, 2, 3, 4, 5);
isChannelsFirstApplicable = isChannelsFirstApplicable && one_of(getInputShapeAtPort(i).getRank(), 1u, 2u, 3u, 4u, 5u);
isChannelsFirstApplicable = isChannelsFirstApplicable && implication(getInputShapeAtPort(i).getRank() != 1,
getOutputShapeAtPort(0).getRank() ==
getInputShapeAtPort(i).getRank());
}
bool isBlockedApplicable = one_of(getOutputShapeAtPort(0).getRank(), 1, 3, 4, 5);
bool isBlockedApplicable = one_of(getOutputShapeAtPort(0).getRank(), 1u, 3u, 4u, 5u);
for (size_t i = 0; i < getParentEdges().size(); i++) {
const auto &inShape = getInputShapeAtPort(i);
isBlockedApplicable = isBlockedApplicable && one_of(inShape.getRank(), 1, 3, 4, 5);
isBlockedApplicable = isBlockedApplicable && one_of(inShape.getRank(), 1u, 3u, 4u, 5u);
isBlockedApplicable = isBlockedApplicable && implication(inShape.getRank() != 1,
getOutputShapeAtPort(0).getRank() ==
inShape.getRank());

View File

@@ -64,7 +64,7 @@ Eye::Eye(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr context)
void Eye::getSupportedDescriptors() {
if (!descs.empty())
return;
if (!one_of(getParentEdges().size(), 3, 4))
if (!one_of(getParentEdges().size(), 3u, 4u))
THROW_ERROR << errorPrefix << "has incorrect number of input edges: " << getParentEdges().size();
if (getChildEdges().empty())
THROW_ERROR << errorPrefix << "has incorrect number of output edges: " << getChildEdges().size();

View File

@@ -872,7 +872,7 @@ bool FakeQuantize::isSupportedOperation(const std::shared_ptr<const ngraph::Node
* Long term idea: restore limitation for channel axis 1 and
* support fusing of unfolded FQ (see FakeQuantizeDecomposition transformation)
*/
if (count_not_unit_axis > 1 || !one_of(not_unit_axis, 1, 2)) {
if (count_not_unit_axis > 1 || !one_of(not_unit_axis, 1u, 2u)) {
errorMessage = "Supports only per-tensor and per-channel quantizations";
return false;
}
@@ -1016,7 +1016,7 @@ FakeQuantize::FakeQuantize(const std::shared_ptr<ngraph::Node>& op, const GraphC
}
}
for (ptrdiff_t i = 0; i < std::max(inputLowAxisSize, inputHighAxisSize); i++) {
for (size_t i = 0; i < std::max(inputLowAxisSize, inputHighAxisSize); i++) {
if (inputLowData[isInputLowBroadcasted ? 0 : i] != inputHighData[isInputHighBroadcasted ? 0 : i]) {
binarization = false;
break;
@@ -1094,9 +1094,9 @@ FakeQuantize::FakeQuantize(const std::shared_ptr<ngraph::Node>& op, const GraphC
outputScaleSize = outputScale.size();
outputShiftSize = outputShift.size();
if (everyone_is(1, cropLowSize, cropHighSize, inputScaleSize, inputShiftSize, outputScaleSize, outputShiftSize))
if (everyone_is(1u, cropLowSize, cropHighSize, inputScaleSize, inputShiftSize, outputScaleSize, outputShiftSize))
broadcastingPolicy = PerTensor;
else if (one_of(1, cropLowSize, cropHighSize, inputScaleSize, inputShiftSize, outputScaleSize, outputShiftSize))
else if (one_of(1u, cropLowSize, cropHighSize, inputScaleSize, inputShiftSize, outputScaleSize, outputShiftSize))
broadcastingPolicy = Mixed;
else
broadcastingPolicy = PerChannel;
@@ -1200,7 +1200,7 @@ std::vector<LayoutType> FakeQuantize::getDataFormats() const {
if (isBinarization()) {
return { LayoutType::nspc };
} else {
if (one_of(dims.size(), 4, 5)) {
if (one_of(dims.size(), 4u, 5u)) {
if (getAxis() == 1) {
auto blkFormat = mayiuse(cpu::x64::avx512_core) ? LayoutType::nCsp16c : LayoutType::nCsp8c;
return { blkFormat, LayoutType::nspc, LayoutType::ncsp };
@@ -1430,7 +1430,7 @@ void FakeQuantize::prepareParams() {
auto dstDesc = getChildEdgeAt(0)->getMemory().GetDescWithType<BlockedMemoryDesc>();
key.jqp.d_str = dstDesc->getStrides();
key.jqp.is_planar = srcDesc->hasLayoutType(LayoutType::ncsp) && one_of(srcDesc->getShape().getRank(), 3, 4, 5);
key.jqp.is_planar = srcDesc->hasLayoutType(LayoutType::ncsp) && one_of(srcDesc->getShape().getRank(), 3u, 4u, 5u);
key.jqp.op_type = getAlgorithm();
auto cache = context->getParamsCache();
@@ -1616,8 +1616,8 @@ void FakeQuantize::executeQuantization(const std::unique_ptr<jit_uni_quantize_ke
auto& srcDesc = srcMemory->getDesc();
auto srcDims = srcDesc.getShape().getStaticDims();
bool is_blk_format = !srcDesc.hasLayoutType(LayoutType::nspc) && one_of(srcDesc.getShape().getRank(), 4, 5);
int blk_size = (srcDesc.hasLayoutType(LayoutType::ncsp) && one_of(srcDesc.getShape().getRank(), 3, 4, 5))
bool is_blk_format = !srcDesc.hasLayoutType(LayoutType::nspc) && one_of(srcDesc.getShape().getRank(), 4u, 5u);
int blk_size = (srcDesc.hasLayoutType(LayoutType::ncsp) && one_of(srcDesc.getShape().getRank(), 3u, 4u, 5u))
? 1 : mayiuse(cpu::x64::avx512_core) ? 16 : 8;
const auto &jqp = pKernel->jqp_;
@@ -1630,7 +1630,7 @@ void FakeQuantize::executeQuantization(const std::unique_ptr<jit_uni_quantize_ke
s_str[1] /= blk_size;
}
if (srcDesc.hasLayoutType(LayoutType::nspc) && one_of(srcDesc.getShape().getRank(), 4, 5)) {
if (srcDesc.hasLayoutType(LayoutType::nspc) && one_of(srcDesc.getShape().getRank(), 4u, 5u)) {
size_t tmp = s_str[s_str.size() - 1];
for (int i = s_str.size() - 1; i > 1; i--) {
s_str[i] = s_str[i - 1];

View File

@@ -145,11 +145,11 @@ bool FullyConnected::isSupportedOperation(const std::shared_ptr<const ngraph::No
}
const auto inRank = fc->get_input_partial_shape(DATA_ID).size();
const auto weightRank = fc->get_input_partial_shape(WEIGHTS_ID).size();
if (!one_of(inRank, 2, 3, 4)) {
if (!one_of(inRank, 2u, 3u, 4u)) {
errorMessage = "Doesn't support 'data' input with rank: " + std::to_string(inRank);
return false;
}
if ((one_of(inRank, 2, 3) && weightRank != 2) || (inRank == 4 && weightRank != 4)) {
if ((one_of(inRank, 2u, 3u) && weightRank != 2) || (inRank == 4 && weightRank != 4)) {
errorMessage = "Doesn't support 'data' input with rank: " + std::to_string(inRank) +
" and 'weight' input with rank: " + std::to_string(weightRank);
return false;

View File

@@ -239,7 +239,7 @@ void Interaction::execRef(dnnl::stream strm) {
{DNNL_ARG_WEIGHTS, inputMemPtr->GetPrimitive()},
{DNNL_ARG_DST, outputMemPtr->GetPrimitive()}};
float* scales = fqScales.empty() ? nullptr : fqScales.data();
for (int64_t start = 0; start < batchSize; start++) {
for (int64_t start = 0; start < static_cast<int64_t>(batchSize); start++) {
cat(reinterpret_cast<uint8_t*>(inputMemPtr->GetPtr()), inputPtrs, featureSizes, start, dataPrecision.size());
prim.execute(strm, mem_ags);
flat_triangle(reinterpret_cast<const uint8_t*>(outputMemPtr->GetPtr()),

View File

@@ -86,7 +86,7 @@ bool Lrn::isSupportedOperation(const std::shared_ptr<const ngraph::Node>& op, st
} else {
std::vector<bool> norm(dataRank, false);
for (auto &axis : axes) {
if (axis < 0 || axis >= dataRank) {
if (axis < 0 || axis >= static_cast<int64_t>(dataRank)) {
errorMessage = "Has incorrect reduction axis: " + std::to_string(axis);
return false;
}

View File

@@ -195,7 +195,7 @@ size_t MatrixNms::nmsMatrix(const float* boxesData, const float* scoresData, Box
float max_iou = 0.;
size_t actual_index = i + 1;
auto idx_a = candidateIndex[actual_index];
for (int64_t j = 0; j < actual_index; j++) {
for (size_t j = 0; j < actual_index; j++) {
auto idx_b = candidateIndex[j];
auto iou = intersectionOverUnion(boxesData + idx_a * 4, boxesData + idx_b * 4, m_normalized);
max_iou = std::max(max_iou, iou);
@@ -323,16 +323,15 @@ void MatrixNms::execute(dnnl::stream strm) {
for (size_t i = 1; i < numPerClass.size(); i++) {
auto offset_class = m_classOffset[i];
for (size_t j = 0; j < numPerClass[i]; j++) {
for (int64_t j = 0; j < numPerClass[i]; j++) {
batchFilteredBox[start_offset + j] = batchFilteredBox[offset_class + j];
}
start_offset += numPerClass[i];
}
auto keepNum = numDet;
if (m_keepTopk > -1) {
auto k = static_cast<size_t>(m_keepTopk);
if (keepNum > k)
keepNum = k;
if (keepNum > m_keepTopk)
keepNum = m_keepTopk;
}
std::partial_sort(batchFilteredBox, batchFilteredBox + keepNum, batchFilteredBox + numDet, [](const BoxInfo& lhs, const BoxInfo rhs) {
@@ -345,7 +344,7 @@ void MatrixNms::execute(dnnl::stream strm) {
auto startOffset = m_numPerBatch[0];
for (size_t i = 1; i < m_numPerBatch.size(); i++) {
auto offset_batch = i * m_realNumClasses * m_realNumBoxes;
for (size_t j = 0; j < m_numPerBatch[i]; j++) {
for (int64_t j = 0; j < m_numPerBatch[i]; j++) {
m_filteredBoxes[startOffset + j] = m_filteredBoxes[offset_batch + j];
}
startOffset += m_numPerBatch[i];
@@ -386,7 +385,7 @@ void MatrixNms::execute(dnnl::stream strm) {
int64_t originalOffset = 0;
for (size_t i = 0; i < m_numBatches; i++) {
auto real_boxes = m_numPerBatch[i];
for (size_t j = 0; j < real_boxes; j++) {
for (int64_t j = 0; j < real_boxes; j++) {
auto originalIndex = originalOffset + j;
selectedIndices[j + outputOffset] = static_cast<int>(m_filteredBoxes[originalIndex].index);
auto selectedBase = selectedOutputs + (outputOffset + j) * 6;

View File

@@ -581,7 +581,7 @@ private:
inline void pack_gathered_vector(Vmm vmm_val, Vmm vmm_index, int offset, memory::data_type src_dt) {
sub(rsp, vlen);
uni_vmovdqu(ptr[rsp], vmm_index);
int repeats = vlen / sizeof(float);
size_t repeats = vlen / sizeof(float);
for (size_t i = 0; i < repeats; i++) {
mov(reg_tmp_64.cvt32(), ptr[rsp + i * sizeof(int)]);
Xbyak::Address table_idx = ptr[reg_src + offset + reg_tmp_64];
@@ -2939,9 +2939,9 @@ std::vector<int> Reduce::update_src_dims() {
int outer_end = reduce_axes[0];
int inner_start = reduce_axes[reduce_axes.size() - 1];
for (size_t i = 0; i < src_dims.size(); i++) {
if (i < outer_end) {
if (static_cast<int>(i) < outer_end) {
outer_dim *= src_dims[i];
} else if (i > inner_start) {
} else if (static_cast<int>(i) > inner_start) {
inner_dim *= src_dims[i];
} else {
axis_dim *= src_dims[i];

View File

@@ -86,7 +86,7 @@ void Reorder::initSupportedPrimitiveDescriptors() {
IE_THROW() << "Reorder node with name: " << getName() << " doesn't support case when input and output shapes have different rank and dynamic";
if (!isOptimized) {
const auto &inShape = getInputShapeAtPort(0);
if (one_of(inShape.getRank(), 4, 5) &&
if (one_of(inShape.getRank(), 4u, 5u) &&
config.inConfs[0].getMemDesc()->hasLayoutType(LayoutType::nspc) &&
config.outConfs[0].getMemDesc()->hasLayoutType(LayoutType::ncsp) &&
config.inConfs[0].getMemDesc()->getPrecision() == Precision::FP32 &&
@@ -94,7 +94,7 @@ void Reorder::initSupportedPrimitiveDescriptors() {
// oneDNN JIT reorder shows bad perf for nspc to ncsp reorder case so we fallback on simple c++ implementation
isNspc2NcspCase = true;
} else if (!impl::cpu::x64::mayiuse(impl::cpu::x64::avx2) &&
one_of(inShape.getRank(), 4, 5) &&
one_of(inShape.getRank(), 4u, 5u) &&
config.inConfs[0].getMemDesc()->hasLayoutType(LayoutType::ncsp) &&
config.outConfs[0].getMemDesc()->hasLayoutType(LayoutType::nspc) &&
config.inConfs[0].getMemDesc()->getPrecision() == config.outConfs[0].getMemDesc()->getPrecision() &&

View File

@@ -574,9 +574,9 @@ void RNN::initSequence() {
THROW_ERROR << "has incorrect input/output shapes. Input data shape: " << inDataShape.toString() <<
" Output shape: " << outDataShape.toString();
if (!one_of(getOriginalInputsNumber(), 6, 7))
if (!one_of(getOriginalInputsNumber(), 6u, 7u))
THROW_ERROR << "has incorrect number of input ports: " << getOriginalInputsNumber();
if (!one_of(getOriginalOutputsNumber(), 2, 3))
if (!one_of(getOriginalOutputsNumber(), 2u, 3u))
THROW_ERROR << "has incorrect number of output ports: " << getOriginalOutputsNumber();
T = {inDataShape.getMinDims()[1], inDataShape.getMaxDims()[1]};
@@ -722,7 +722,7 @@ void RNN::fillWeights(const int *gate_map, const size_t wIdx, const size_t rIdx)
}
Prec *l_r_ptr = r_ptr + gate_map[g] * SC + out_i;
for (int in_i = 0; in_i < SC; in_i++) {
for (size_t in_i = 0; in_i < SC; in_i++) {
*l_r_ptr = *ie_r_ptr;
ie_r_ptr++;
l_r_ptr += step;

View File

@@ -1018,13 +1018,13 @@ void ROIAlign::executeSpecified() {
auto sampleXLow = static_cast<unsigned int>(sampleX);
unsigned int sampleYHigh;
unsigned int sampleXHigh;
if (sampleYLow >= H - 1) {
if (static_cast<int>(sampleYLow) >= H - 1) {
sampleYHigh = sampleYLow = H - 1;
sampleY = static_cast<float>(sampleYLow);
} else {
sampleYHigh = sampleYLow + 1;
}
if (sampleXLow >= W - 1) {
if (static_cast<int>(sampleXLow) >= W - 1) {
sampleXHigh = sampleXLow = W - 1;
sampleX = static_cast<float>(sampleXLow);
} else {
@@ -1132,7 +1132,7 @@ void ROIAlign::executeSpecified() {
float numSamplesInBinInvert = 1.f / numSamplesROI;
float pooledValue = 0;
for (unsigned int binSampleInd = 0; binSampleInd < numSamplesROI; binSampleInd++) {
for (auto binSampleInd = 0; binSampleInd < numSamplesROI; binSampleInd++) {
float src0 = srcData[channelSrcOffset + srcIndexTbl[n][paramOffset]];
float src1 = srcData[channelSrcOffset + srcIndexTbl[n][paramOffset + 1]];
float src2 = srcData[channelSrcOffset + srcIndexTbl[n][paramOffset + 2]];

View File

@@ -456,7 +456,7 @@ void ScatterUpdate::scatterElementsUpdate(uint8_t *indices, uint8_t *update, int
for (size_t iwork = start; iwork < end; iwork++) {
int64_t idxValue = getIndicesValue(indices, iwork);
if (idxValue < srcDataDim[axis])
if (idxValue < static_cast<int64_t>(srcDataDim[axis]))
cpu_memcpy(dstData + dataSize * (dst_idx + idxValue * srcBlockND[axis + 1]),
update + iwork * dataSize, dataSize);

View File

@@ -66,7 +66,7 @@ Split::Split(const std::shared_ptr<ngraph::Node>& op, const GraphContext::CPtr c
if (axis < 0) {
axis += inRank;
}
if (axis >= inRank) {
if (axis >= static_cast<int64_t>(inRank)) {
THROW_ERROR << "Split node with name '" << op->get_friendly_name() << "' has invalid value of axis parameter: " << axis;
}
this->axis = axis;
@@ -394,7 +394,7 @@ void Split::initOptimalPrimitiveDescriptor() {
canUseOptimizedNspc2Ncsp = false;
IE_ASSERT(config.inConfs.size() > 0);
const auto inConfDesc = config.inConfs[0].getMemDesc();
if (axis == 1 && one_of(inConfDesc->getShape().getRank(), 4, 5) && inConfDesc->hasLayoutType(LayoutType::nspc)) {
if (axis == 1 && one_of(inConfDesc->getShape().getRank(), 4u, 5u) && inConfDesc->hasLayoutType(LayoutType::nspc)) {
canUseOptimizedNspc2Ncsp = true;
for (size_t i = 0; i < config.outConfs.size(); i++) {
if (!config.outConfs[i].getMemDesc()->hasLayoutType(LayoutType::ncsp))
@@ -585,7 +585,7 @@ Split::SplitOptimizedExecutor::SplitOptimizedExecutor(BlockedMemoryDescCPtr inDe
const auto getRank = srcDims.size();
countStrides = 1;
for (int i = 0; i < axisOrderPos; i++)
for (unsigned int i = 0; i < axisOrderPos; i++)
countStrides *= srcDims[i];
srcDataStride = 0;

View File

@@ -67,7 +67,7 @@ StridedSlice::StridedSlice(const std::shared_ptr<ov::Node>& op, const GraphConte
for (size_t i = 0lu; i < op->get_input_size(); i++) {
isConstantInput[i] = ov::is_type<ov::op::v0::Constant>(op->get_input_node_shared_ptr(i));
if (!isConstantInput[i] && one_of(i, 1, 2, 3)) {
if (!isConstantInput[i] && one_of(i, 1u, 2u, 3u)) {
shapeHasDataDependency = true;
}
}
@@ -248,7 +248,8 @@ void StridedSlice::initSupportedPrimitiveDescriptors() {
return false;
auto channelBeginNormalized = tmpAttrs.begin[1] > 0 ? tmpAttrs.begin[1] : tmpAttrs.begin[1] + static_cast<std::int64_t>(srcDims[1]);
return srcDims[1] % blockSize == 0 && abs(tmpAttrs.stride[1]) == 1 &&
(channelBeginNormalized > srcDims[1] || channelBeginNormalized % blockSize == 0 || channelBeginNormalized < 0 || tmpAttrs.beginMask[1] == 0);
(channelBeginNormalized > static_cast<long>(srcDims[1]) || channelBeginNormalized % blockSize == 0 ||
channelBeginNormalized < 0 || tmpAttrs.beginMask[1] == 0);
};
supportedTypes.push_back(LayoutType::nspc);

View File

@@ -116,11 +116,11 @@ void Snippet::initSupportedPrimitiveDescriptors() {
const size_t ndims = outputShapes[0].getRank();
// Domain sensitive operations support only Planar layout
const bool isOnlyPlanarApplicable = snippet->has_domain_sensitive_ops();
const bool isChannelsFirstApplicable = dnnl::impl::utils::one_of(ndims, 1, 2, 3, 4, 5) && dimRanksAreEqual && !isOnlyPlanarApplicable;
const bool isChannelsFirstApplicable = dnnl::impl::utils::one_of(ndims, 1u, 2u, 3u, 4u, 5u) && dimRanksAreEqual && !isOnlyPlanarApplicable;
// Todo: Snippets currently don't support per-channel broadcasting of Blocked descriptors because
// canonicalization can't distinguish between <N, C, H, W, c> and <N, C, D, H, W> cases.
// See snippets::op::Subgraph::canonicalize for details.
bool isBlockedApplicable = dnnl::impl::utils::one_of(ndims, 4, 5) && dimRanksAreEqual && !isOnlyPlanarApplicable;
bool isBlockedApplicable = dnnl::impl::utils::one_of(ndims, 4u, 5u) && dimRanksAreEqual && !isOnlyPlanarApplicable;
for (const auto& inShape : inputShapes) {
if (isDynamic && inShape.getRank() != 1)
@@ -388,7 +388,7 @@ std::vector<VectorDims> Snippet::shapeInfer() {
dst.insert(dst.begin(), new_rank - dst_rank, 1);
std::vector<Dimension> dims(new_rank);
bool success = true;
for (int64_t i = 0; i < new_rank; i++) {
for (size_t i = 0; i < new_rank; i++) {
auto dsti = i < (new_rank - dst_rank) ? 1 : dst[i - (new_rank - dst_rank)];
auto srci = i < (new_rank - src_rank) ? 1 : src[i - (new_rank - src_rank)];
if (dsti != srci && srci != Shape::UNDEFINED_DIM) {

View File

@@ -277,7 +277,7 @@ void DynamicBuffer::init(const dnnl::engine& eng) {
bool DynamicBuffer::check_buffer() {
if (map_rule.stride > 0) {
if (chunk_offset_in_byte + chunk_unit_in_byte > chunk_stride_in_byte) return true;
if (static_cast<ptrdiff_t>(chunk_offset_in_byte + chunk_unit_in_byte) > chunk_stride_in_byte) return true;
} else {
if (chunk_offset_in_byte < 0) return true;
}

View File

@@ -39,7 +39,7 @@ Unique::Unique(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr con
IE_THROW(NotImplemented) << errorMessage;
}
if (!one_of(op->get_input_size(), 1, 2) || op->get_output_size() != 4)
if (!one_of(op->get_input_size(), 1u, 2u) || op->get_output_size() != 4)
THROW_ERROR << "has incorrect number of input/output edges.";
for (int i = 0; i < 4; i++) {
@@ -389,7 +389,7 @@ void Unique::slicedTensorExec() {
for (int64_t p = partsInBl - 1; p >= 0; p--) {
for (int64_t e = elPerPart - 1; e >= 0 ; e--) {
int64_t pos1 = p * dstPrtStep + e;
for (int64_t i = 0; i < uniqueLen; i++) {
for (int64_t i = 0; i < static_cast<int64_t>(uniqueLen); i++) {
int64_t pos2 = i * elInBl + pos1;
colToSort[i] = {uniDataTmpPtr[pos2], i};
}
@@ -403,7 +403,7 @@ void Unique::slicedTensorExec() {
auto currDst = uniDataTmpPtr + pb * dstPrtStep;
memcpy(buff1.data(), currDst, partLenB);
auto dstIdx = moveTo[0];
for (int64_t b = 0; b < uniqueLen; b++) {
for (size_t b = 0; b < uniqueLen; b++) {
if (dstIdx == moveTo[dstIdx]) {
dstIdx = moveTo[dstIdx + 1];
continue;

View File

@@ -71,7 +71,9 @@ inline bool isPerTensorOrPerChannelBroadcastable(const InferenceEngine::SizeVect
std::vector<size_t> normalizedSecondInputDims = getNormalizedDimsBySize(secondInputDims, firstInputDims.size());
if (channelAxis >= 0) {
for (size_t i = 0; i < normalizedSecondInputDims.size(); i++) {
if ((i == channelAxis && !dimsEqual(normalizedSecondInputDims[i], firstInputDims[i])) || (i != channelAxis && normalizedSecondInputDims[i] != 1))
if ((i == static_cast<size_t>(channelAxis) &&
!dimsEqual(normalizedSecondInputDims[i], firstInputDims[i])) ||
(i != static_cast<size_t>(channelAxis) && normalizedSecondInputDims[i] != 1))
return false;
}
} else {

View File

@@ -114,7 +114,7 @@ bool StaticShape::broadcast_merge_into(StaticShape& dst,
auto new_rank = std::max(dst_rank, src_rank);
std::vector<StaticDimension> dims(new_rank);
bool success = true;
for (int64_t i = 0; i < new_rank; i++) {
for (size_t i = 0; i < new_rank; i++) {
auto dsti = i < (new_rank - dst_rank) ? StaticDimension(1) : dst[i - (new_rank - dst_rank)];
auto srci = i < (new_rank - src_rank) ? StaticDimension(1) : src[i - (new_rank - src_rank)];
success &= StaticDimension::broadcast_merge(dims[i], dsti, srci);

View File

@@ -171,7 +171,7 @@ protected:
} else if (netPrecision == ElementType::bf16) {
size_t O = 1, A = 1, I = 1;
A = shape[axis];
for (size_t i = 0; i < axis; i++)
for (int64_t i = 0; i < axis; i++)
O *= shape[i];
for (size_t i = axis + 1; i < shape.size(); i++)
I *= shape[i];

View File

@@ -34,7 +34,7 @@ inline void checkReorder(const ov::intel_cpu::Memory& inputMemory,
const dnnl::impl::memory_desc_wrapper mdwOutput(mdOutput.data);
auto nelems = mdwInput.nelems();
for (size_t i = 0; i < nelems; ++i) {
for (dnnl::impl::dim_t i = 0; i < nelems; ++i) {
auto srcOffset = mdwInput.off_l(i, false);
auto dstOffset = mdwOutput.off_l(i, false);
switch (prescision) {
@@ -75,11 +75,11 @@ inline void fillData(const ov::intel_cpu::Memory& inputMemory, const InferenceEn
auto inputReorderData = inputMemory.GetData();
switch (prec) {
case InferenceEngine::Precision::FP32:
for (size_t i = 0; i < elemNum; ++i)
for (int64_t i = 0; i < elemNum; ++i)
*(static_cast<float*>(inputReorderData) + mdInput.off_l(i, false)) = static_cast<float>(i);
break;
case InferenceEngine::Precision::I8:
for (size_t i = 0; i < elemNum; ++i)
for (int64_t i = 0; i < elemNum; ++i)
*(static_cast<int8_t*>(inputReorderData) + mdInput.off_l(i, false)) = static_cast<int8_t>(i);
break;
default:

View File

@@ -781,7 +781,7 @@ TEST_P(OVClassGetMetricTest_RANGE_FOR_ASYNC_INFER_REQUESTS, GetMetricAndPrintNoT
<< std::endl;
ASSERT_LE(start, end);
ASSERT_GE(step, 1);
ASSERT_GE(step, 1u);
OV_ASSERT_PROPERTY_SUPPORTED(ov::range_for_async_infer_requests);
}

View File

@@ -714,7 +714,7 @@ TEST_P(IEClassGetMetricTest_RANGE_FOR_ASYNC_INFER_REQUESTS, GetMetricAndPrintNoT
std::cout << std::endl;
ASSERT_LE(start, end);
ASSERT_GE(step, 1);
ASSERT_GE(step, 1u);
ASSERT_METRIC_SUPPORTED_IE(METRIC_KEY(RANGE_FOR_ASYNC_INFER_REQUESTS));
}