Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[CPU] Remove errorPrefix usage for error reporting (#28386)

Arseniy Obolenskiy9777fb897e0d
diff --git a/src/plugins/intel_cpu/src/nodes/adaptive_pooling.cpp b/src/plugins/intel_cpu/src/nodes/adaptive_pooling.cpp
index 12662400d86..7b6f64d30d1 100644
--- a/src/plugins/intel_cpu/src/nodes/adaptive_pooling.cpp
+++ b/src/plugins/intel_cpu/src/nodes/adaptive_pooling.cpp
@@ -54,9 +54,7 @@ bool AdaptivePooling::isSupportedOperation(const std::shared_ptr<const ov::Node>
AdaptivePooling::AdaptivePooling(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr context)
: Node(op, context, AdaptivePoolingShapeInferFactory(op)) {
std::string errorMessage;
- if (isSupportedOperation(op, errorMessage)) {
- errorPrefix = "Adaptive Pooling layer with name '" + getName() + "' ";
- } else {
+ if (!isSupportedOperation(op, errorMessage)) {
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
if (one_of(op->get_type_info(), ov::op::v8::AdaptiveAvgPool::get_type_info_static())) {
@@ -70,21 +68,21 @@ AdaptivePooling::AdaptivePooling(const std::shared_ptr<ov::Node>& op, const Grap
void AdaptivePooling::getSupportedDescriptors() {
if (getParentEdges().size() != 2)
- OPENVINO_THROW(errorPrefix, "has incorrect number of input edges: ", getParentEdges().size());
+ THROW_CPU_NODE_ERR("has incorrect number of input edges: ", getParentEdges().size());
if (getChildEdges().size() < (algorithm == Algorithm::AdaptivePoolingMax ? 2 : 1))
- OPENVINO_THROW(errorPrefix, "has incorrect number of output edges: ", getChildEdges().size());
+ THROW_CPU_NODE_ERR("has incorrect number of output edges: ", getChildEdges().size());
auto srcRank = getInputShapeAtPort(0).getRank();
if (!one_of(spatialDimsCount, 1, 2, 3)) {
- OPENVINO_THROW(errorPrefix, "doesn't support 0th input with rank: ", srcRank);
+ THROW_CPU_NODE_ERR("doesn't support 0th input with rank: ", srcRank);
}
if (getInputShapeAtPort(1).getRank() != 1) {
- OPENVINO_THROW(errorPrefix, "doesn't support 1st input with rank: ", getInputShapeAtPort(1).getRank());
+ THROW_CPU_NODE_ERR("doesn't support 1st input with rank: ", getInputShapeAtPort(1).getRank());
}
if (getOutputShapeAtPort(0).getRank() != getInputShapeAtPort(0).getRank()) {
- OPENVINO_THROW(errorPrefix, "must keep data rank");
+ THROW_CPU_NODE_ERR("must keep data rank");
}
}
@@ -136,7 +134,7 @@ void AdaptivePooling::execute(dnnl::stream strm) {
auto inputPrec = getParentEdgeAt(0)->getMemory().getDataType();
auto outputPrec = getChildEdgeAt(0)->getMemory().getDataType();
if (!(inputPrec == dnnl_f32 && outputPrec == dnnl_f32))
- OPENVINO_THROW(errorPrefix, "doesn't support demanded precisions");
+ THROW_CPU_NODE_ERR("doesn't support demanded precisions");
auto& srcMemory0 = getParentEdgeAt(0)->getMemory();
auto& srcMemory1 = getParentEdgeAt(1)->getMemory();
@@ -159,12 +157,11 @@ void AdaptivePooling::execute(dnnl::stream strm) {
auto* dst = getDstDataAtPortAs<float>(0);
if (static_cast<int>(srcMemory1.getShape().getElementsCount()) != spatialDimsCount)
- OPENVINO_THROW(errorPrefix,
- "has input spatial dimension (",
- srcMemory1.getShape().getElementsCount(),
- ") inconsistent with pooling vector size (",
- spatialDimsCount,
- ")");
+ THROW_CPU_NODE_ERR("has input spatial dimension (",
+ srcMemory1.getShape().getElementsCount(),
+ ") inconsistent with pooling vector size (",
+ spatialDimsCount,
+ ")");
auto inputDimVector = srcMemory0.getStaticDims();
const int N = static_cast<int>(inputDimVector[0]);
@@ -185,7 +182,7 @@ void AdaptivePooling::execute(dnnl::stream strm) {
const int blockCount = (isTailCFmt ? 1 : chPadding / blockSize);
auto selectedPrimitiveDescriptor = getSelectedPrimitiveDescriptor();
if (!selectedPrimitiveDescriptor)
- OPENVINO_THROW(errorPrefix, "doesn't have primitive descriptors.");
+ THROW_CPU_NODE_ERR("doesn't have primitive descriptors.");
auto config = selectedPrimitiveDescriptor->getConfig();
auto srcStrides = srcBlockDesc->getStrides();
auto dstStrides = getChildEdgeAt(0)->getMemory().getDescWithType<BlockedMemoryDesc>()->getStrides();
@@ -231,7 +228,7 @@ void AdaptivePooling::execute(dnnl::stream strm) {
setBinBorders(&wStart, &wEnd, ow, IW, OW);
auto binSize = (dEnd - dStart) * (hEnd - hStart) * (wEnd - wStart);
if (binSize == 0)
- OPENVINO_THROW(errorPrefix, "has empty bin");
+ THROW_CPU_NODE_ERR("has empty bin");
float sum = 0;
for (size_t pixD = dStart; pixD < dEnd; pixD++) {
for (size_t pixH = hStart; pixH < hEnd; pixH++) {
diff --git a/src/plugins/intel_cpu/src/nodes/adaptive_pooling.h b/src/plugins/intel_cpu/src/nodes/adaptive_pooling.h
index 7338c190121..cc6969dd1b1 100644
--- a/src/plugins/intel_cpu/src/nodes/adaptive_pooling.h
+++ b/src/plugins/intel_cpu/src/nodes/adaptive_pooling.h
@@ -33,8 +33,6 @@ private:
ov::element::Type precision = ov::element::f32;
inline void setBinBorders(size_t* startPtr, size_t* endPtr, size_t idx, size_t inputLength, size_t outputLength);
- std::string errorPrefix;
-
protected:
bool needShapeInfer() const override;
bool needPrepareParams() const override {
diff --git a/src/plugins/intel_cpu/src/nodes/batch_to_space.cpp b/src/plugins/intel_cpu/src/nodes/batch_to_space.cpp
index a621cf74e78..7a255c95b63 100644
--- a/src/plugins/intel_cpu/src/nodes/batch_to_space.cpp
+++ b/src/plugins/intel_cpu/src/nodes/batch_to_space.cpp
@@ -37,17 +37,15 @@ BatchToSpace::BatchToSpace(const std::shared_ptr<ov::Node>& op, const GraphConte
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix = "BatchToSpace layer with name '" + op->get_friendly_name() + "'";
-
if (inputShapes.size() != 4 || outputShapes.size() != 1)
- OPENVINO_THROW(errorPrefix, " has incorrect number of input or output edges!");
+ THROW_CPU_NODE_ERR("has incorrect number of input or output edges!");
const auto& inDims = getInputShapeAtPort(0).getDims();
const auto& outDims = getOutputShapeAtPort(0).getDims();
if (inDims.size() < 4 || inDims.size() > 5)
- OPENVINO_THROW(errorPrefix, " has unsupported 'data' input rank: ", inDims.size());
+ THROW_CPU_NODE_ERR("has unsupported 'data' input rank: ", inDims.size());
if (inDims.size() != outDims.size())
- OPENVINO_THROW(errorPrefix, " has incorrect number of input/output dimensions");
+ THROW_CPU_NODE_ERR("has incorrect number of input/output dimensions");
}
void BatchToSpace::initSupportedPrimitiveDescriptors() {
@@ -58,7 +56,7 @@ void BatchToSpace::initSupportedPrimitiveDescriptors() {
const auto precision = getOriginalInputPrecisionAtPort(0);
const std::set<size_t> supported_precision_sizes = {1, 2, 4, 8};
if (supported_precision_sizes.find(precision.size()) == supported_precision_sizes.end())
- OPENVINO_THROW(errorPrefix, " has unsupported precision: ", precision.get_type_name());
+ THROW_CPU_NODE_ERR("has unsupported precision: ", precision.get_type_name());
addSupportedPrimDesc({{LayoutType::nspc, precision},
{LayoutType::ncsp, ov::element::i32},
@@ -156,7 +154,9 @@ void BatchToSpace::batchToSpaceKernel() {
size_t channels = (inShape5D[1] / blockSize);
channels = channels == 0 ? 1 : channels;
const size_t workAmount = inShape5D[0] * channels;
- OPENVINO_ASSERT(workAmount > 0, errorPrefix, " has unsupported work amount == 0");
+ if (workAmount == 0) {
+ THROW_CPU_NODE_ERR("has unsupported work amount == 0");
+ }
parallel_nt(0, [&](const int ithr, const int nthr) {
size_t start(0lu), end(0lu);
diff --git a/src/plugins/intel_cpu/src/nodes/batch_to_space.h b/src/plugins/intel_cpu/src/nodes/batch_to_space.h
index 6e1620580a1..9c863296cc3 100644
--- a/src/plugins/intel_cpu/src/nodes/batch_to_space.h
+++ b/src/plugins/intel_cpu/src/nodes/batch_to_space.h
@@ -42,8 +42,6 @@ private:
private:
std::vector<size_t> blockShapeIn;
std::vector<size_t> cropsBeginIn;
-
- std::string errorPrefix;
};
} // namespace node
diff --git a/src/plugins/intel_cpu/src/nodes/bin_conv.cpp b/src/plugins/intel_cpu/src/nodes/bin_conv.cpp
index 881ea56ef76..0a1e255dd38 100644
--- a/src/plugins/intel_cpu/src/nodes/bin_conv.cpp
+++ b/src/plugins/intel_cpu/src/nodes/bin_conv.cpp
@@ -940,7 +940,6 @@ BinaryConvolution::BinaryConvolution(const std::shared_ptr<ov::Node>& op, const
: Node(op, context, NgraphShapeInferFactory(op)) {
std::string errorMessage;
if (isSupportedOperation(op, errorMessage)) {
- errorPrefix = "BinaryConvolution node with name '" + getName() + "' ";
const auto binConv = ov::as_type_ptr<const ov::opset1::BinaryConvolution>(op);
pad_value = binConv->get_pad_value();
@@ -980,21 +979,21 @@ void BinaryConvolution::getSupportedDescriptors() {
}
if (getParentEdges().size() != expectedInputEdgesNum)
- OPENVINO_THROW(errorPrefix, "has incorrect number of input edges");
+ THROW_CPU_NODE_ERR("has incorrect number of input edges");
if (getChildEdges().empty())
- OPENVINO_THROW(errorPrefix, "has incorrect number of output edges");
+ THROW_CPU_NODE_ERR("has incorrect number of output edges");
if (getInputShapeAtPort(0).getRank() != 4) {
- OPENVINO_THROW(errorPrefix, "doesn't support 0th input with rank: ", getInputShapeAtPort(0).getRank());
+ THROW_CPU_NODE_ERR("doesn't support 0th input with rank: ", getInputShapeAtPort(0).getRank());
}
if (getInputShapeAtPort(1).getRank() != 4) {
- OPENVINO_THROW(errorPrefix, "doesn't support 1st input with rank: ", getInputShapeAtPort(1).getRank());
+ THROW_CPU_NODE_ERR("doesn't support 1st input with rank: ", getInputShapeAtPort(1).getRank());
}
if (getOutputShapeAtPort(0).getRank() != 4) {
- OPENVINO_THROW(errorPrefix, "doesn't support output with rank: ", getOutputShapeAtPort(0).getRank());
+ THROW_CPU_NODE_ERR("doesn't support output with rank: ", getOutputShapeAtPort(0).getRank());
}
}
diff --git a/src/plugins/intel_cpu/src/nodes/bin_conv.h b/src/plugins/intel_cpu/src/nodes/bin_conv.h
index 9ec83365b63..825c264a5ba 100644
--- a/src/plugins/intel_cpu/src/nodes/bin_conv.h
+++ b/src/plugins/intel_cpu/src/nodes/bin_conv.h
@@ -129,8 +129,6 @@ private:
const std::vector<size_t>& s_str,
const std::vector<size_t>& w_str,
const std::vector<size_t>& d_str);
-
- std::string errorPrefix;
};
} // namespace node
diff --git a/src/plugins/intel_cpu/src/nodes/broadcast.cpp b/src/plugins/intel_cpu/src/nodes/broadcast.cpp
index 727267e836c..3c92c6e6e4f 100644
--- a/src/plugins/intel_cpu/src/nodes/broadcast.cpp
+++ b/src/plugins/intel_cpu/src/nodes/broadcast.cpp
@@ -57,21 +57,20 @@ Broadcast::Broadcast(const std::shared_ptr<ov::Node>& op, const GraphContext::CP
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix = "Broadcast node with name '" + op->get_friendly_name() + "' ";
if (op->get_input_size() != 2 && op->get_input_size() != 3)
- OPENVINO_THROW(errorPrefix, "has incorrect number of input edges: ", getParentEdges().size());
+ THROW_CPU_NODE_ERR("has incorrect number of input edges: ", getParentEdges().size());
if (op->get_output_size() == 0)
- OPENVINO_THROW(errorPrefix, "has no output edges.");
+ THROW_CPU_NODE_ERR("has no output edges.");
auto broadcastOp = ov::as_type_ptr<const ov::op::v1::Broadcast>(op);
if (broadcastOp->get_broadcast_spec().m_type == ov::op::AutoBroadcastType::NUMPY) {
broadcastType = NUMPY;
} else if (broadcastOp->get_broadcast_spec().m_type == ov::op::AutoBroadcastType::EXPLICIT) {
if (op->get_input_size() <= AXES_MAPPING_IDX)
- OPENVINO_THROW(errorPrefix, " and EXPLICIT mode must have tree input edges: ", getParentEdges().size());
+ THROW_CPU_NODE_ERR("and EXPLICIT mode must have tree input edges: ", getParentEdges().size());
broadcastType = EXPLICIT;
} else {
- OPENVINO_THROW(errorPrefix, "has unexpected broadcast type: ", broadcastOp->get_broadcast_spec().m_type);
+ THROW_CPU_NODE_ERR("has unexpected broadcast type: ", broadcastOp->get_broadcast_spec().m_type);
}
if (ov::is_type<ov::op::v0::Constant>(op->get_input_node_ptr(TARGET_SHAPE_IDX))) {
diff --git a/src/plugins/intel_cpu/src/nodes/broadcast.h b/src/plugins/intel_cpu/src/nodes/broadcast.h
index 859f4fb71da..5645ec70a1f 100644
--- a/src/plugins/intel_cpu/src/nodes/broadcast.h
+++ b/src/plugins/intel_cpu/src/nodes/broadcast.h
@@ -44,8 +44,6 @@ private:
std::vector<int32_t> targetShape;
std::vector<int32_t> axesMapping;
-
- std::string errorPrefix;
};
} // namespace node
diff --git a/src/plugins/intel_cpu/src/nodes/bucketize.cpp b/src/plugins/intel_cpu/src/nodes/bucketize.cpp
index 03c6924d9a8..115e397c4c9 100644
--- a/src/plugins/intel_cpu/src/nodes/bucketize.cpp
+++ b/src/plugins/intel_cpu/src/nodes/bucketize.cpp
@@ -36,7 +36,6 @@ Bucketize::Bucketize(const std::shared_ptr<ov::Node>& op, const GraphContext::CP
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix = "Bucketize layer with name '" + op->get_friendly_name() + "' ";
const auto bucketsize = ov::as_type_ptr<const ov::opset3::Bucketize>(op);
if (bucketsize == nullptr)
OPENVINO_THROW("Operation with name '",
@@ -44,7 +43,7 @@ Bucketize::Bucketize(const std::shared_ptr<ov::Node>& op, const GraphContext::CP
"' is not an instance of Bucketize from opset3.");
if (getOriginalInputsNumber() != 2 || getOriginalOutputsNumber() != 1) {
- OPENVINO_THROW(errorPrefix, " has incorrect number of input/output edges!");
+ THROW_CPU_NODE_ERR("has incorrect number of input/output edges!");
}
// check one attribute
@@ -181,7 +180,7 @@ void Bucketize::execute(dnnl::stream strm) {
element_type_traits<ov::element::i64>::value_type>();
break;
default:
- OPENVINO_THROW(errorPrefix, " has unsupported precision: ", precision_mask);
+ THROW_CPU_NODE_ERR("has unsupported precision: ", precision_mask);
}
}
@@ -201,11 +200,11 @@ void Bucketize::prepareParams() {
// update with_bins/num_values/num_bin_values
auto input_tensor_dims = inputTensorMemPtr->getStaticDims();
if (input_tensor_dims.size() < 1) {
- OPENVINO_THROW(errorPrefix, " has incorrect dimensions of the input.");
+ THROW_CPU_NODE_ERR("has incorrect dimensions of the input.");
}
auto input_bin_dims = inputBinsMemPtr->getStaticDims();
if (input_bin_dims.size() != 1) {
- OPENVINO_THROW(errorPrefix, " has incorrect dimensions of the boundaries tensor.");
+ THROW_CPU_NODE_ERR("has incorrect dimensions of the boundaries tensor.");
}
if (input_bin_dims[0] != 0) {
with_bins = true;
diff --git a/src/plugins/intel_cpu/src/nodes/bucketize.h b/src/plugins/intel_cpu/src/nodes/bucketize.h
index 59cb0bec952..5ad893ea0a9 100644
--- a/src/plugins/intel_cpu/src/nodes/bucketize.h
+++ b/src/plugins/intel_cpu/src/nodes/bucketize.h
@@ -43,7 +43,6 @@ private:
ov::element::Type input_precision;
ov::element::Type boundaries_precision;
ov::element::Type output_precision;
- std::string errorPrefix;
};
} // namespace node
diff --git a/src/plugins/intel_cpu/src/nodes/convert.cpp b/src/plugins/intel_cpu/src/nodes/convert.cpp
index 7b050613739..2684fe28d9b 100644
--- a/src/plugins/intel_cpu/src/nodes/convert.cpp
+++ b/src/plugins/intel_cpu/src/nodes/convert.cpp
@@ -39,9 +39,7 @@ bool Convert::isSupportedOperation(const std::shared_ptr<const ov::Node>& op, st
Convert::Convert(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr context)
: Node(op, context, PassThroughShapeInferFactory()) {
std::string errorMessage;
- if (isSupportedOperation(op, errorMessage)) {
- errorPrefix = "Convert node with name '" + getName() + "'";
- } else {
+ if (!isSupportedOperation(op, errorMessage)) {
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
@@ -61,8 +59,6 @@ Convert::Convert(const Shape& shape,
if (isDynamicNode()) {
shapeInference = std::make_shared<ShapeInferPassThrough>();
}
-
- errorPrefix = "Convert node with name '" + getName() + "'";
}
void Convert::getSupportedDescriptors() {
@@ -73,9 +69,9 @@ void Convert::getSupportedDescriptors() {
if (inputShapes.empty())
inputShapes.push_back(input->getShape());
if (getParentEdges().size() != 1)
- OPENVINO_THROW(errorPrefix, " has incorrect number of input edges");
+ THROW_CPU_NODE_ERR("has incorrect number of input edges");
if (getChildEdges().empty())
- OPENVINO_THROW(errorPrefix, " has incorrect number of output edges");
+ THROW_CPU_NODE_ERR("has incorrect number of output edges");
}
bool Convert::isSupportedDesc(const MemoryDesc& desc) {
@@ -157,7 +153,7 @@ void Convert::initSupportedPrimitiveDescriptors() {
supportedPrimitiveDescriptorsBuilder(config);
}
} else {
- OPENVINO_THROW(errorPrefix, " has incorrect number of input/output edges");
+ THROW_CPU_NODE_ERR("has incorrect number of input/output edges");
}
}
@@ -185,7 +181,7 @@ void Convert::execute(dnnl::stream strm) {
const auto childPaddElemCount = childMem.getDescWithType<BlockedMemoryDesc>()->getPaddedElementsCount();
if (parentPaddElemCount != childPaddElemCount)
- OPENVINO_THROW(errorPrefix, " has different elements number in input and output buffers");
+ THROW_CPU_NODE_ERR("has different elements number in input and output buffers");
MemoryCPtr srcMemory = getSrcMemoryAtPort(0);
MemoryPtr dstMemory = getDstMemoryAtPort(0);
diff --git a/src/plugins/intel_cpu/src/nodes/convert.h b/src/plugins/intel_cpu/src/nodes/convert.h
index 537c67e39dc..528e5adef6f 100644
--- a/src/plugins/intel_cpu/src/nodes/convert.h
+++ b/src/plugins/intel_cpu/src/nodes/convert.h
@@ -60,8 +60,6 @@ private:
ConvertParams convertParams;
std::shared_ptr<ConvertExecutor> execPtr = nullptr;
NodeConfig config;
-
- std::string errorPrefix;
};
} // namespace node
diff --git a/src/plugins/intel_cpu/src/nodes/ctc_greedy_decoder.cpp b/src/plugins/intel_cpu/src/nodes/ctc_greedy_decoder.cpp
index 05c96aa0647..60224ff49a8 100644
--- a/src/plugins/intel_cpu/src/nodes/ctc_greedy_decoder.cpp
+++ b/src/plugins/intel_cpu/src/nodes/ctc_greedy_decoder.cpp
@@ -35,17 +35,16 @@ CTCGreedyDecoder::CTCGreedyDecoder(const std::shared_ptr<ov::Node>& op, const Gr
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix = "CTCGreedyDecoder layer with name '" + op->get_friendly_name() + "' ";
if (getOriginalInputsNumber() != 2)
- OPENVINO_THROW(errorPrefix, "has invalid number of input edges: ", getOriginalInputsNumber());
+ THROW_CPU_NODE_ERR("has invalid number of input edges: ", getOriginalInputsNumber());
if (getOriginalOutputsNumber() != 1)
- OPENVINO_THROW(errorPrefix, "has invalid number of outputs edges: ", getOriginalOutputsNumber());
+ THROW_CPU_NODE_ERR("has invalid number of outputs edges: ", getOriginalOutputsNumber());
const auto& dataDims = getInputShapeAtPort(DATA_INDEX).getDims();
const auto& seqDims = getInputShapeAtPort(SEQUENCE_LENGTH_INDEX).getDims();
if (!dimsEqualWeak(dataDims[0], seqDims[0]) || !dimsEqualWeak(dataDims[1], seqDims[1]))
- OPENVINO_THROW(errorPrefix, "has invalid input shapes.");
+ THROW_CPU_NODE_ERR("has invalid input shapes.");
auto greedyDecOp = ov::as_type_ptr<const ov::op::v0::CTCGreedyDecoder>(op);
mergeRepeated = greedyDecOp->get_ctc_merge_repeated();
@@ -57,11 +56,11 @@ void CTCGreedyDecoder::initSupportedPrimitiveDescriptors() {
ov::element::Type inDataPrecision = getOriginalInputPrecisionAtPort(DATA_INDEX);
if (!one_of(inDataPrecision, ov::element::f32, ov::element::bf16, ov::element::f16))
- OPENVINO_THROW(errorPrefix, "has unsupported 'data' input precision: ", inDataPrecision);
+ THROW_CPU_NODE_ERR("has unsupported 'data' input precision: ", inDataPrecision);
ov::element::Type seqLenPrecision = getOriginalInputPrecisionAtPort(SEQUENCE_LENGTH_INDEX);
if (!one_of(seqLenPrecision, ov::element::f32, ov::element::bf16, ov::element::f16))
- OPENVINO_THROW(errorPrefix, "has unsupported 'sequence_length' input precision: ", seqLenPrecision);
+ THROW_CPU_NODE_ERR("has unsupported 'sequence_length' input precision: ", seqLenPrecision);
addSupportedPrimDesc({{LayoutType::ncsp, ov::element::f32}, {LayoutType::ncsp, ov::element::f32}},
{{LayoutType::ncsp, ov::element::f32}},
diff --git a/src/plugins/intel_cpu/src/nodes/ctc_greedy_decoder.h b/src/plugins/intel_cpu/src/nodes/ctc_greedy_decoder.h
index deb4f9fa484..9121905eefd 100644
--- a/src/plugins/intel_cpu/src/nodes/ctc_greedy_decoder.h
+++ b/src/plugins/intel_cpu/src/nodes/ctc_greedy_decoder.h
@@ -27,8 +27,6 @@ private:
const size_t DATA_INDEX = 0lu;
const size_t SEQUENCE_LENGTH_INDEX = 1lu;
bool mergeRepeated;
-
- std::string errorPrefix;
};
} // namespace node
diff --git a/src/plugins/intel_cpu/src/nodes/ctc_greedy_decoder_seq_len.cpp b/src/plugins/intel_cpu/src/nodes/ctc_greedy_decoder_seq_len.cpp
index 1f3e679bfcc..11c6efb8da3 100644
--- a/src/plugins/intel_cpu/src/nodes/ctc_greedy_decoder_seq_len.cpp
+++ b/src/plugins/intel_cpu/src/nodes/ctc_greedy_decoder_seq_len.cpp
@@ -35,16 +35,15 @@ CTCGreedyDecoderSeqLen::CTCGreedyDecoderSeqLen(const std::shared_ptr<ov::Node>&
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix = "CTCGreedyDecoderSeqLen layer with name '" + op->get_friendly_name() + "' ";
if (getOriginalInputsNumber() < 2 || getOriginalInputsNumber() > 3)
- OPENVINO_THROW(errorPrefix, "has invalid number of input edges: ", getOriginalInputsNumber());
+ THROW_CPU_NODE_ERR("has invalid number of input edges: ", getOriginalInputsNumber());
if (getOriginalOutputsNumber() != 2)
- OPENVINO_THROW(errorPrefix, "has invalid number of outputs edges: ", getOriginalOutputsNumber());
+ THROW_CPU_NODE_ERR("has invalid number of outputs edges: ", getOriginalOutputsNumber());
const auto& dataDims = getInputShapeAtPort(DATA_INDEX).getDims();
const auto& seqDims = getInputShapeAtPort(SEQUENCE_LENGTH_INDEX).getDims();
if (!dimsEqualWeak(dataDims[0], seqDims[0]))
- OPENVINO_THROW(errorPrefix, "has invalid input shapes.");
+ THROW_CPU_NODE_ERR("has invalid input shapes.");
auto greedyDecOp = ov::as_type_ptr<const ov::op::v6::CTCGreedyDecoderSeqLen>(op);
mergeRepeated = greedyDecOp->get_merge_repeated();
@@ -56,11 +55,11 @@ void CTCGreedyDecoderSeqLen::initSupportedPrimitiveDescriptors() {
ov::element::Type inDataPrecision = getOriginalInputPrecisionAtPort(DATA_INDEX);
if (!one_of(inDataPrecision, ov::element::f32, ov::element::bf16, ov::element::f16))
- OPENVINO_THROW(errorPrefix, "has unsupported 'data' input precision: ", inDataPrecision);
+ THROW_CPU_NODE_ERR("has unsupported 'data' input precision: ", inDataPrecision);
ov::element::Type seqLenPrecision = getOriginalInputPrecisionAtPort(SEQUENCE_LENGTH_INDEX);
if (seqLenPrecision != ov::element::i32 && seqLenPrecision != ov::element::i64)
- OPENVINO_THROW(errorPrefix, "has unsupported 'sequence_length' input precision: ", seqLenPrecision);
+ THROW_CPU_NODE_ERR("has unsupported 'sequence_length' input precision: ", seqLenPrecision);
std::vector<PortConfigurator> inDataConf;
inDataConf.reserve(inputShapes.size());
@@ -95,10 +94,10 @@ void CTCGreedyDecoderSeqLen::execute(dnnl::stream strm) {
for (size_t b = 0; b < B; b++) {
if (sequenceLengths[b] > static_cast<int>(T)) {
std::string errorMsg =
- errorPrefix + ". Sequence length " + std::to_string(sequenceLengths[b]) +
+ "Sequence length " + std::to_string(sequenceLengths[b]) +
" cannot be greater than according decoded classes dimension size " +
std::to_string(getChildEdgeAt(DECODED_CLASSES_INDEX)->getMemory().getStaticDims()[1]);
- OPENVINO_THROW(errorMsg);
+ THROW_CPU_NODE_ERR(errorMsg);
}
workAmount += sequenceLengths[b];
}
diff --git a/src/plugins/intel_cpu/src/nodes/ctc_greedy_decoder_seq_len.h b/src/plugins/intel_cpu/src/nodes/ctc_greedy_decoder_seq_len.h
index 93cbb66050d..d730cebedac 100644
--- a/src/plugins/intel_cpu/src/nodes/ctc_greedy_decoder_seq_len.h
+++ b/src/plugins/intel_cpu/src/nodes/ctc_greedy_decoder_seq_len.h
@@ -30,8 +30,6 @@ private:
const size_t DECODED_CLASSES_INDEX = 0lu;
const size_t DECODED_CLASSES_LENGTH_INDEX = 1lu;
bool mergeRepeated;
-
- std::string errorPrefix;
};
} // namespace node
diff --git a/src/plugins/intel_cpu/src/nodes/ctc_loss.cpp b/src/plugins/intel_cpu/src/nodes/ctc_loss.cpp
index e8dc4e6c1c5..20c080105af 100644
--- a/src/plugins/intel_cpu/src/nodes/ctc_loss.cpp
+++ b/src/plugins/intel_cpu/src/nodes/ctc_loss.cpp
@@ -33,10 +33,8 @@ CTCLoss::CTCLoss(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr c
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix = std::string("CTCLoss layer with name '") + op->get_friendly_name() + "'";
-
if (getOriginalInputsNumber() != 4 && getOriginalInputsNumber() != 5)
- OPENVINO_THROW(errorPrefix, " has invalid inputs number.");
+ THROW_CPU_NODE_ERR("has invalid inputs number.");
auto ctcLossOp = ov::as_type_ptr<const ov::op::v4::CTCLoss>(op);
ctcMergeRepeated = ctcLossOp->get_ctc_merge_repeated();
@@ -95,7 +93,7 @@ void CTCLoss::execute(dnnl::stream strm) {
for (size_t b = start; b < end; b++) {
if (logitsLength[b] < 0 || labelsLength[b] < 0 || logitsLength[b] > static_cast<int>(maxTime) ||
labelsLength[b] > logitsLength[b]) {
- errorMsgB[ithr] = errorPrefix + ". Logit length cannot be greater than max sequence length. " +
+ errorMsgB[ithr] = std::string("Logit length cannot be greater than max sequence length. ") +
"Label length cannot be greater than a logit length" +
" and both cannot be negative.\nMaxSeqLen: " + std::to_string(maxTime) +
"; Logit len: " + std::to_string(logitsLength[b]) +
@@ -160,7 +158,7 @@ void CTCLoss::execute(dnnl::stream strm) {
if (!err.empty())
resErr += err + "\n";
}
- OPENVINO_THROW(resErr);
+ THROW_CPU_NODE_ERR(resErr);
}
const size_t TC = maxTime * classesNum;
diff --git a/src/plugins/intel_cpu/src/nodes/ctc_loss.h b/src/plugins/intel_cpu/src/nodes/ctc_loss.h
index 615a45abb12..6c24b47b1bd 100644
--- a/src/plugins/intel_cpu/src/nodes/ctc_loss.h
+++ b/src/plugins/intel_cpu/src/nodes/ctc_loss.h
@@ -30,8 +30,6 @@ private:
bool ctcMergeRepeated;
bool preprocessCollapseRepeated;
bool unique;
-
- std::string errorPrefix;
};
} // namespace node
diff --git a/src/plugins/intel_cpu/src/nodes/cum_sum.cpp b/src/plugins/intel_cpu/src/nodes/cum_sum.cpp
index 72c5749b89b..bbda16f94a8 100644
--- a/src/plugins/intel_cpu/src/nodes/cum_sum.cpp
+++ b/src/plugins/intel_cpu/src/nodes/cum_sum.cpp
@@ -37,16 +37,14 @@ CumSum::CumSum(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr con
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix = "CumSum layer with name '" + op->get_friendly_name() + "' ";
-
if ((getOriginalInputsNumber() != numOfInputs && getOriginalInputsNumber() != (numOfInputs - 1)) ||
getOriginalOutputsNumber() != 1)
- OPENVINO_THROW(errorPrefix, " has incorrect number of input/output edges!");
+ THROW_CPU_NODE_ERR("has incorrect number of input/output edges!");
const auto& dataShape = getInputShapeAtPort(CUM_SUM_DATA);
numOfDims = dataShape.getRank();
if (numOfDims < 1) {
- OPENVINO_THROW(errorPrefix, " doesn't support 'data' input tensor with rank: ", numOfDims);
+ THROW_CPU_NODE_ERR("doesn't support 'data' input tensor with rank: ", numOfDims);
}
const auto cumsum = ov::as_type_ptr<const ov::opset3::CumSum>(op);
@@ -59,11 +57,11 @@ CumSum::CumSum(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr con
if (getOriginalInputsNumber() == numOfInputs) {
const auto axis_shape = cumsum->get_input_partial_shape(AXIS);
if (axis_shape.is_dynamic() || !ov::is_scalar(axis_shape.to_shape()))
- OPENVINO_THROW(errorPrefix, " doesn't support 'axis' input tensor with non scalar rank");
+ THROW_CPU_NODE_ERR("doesn't support 'axis' input tensor with non scalar rank");
}
if (dataShape != getOutputShapeAtPort(0))
- OPENVINO_THROW(errorPrefix, " has different 'data' input and output dimensions");
+ THROW_CPU_NODE_ERR("has different 'data' input and output dimensions");
}
void CumSum::initSupportedPrimitiveDescriptors() {
@@ -81,12 +79,12 @@ void CumSum::initSupportedPrimitiveDescriptors() {
ov::element::bf16,
ov::element::f16,
ov::element::f32))
- OPENVINO_THROW(errorPrefix, " has unsupported 'data' input precision: ", dataPrecision.get_type_name());
+ THROW_CPU_NODE_ERR("has unsupported 'data' input precision: ", dataPrecision.get_type_name());
if (inputShapes.size() == numOfInputs) {
const auto& axisTensorPrec = getOriginalInputPrecisionAtPort(AXIS);
if (axisTensorPrec != ov::element::i32 && axisTensorPrec != ov::element::i64)
- OPENVINO_THROW(errorPrefix, " has unsupported 'axis' input precision: ", axisTensorPrec.get_type_name());
+ THROW_CPU_NODE_ERR("has unsupported 'axis' input precision: ", axisTensorPrec.get_type_name());
}
std::vector<PortConfigurator> inDataConf;
@@ -255,11 +253,11 @@ size_t CumSum::getAxis(const IMemory& _axis, const IMemory& _data) const {
break;
}
default: {
- OPENVINO_THROW(errorPrefix, " doesn't support 'axis' input with precision: ", axisPrecision.get_type_name());
+ THROW_CPU_NODE_ERR("doesn't support 'axis' input with precision: ", axisPrecision.get_type_name());
}
}
if (axisValueFromBlob < -dataShapeSize || axisValueFromBlob > dataShapeSize - 1)
- OPENVINO_THROW(errorPrefix, " has axis with a value out of range: ", axisValueFromBlob);
+ THROW_CPU_NODE_ERR("has axis with a value out of range: ", axisValueFromBlob);
return axisValueFromBlob >= 0 ? axisValueFromBlob : (axisValueFromBlob + dataShapeSize);
}
diff --git a/src/plugins/intel_cpu/src/nodes/cum_sum.h b/src/plugins/intel_cpu/src/nodes/cum_sum.h
index 39335930257..1b5070699c2 100644
--- a/src/plugins/intel_cpu/src/nodes/cum_sum.h
+++ b/src/plugins/intel_cpu/src/nodes/cum_sum.h
@@ -46,7 +46,6 @@ private:
size_t axis = 0;
ov::element::Type dataPrecision;
- std::string errorPrefix;
template <typename T>
struct CumSumExecute {
diff --git a/src/plugins/intel_cpu/src/nodes/deconv.cpp b/src/plugins/intel_cpu/src/nodes/deconv.cpp
index a911e00916c..a996249dc52 100644
--- a/src/plugins/intel_cpu/src/nodes/deconv.cpp
+++ b/src/plugins/intel_cpu/src/nodes/deconv.cpp
@@ -167,9 +167,8 @@ bool Deconvolution::isSupportedOperation(const std::shared_ptr<const ov::Node>&
Deconvolution::Deconvolution(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr context)
: Node(op, context, DeconfolutionShapeInferFactory(op)) {
std::string errorMessage;
- errorPrefix = "Deconvolution node with name '" + getName() + "' ";
if (!isSupportedOperation(op, errorMessage))
- OPENVINO_THROW_NOT_IMPLEMENTED(errorPrefix + errorMessage);
+ OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
const auto& weightDims = getWeightDims();
@@ -233,9 +232,7 @@ Deconvolution::Deconvolution(const std::shared_ptr<ov::Node>& op, const GraphCon
const auto spDimsNum = getInputShapeAtPort(0).getRank() - 2;
if (getInputShapeAtPort(2).getStaticDims()[0] != spDimsNum ||
(isConstOutShape && lastOutputSpatialDims.size() != spDimsNum)) {
- OPENVINO_THROW(errorPrefix,
- "'output_shape' input has incorrect number of elements. Expected = ",
- spDimsNum);
+ THROW_CPU_NODE_ERR("'output_shape' input has incorrect number of elements. Expected = ", spDimsNum);
}
}
@@ -408,7 +405,7 @@ std::pair<VectorDims, VectorDims> Deconvolution::makeDummyInOutShape() {
auto upper_bound =
deconvAttrs.stride[i] * static_cast<int32_t>(origInMaxDims[i + 2] - 1) - c1;
if (upper_bound < 0) {
- OPENVINO_THROW(errorPrefix, ": paddings for dummy shapes can't be computed");
+ THROW_CPU_NODE_ERR("paddings for dummy shapes can't be computed");
}
}
@@ -506,10 +503,10 @@ void Deconvolution::getSupportedDescriptors() {
fusedWith[fusedWith.size() - 1]->getOriginalOutputPrecisionAtPort(0));
}
if (getParentEdges().size() != (withBiases ? (biasPort + 1) : biasPort)) {
- OPENVINO_THROW(errorPrefix, " has incorrect number of input edges");
+ THROW_CPU_NODE_ERR("has incorrect number of input edges");
}
if (getChildEdges().empty()) {
- OPENVINO_THROW(errorPrefix, " has incorrect number of output edges");
+ THROW_CPU_NODE_ERR("has incorrect number of output edges");
}
VectorDims inDims, outDims;
std::tie(inDims, outDims) = makeDummyInOutShape();
diff --git a/src/plugins/intel_cpu/src/nodes/deconv.h b/src/plugins/intel_cpu/src/nodes/deconv.h
index 6f833ae232b..a9efed8806a 100644
--- a/src/plugins/intel_cpu/src/nodes/deconv.h
+++ b/src/plugins/intel_cpu/src/nodes/deconv.h
@@ -106,8 +106,6 @@ private:
bool withBiases = false;
size_t biasPort;
- std::string errorPrefix;
-
void createDnnlCompatibleWeights();
bool weightIsConst = false;
bool asymmetricPaddingAnd1x1 = false;
diff --git a/src/plugins/intel_cpu/src/nodes/def_conv.cpp b/src/plugins/intel_cpu/src/nodes/def_conv.cpp
index 6165e960837..4c44e8b5539 100644
--- a/src/plugins/intel_cpu/src/nodes/def_conv.cpp
+++ b/src/plugins/intel_cpu/src/nodes/def_conv.cpp
@@ -774,10 +774,9 @@ DeformableConvolution::DeformableConvolution(const std::shared_ptr<ov::Node>& op
if (!isSupportedOperation(op, errorMessage)) {
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix = "Deformable convolution with name '" + op->get_friendly_name() + "'";
auto defConvNodeBase = ov::as_type_ptr<ov::op::util::DeformableConvolutionBase>(op);
if (defConvNodeBase == nullptr)
- OPENVINO_THROW(errorPrefix, " is not an instance of DeformableConvolutionBase.");
+ THROW_CPU_NODE_ERR("is not an instance of DeformableConvolutionBase.");
defConvAttr.group = defConvNodeBase->get_group();
defConvAttr.deformable_group = defConvNodeBase->get_deformable_group();
@@ -798,7 +797,7 @@ DeformableConvolution::DeformableConvolution(const std::shared_ptr<ov::Node>& op
if (op->get_type_info() == ov::op::v8::DeformableConvolution::get_type_info_static()) {
auto defConvNode = ov::as_type_ptr<ov::op::v8::DeformableConvolution>(op);
if (defConvNode == nullptr)
- OPENVINO_THROW(errorPrefix, " is not an instance of DeformableConvolution from opset8.");
+ THROW_CPU_NODE_ERR("is not an instance of DeformableConvolution from opset8.");
defConvAttr.with_bilinear_pad = defConvNode->get_bilinear_interpolation_pad();
} else {
defConvAttr.with_bilinear_pad = false;
@@ -807,20 +806,20 @@ DeformableConvolution::DeformableConvolution(const std::shared_ptr<ov::Node>& op
void DeformableConvolution::getSupportedDescriptors() {
if (getParentEdges().size() != 3 && getParentEdges().size() != 4)
- OPENVINO_THROW(errorPrefix, " has incorrect number of input edges");
+ THROW_CPU_NODE_ERR("has incorrect number of input edges");
if (getChildEdges().empty())
- OPENVINO_THROW(errorPrefix, " has incorrect number of output edges");
+ THROW_CPU_NODE_ERR("has incorrect number of output edges");
if (getInputShapeAtPort(DATA_ID).getRank() != 4) {
- OPENVINO_THROW(errorPrefix, " has unsupported mode. Only 4D blobs are supported as input.");
+ THROW_CPU_NODE_ERR("has unsupported mode. Only 4D blobs are supported as input.");
}
if (getInputShapeAtPort(OFF_ID).getRank() != 4) {
- OPENVINO_THROW(errorPrefix, " doesn't support 1st input with rank: ", getInputShapeAtPort(OFF_ID).getRank());
+ THROW_CPU_NODE_ERR("doesn't support 1st input with rank: ", getInputShapeAtPort(OFF_ID).getRank());
}
if (getInputShapeAtPort(WEI_ID).getRank() != 4) {
- OPENVINO_THROW(errorPrefix, " doesn't support 2nd input with rank: ", getInputShapeAtPort(WEI_ID).getRank());
+ THROW_CPU_NODE_ERR("doesn't support 2nd input with rank: ", getInputShapeAtPort(WEI_ID).getRank());
}
if (getOutputShapeAtPort(DATA_ID).getRank() != 4) {
- OPENVINO_THROW(errorPrefix, " doesn't support output with rank: ", getOutputShapeAtPort(DATA_ID).getRank());
+ THROW_CPU_NODE_ERR("doesn't support output with rank: ", getOutputShapeAtPort(DATA_ID).getRank());
}
}
@@ -1225,23 +1224,23 @@ void DeformableConvolution::prepareParams() {
auto weiMemPtr = getSrcMemoryAtPort(WEI_ID);
if (!dstMemPtr || !dstMemPtr->isDefined())
- OPENVINO_THROW(errorPrefix, " has undefined destination memory");
+ THROW_CPU_NODE_ERR("has undefined destination memory");
if (!srcMemPtr || !srcMemPtr->isDefined())
- OPENVINO_THROW(errorPrefix, " has undefined input memory");
+ THROW_CPU_NODE_ERR("has undefined input memory");
if (!offMemPtr || !offMemPtr->isDefined())
- OPENVINO_THROW(errorPrefix, " has undefined offsets shape memory");
+ THROW_CPU_NODE_ERR("has undefined offsets shape memory");
if (!weiMemPtr || !weiMemPtr->isDefined())
- OPENVINO_THROW(errorPrefix, " has undefined weights memory");
+ THROW_CPU_NODE_ERR("has undefined weights memory");
if (getOriginalInputsNumber() > 3) {
auto modMemPtr = getSrcMemoryAtPort(MOD_ID);
if (!modMemPtr || !modMemPtr->isDefined())
- OPENVINO_THROW(errorPrefix, " has undefined modulations memory");
+ THROW_CPU_NODE_ERR("has undefined modulations memory");
}
auto selectedPrimitiveDescriptor = getSelectedPrimitiveDescriptor();
if (!selectedPrimitiveDescriptor)
- OPENVINO_THROW(errorPrefix, "' doesn't have primitive descriptors.");
+ THROW_CPU_NODE_ERR("doesn't have primitive descriptors.");
auto config = selectedPrimitiveDescriptor->getConfig();
bool withModulation = getParentEdges().size() > 3;
diff --git a/src/plugins/intel_cpu/src/nodes/def_conv.h b/src/plugins/intel_cpu/src/nodes/def_conv.h
index 5859c032fe6..066ac7c0e61 100644
--- a/src/plugins/intel_cpu/src/nodes/def_conv.h
+++ b/src/plugins/intel_cpu/src/nodes/def_conv.h
@@ -108,7 +108,6 @@ private:
static constexpr size_t OFF_ID = 1;
static constexpr size_t WEI_ID = 2;
static constexpr size_t MOD_ID = 3;
- std::string errorPrefix;
class DefConvExecutor {
public:
DefConvExecutor(const DefConvAttr& defConvAttr,
diff --git a/src/plugins/intel_cpu/src/nodes/detection_output.cpp b/src/plugins/intel_cpu/src/nodes/detection_output.cpp
index 5f253367426..416f47a7c0f 100644
--- a/src/plugins/intel_cpu/src/nodes/detection_output.cpp
+++ b/src/plugins/intel_cpu/src/nodes/detection_output.cpp
@@ -55,13 +55,11 @@ DetectionOutput::DetectionOutput(const std::shared_ptr<ov::Node>& op, const Grap
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix = "DetectionOutput node with name '" + getName() + "' ";
-
if (getOriginalInputsNumber() != 3 && getOriginalInputsNumber() != 5)
- OPENVINO_THROW(errorPrefix, "has incorrect number of input edges.");
+ THROW_CPU_NODE_ERR("has incorrect number of input edges.");
if (getOriginalOutputsNumber() != 1)
- OPENVINO_THROW(errorPrefix, "has incorrect number of output edges.");
+ THROW_CPU_NODE_ERR("has incorrect number of output edges.");
auto doOp = ov::as_type_ptr<const ov::op::v8::DetectionOutput>(op);
auto attributes = doOp->get_attrs();
@@ -101,19 +99,17 @@ void DetectionOutput::prepareParams() {
const auto& idLocDims = getParentEdgeAt(ID_LOC)->getMemory().getShape().getStaticDims();
if (priorsNum * locNumForClasses * 4 != static_cast<int>(idLocDims[1]))
- OPENVINO_THROW(errorPrefix,
- "has incorrect number of priors, which must match number of location predictions (",
- priorsNum * locNumForClasses * 4,
- " vs ",
- idLocDims[1],
- ")");
+ THROW_CPU_NODE_ERR("has incorrect number of priors, which must match number of location predictions (",
+ priorsNum * locNumForClasses * 4,
+ " vs ",
+ idLocDims[1],
+ ")");
if (priorsNum * classesNum != static_cast<int>(idConfDims.back()))
- OPENVINO_THROW(errorPrefix,
- "has incorrect number of priors, which must match number of confidence predictions.");
+ THROW_CPU_NODE_ERR("has incorrect number of priors, which must match number of confidence predictions.");
if (decreaseClassId && backgroundClassId != 0)
- OPENVINO_THROW(errorPrefix, "cannot use decrease_label_id and background_label_id parameter simultaneously.");
+ THROW_CPU_NODE_ERR("cannot use decrease_label_id and background_label_id parameter simultaneously.");
imgNum = static_cast<int>(idConfDims[0]);
@@ -923,7 +919,7 @@ inline void DetectionOutput::generateOutput(float* reorderedConfData,
const int numResults = outDims[2];
const int DETECTION_SIZE = outDims[3];
if (DETECTION_SIZE != 7) {
- OPENVINO_THROW_NOT_IMPLEMENTED(errorPrefix);
+ THROW_CPU_NODE_ERR("has unsupported output layout.");
}
int dstDataSize = 0;
@@ -935,7 +931,7 @@ inline void DetectionOutput::generateOutput(float* reorderedConfData,
dstDataSize = imgNum * classesNum * priorsNum * DETECTION_SIZE * sizeof(float);
if (static_cast<size_t>(dstDataSize) > getChildEdgeAt(0)->getMemory().getSize()) {
- OPENVINO_THROW(errorPrefix, ": OUT_OF_BOUNDS");
+ THROW_CPU_NODE_ERR("has insufficient output buffer size.");
}
memset(dstData, 0, dstDataSize);
diff --git a/src/plugins/intel_cpu/src/nodes/detection_output.h b/src/plugins/intel_cpu/src/nodes/detection_output.h
index 80c2859146e..e5ed8951d63 100644
--- a/src/plugins/intel_cpu/src/nodes/detection_output.h
+++ b/src/plugins/intel_cpu/src/nodes/detection_output.h
@@ -130,8 +130,6 @@ private:
std::vector<float> bboxSizes;
std::vector<int> numPriorsActual;
std::vector<int> confInfoForPrior;
-
- std::string errorPrefix;
};
} // namespace node
diff --git a/src/plugins/intel_cpu/src/nodes/dft.cpp b/src/plugins/intel_cpu/src/nodes/dft.cpp
index 4a675787a7e..5042a5e0abb 100644
--- a/src/plugins/intel_cpu/src/nodes/dft.cpp
+++ b/src/plugins/intel_cpu/src/nodes/dft.cpp
@@ -49,29 +49,28 @@ DFT::DFT(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr context)
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- layerErrorPrefix = "DFT layer with name '" + op->get_name() + "'";
const size_t inputsNumber = getOriginalInputsNumber();
if (inputsNumber != 2 && inputsNumber != 3) {
- OPENVINO_THROW(layerErrorPrefix, " has invalid number of input/output edges: ", inputsNumber);
+ THROW_CPU_NODE_ERR("has invalid number of input/output edges: ", inputsNumber);
}
/* Data */
inputShape = inputShapes[DATA_INDEX].getStaticDims();
if (inputShape.size() < 2) {
- OPENVINO_THROW(layerErrorPrefix, " has invalid 'data' input tensor with rank: ", inputShape.size());
+ THROW_CPU_NODE_ERR("has invalid 'data' input tensor with rank: ", inputShape.size());
}
/* Axes */
const auto axesRank = inputShapes[AXES_INDEX].getRank();
if (axesRank != 1) {
- OPENVINO_THROW(layerErrorPrefix, " has invalid 'axes' input tensor with rank: ", axesRank);
+ THROW_CPU_NODE_ERR("has invalid 'axes' input tensor with rank: ", axesRank);
}
/* Signal size */
if (inputsNumber > SIGNAL_SIZE_INDEX) {
const auto signalSizeRank = inputShapes[SIGNAL_SIZE_INDEX].getRank();
if (signalSizeRank != 1) {
- OPENVINO_THROW(layerErrorPrefix, " has invalid 'signal_size' input tensor with rank: ", signalSizeRank);
+ THROW_CPU_NODE_ERR("has invalid 'signal_size' input tensor with rank: ", signalSizeRank);
}
}
@@ -87,20 +86,18 @@ void DFT::initSupportedPrimitiveDescriptors() {
const auto& dataPrecision = getOriginalInputPrecisionAtPort(DATA_INDEX);
if (!dataPrecision.is_real()) {
- OPENVINO_THROW(layerErrorPrefix, " has unsupported 'data' input precision: ", dataPrecision.get_type_name());
+ THROW_CPU_NODE_ERR("has unsupported 'data' input precision: ", dataPrecision.get_type_name());
}
const auto& axesPrecision = getOriginalInputPrecisionAtPort(AXES_INDEX);
if (axesPrecision != ov::element::i32 && axesPrecision != ov::element::i64) {
- OPENVINO_THROW(layerErrorPrefix, " has unsupported 'axes' input precision: ", axesPrecision.get_type_name());
+ THROW_CPU_NODE_ERR("has unsupported 'axes' input precision: ", axesPrecision.get_type_name());
}
if (inputShapes.size() > SIGNAL_SIZE_INDEX) {
const auto& signalSizeTensorPrec = getOriginalInputPrecisionAtPort(SIGNAL_SIZE_INDEX);
if (signalSizeTensorPrec != ov::element::i32 && signalSizeTensorPrec != ov::element::i64) {
- OPENVINO_THROW(layerErrorPrefix,
- " has unsupported 'signal_size' input precision: ",
- signalSizeTensorPrec.get_type_name());
+ THROW_CPU_NODE_ERR("has unsupported 'signal_size' input precision: ", signalSizeTensorPrec.get_type_name());
}
}
diff --git a/src/plugins/intel_cpu/src/nodes/dft.h b/src/plugins/intel_cpu/src/nodes/dft.h
index 2789f22fa7c..7d7cabcf458 100644
--- a/src/plugins/intel_cpu/src/nodes/dft.h
+++ b/src/plugins/intel_cpu/src/nodes/dft.h
@@ -53,7 +53,6 @@ private:
std::vector<int32_t> axes;
std::vector<size_t> inputShape;
- std::string layerErrorPrefix;
const size_t DATA_INDEX = 0;
const size_t AXES_INDEX = 1;
const size_t SIGNAL_SIZE_INDEX = 2;
diff --git a/src/plugins/intel_cpu/src/nodes/eltwise.cpp b/src/plugins/intel_cpu/src/nodes/eltwise.cpp
index 12312eac3e8..55e265a2008 100644
--- a/src/plugins/intel_cpu/src/nodes/eltwise.cpp
+++ b/src/plugins/intel_cpu/src/nodes/eltwise.cpp
@@ -3065,8 +3065,6 @@ void Eltwise::appendPostOpsImpl(dnnl::post_ops& ops,
const VectorDims& postOpDims,
std::vector<T>& postOpsMem,
const int channelAxis) {
- const std::string errorPrefix = "Appending Eltwise node with name '" + getName() + "' ";
-
if (getOneDnnAlgorithm() != dnnl::algorithm::undef) {
switch (getOneDnnAlgorithm()) {
case dnnl::algorithm::eltwise_relu:
@@ -3091,7 +3089,7 @@ void Eltwise::appendPostOpsImpl(dnnl::post_ops& ops,
ops.append_eltwise(getOneDnnAlgorithm(), getAlpha(), getBeta());
break;
default:
- OPENVINO_THROW(errorPrefix, "as post operation is not supported");
+ THROW_CPU_NODE_ERR("Appending Eltwise node with name '", getName(), "' as post operation is not supported");
}
} else {
// per-tensor EltwisePowerStatic can be implemented with more well-supported eltwise postOps
@@ -3119,7 +3117,9 @@ void Eltwise::appendPostOpsImpl(dnnl::post_ops& ops,
if (scales.size() == 1) {
depthwiseData.resize(channelSize, depthwiseData.back());
} else if (scales.size() != channelSize) {
- OPENVINO_THROW(errorPrefix, "failed due to scales data size inconsistency");
+ OPENVINO_THROW("Appending Eltwise node with name '",
+ getName(),
+ "' failed due to scales data size inconsistency");
}
depthwiseData.insert(depthwiseData.end(), shifts.begin(), shifts.end());
if (shifts.empty()) {
@@ -3128,7 +3128,9 @@ void Eltwise::appendPostOpsImpl(dnnl::post_ops& ops,
} else if (shifts.size() == 1) {
depthwiseData.resize(2 * channelSize, depthwiseData.back());
} else if (shifts.size() != channelSize) {
- OPENVINO_THROW(errorPrefix, "failed due to shifts data size inconsistency");
+ OPENVINO_THROW("Appending Eltwise node with name '",
+ getName(),
+ "' failed due to shifts data size inconsistency");
}
depthwiseDataSize = 2 * channelSize;
@@ -3139,7 +3141,7 @@ void Eltwise::appendPostOpsImpl(dnnl::post_ops& ops,
}
if (depthwiseData.empty())
- OPENVINO_THROW(errorPrefix, "cannot be performed since buffers are not allocated");
+ THROW_CPU_NODE_ERR("cannot be performed since buffers are not allocated");
std::array<size_t, 2> offsets = {0};
offsets[1] = offsets[0] + channelSize;
@@ -3160,7 +3162,7 @@ void Eltwise::appendPostOpsImpl(dnnl::post_ops& ops,
ops.append_depthwise(dnnl::algorithm::depthwise_prelu, offsets);
break;
default:
- OPENVINO_THROW(errorPrefix, "as post operation is not supported");
+ THROW_CPU_NODE_ERR("as post operation is not supported");
}
appendMemory(depthwiseData, depthwiseMemory, postOpsMem);
@@ -3192,8 +3194,6 @@ bool Eltwise::appendAttrPostOps(DnnlPostOpsComposerLegacy& dnnlpoc,
bool isLastPostOp,
dnnl::memory::data_type outDataType,
bool allowBinary) {
- const std::string errorPrefix = "Appending Eltwise node with name '" + getName() + "' as binary post op ";
-
if (getOneDnnAlgorithm() != dnnl::algorithm::undef) {
switch (getOneDnnAlgorithm()) {
case dnnl::algorithm::eltwise_relu:
@@ -3221,7 +3221,7 @@ bool Eltwise::appendAttrPostOps(DnnlPostOpsComposerLegacy& dnnlpoc,
dnnlpoc.appendLinear({getAlpha()}, {getBeta()}, isLastPostOp);
break;
default:
- OPENVINO_THROW(errorPrefix, "as post operation is not supported");
+ THROW_CPU_NODE_ERR("as post operation is not supported");
}
} else {
switch (getAlgorithm()) {
@@ -3248,7 +3248,7 @@ bool Eltwise::appendAttrPostOps(DnnlPostOpsComposerLegacy& dnnlpoc,
dnnlpoc.appendBinary(dnnl::algorithm::binary_prelu, scales);
break;
default:
- OPENVINO_THROW(errorPrefix, "as post operation is not supported");
+ THROW_CPU_NODE_ERR("as post operation is not supported");
}
}
return true;
diff --git a/src/plugins/intel_cpu/src/nodes/executors/interpolate.cpp b/src/plugins/intel_cpu/src/nodes/executors/interpolate.cpp
index 8e50b133506..189ae24bac8 100644
--- a/src/plugins/intel_cpu/src/nodes/executors/interpolate.cpp
+++ b/src/plugins/intel_cpu/src/nodes/executors/interpolate.cpp
@@ -131,7 +131,7 @@ float ov::intel_cpu::InterpolateExecutor::coordTransToInput(int outCoord,
break;
}
default: {
- OPENVINO_THROW("errorPrefix", " does not support specified coordinate transformation mode");
+ OPENVINO_THROW("Interpolate executor does not support specified coordinate transformation mode");
break;
}
}
@@ -167,7 +167,7 @@ int ov::intel_cpu::InterpolateExecutor::nearestRound(float originCoord,
return static_cast<int>(originCoord);
}
default: {
- OPENVINO_THROW("errorPrefix", " does not support specified nearest round mode");
+ OPENVINO_THROW("Interpolate executor does not support specified nearest round mode");
break;
}
}
@@ -547,7 +547,7 @@ const uint8_t* ov::intel_cpu::InterpolateExecutor::padPreprocess(const std::vect
srcPadded.resize(eltsTotal * srcDataSize, 0x0);
uint8_t* src_data_pad = static_cast<uint8_t*>(&srcPadded[0]);
if ((srcDim5d[0] != srcDimPad5d[0]) || (srcDim5d[1] != srcDimPad5d[1])) {
- OPENVINO_THROW("Interpolate layer with name does not support padding on batch and channel dimensions");
+ OPENVINO_THROW("Interpolate executor does not support padding on batch and channel dimensions");
}
parallel_for5d(
srcDim5d[0],
diff --git a/src/plugins/intel_cpu/src/nodes/experimental_detectron_priorgridgenerator.cpp b/src/plugins/intel_cpu/src/nodes/experimental_detectron_priorgridgenerator.cpp
index e9c7b2e0e0a..873750b5a13 100644
--- a/src/plugins/intel_cpu/src/nodes/experimental_detectron_priorgridgenerator.cpp
+++ b/src/plugins/intel_cpu/src/nodes/experimental_detectron_priorgridgenerator.cpp
@@ -35,10 +35,9 @@ ExperimentalDetectronPriorGridGenerator::ExperimentalDetectronPriorGridGenerator
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix = "ExperimentalDetectronPriorGridGenerator layer with name '" + op->get_friendly_name() + "'";
const auto priorGridGen = ov::as_type_ptr<const ov::opset6::ExperimentalDetectronPriorGridGenerator>(op);
if (getOriginalInputsNumber() != 3 || getOriginalOutputsNumber() != 1)
- OPENVINO_THROW(errorPrefix, " has incorrect number of input/output edges!");
+ THROW_CPU_NODE_ERR("has incorrect number of input/output edges!");
const auto& attr = priorGridGen->get_attrs();
grid_w_ = attr.w;
diff --git a/src/plugins/intel_cpu/src/nodes/experimental_detectron_priorgridgenerator.h b/src/plugins/intel_cpu/src/nodes/experimental_detectron_priorgridgenerator.h
index 116187039b8..37b0d81300c 100644
--- a/src/plugins/intel_cpu/src/nodes/experimental_detectron_priorgridgenerator.h
+++ b/src/plugins/intel_cpu/src/nodes/experimental_detectron_priorgridgenerator.h
@@ -43,8 +43,6 @@ private:
int grid_h_;
float stride_w_;
float stride_h_;
-
- std::string errorPrefix;
};
} // namespace node
diff --git a/src/plugins/intel_cpu/src/nodes/experimental_detectron_topkrois.cpp b/src/plugins/intel_cpu/src/nodes/experimental_detectron_topkrois.cpp
index e6b385a1d28..096e5bebf2f 100644
--- a/src/plugins/intel_cpu/src/nodes/experimental_detectron_topkrois.cpp
+++ b/src/plugins/intel_cpu/src/nodes/experimental_detectron_topkrois.cpp
@@ -38,7 +38,6 @@ ExperimentalDetectronTopKROIs::ExperimentalDetectronTopKROIs(const std::shared_p
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix = "ExperimentalDetectronTopKROIs layer with name '" + op->get_friendly_name() + "'";
const auto topKROI = ov::as_type_ptr<const ov::opset6::ExperimentalDetectronTopKROIs>(op);
if (topKROI == nullptr)
OPENVINO_THROW("Operation with name '",
@@ -46,10 +45,10 @@ ExperimentalDetectronTopKROIs::ExperimentalDetectronTopKROIs(const std::shared_p
"' is not an instance of ExperimentalDetectronTopKROIs from opset6.");
if (inputShapes.size() != 2 || outputShapes.size() != 1)
- OPENVINO_THROW(errorPrefix, " has incorrect number of input/output edges!");
+ THROW_CPU_NODE_ERR("has incorrect number of input/output edges!");
if (getInputShapeAtPort(INPUT_ROIS).getRank() != 2 || getInputShapeAtPort(INPUT_PROBS).getRank() != 1)
- OPENVINO_THROW(errorPrefix, " has unsupported input shape");
+ THROW_CPU_NODE_ERR("has unsupported input shape");
max_rois_num_ = topKROI->get_max_rois();
}
diff --git a/src/plugins/intel_cpu/src/nodes/experimental_detectron_topkrois.h b/src/plugins/intel_cpu/src/nodes/experimental_detectron_topkrois.h
index 0c71974fdca..5e328d224d4 100644
--- a/src/plugins/intel_cpu/src/nodes/experimental_detectron_topkrois.h
+++ b/src/plugins/intel_cpu/src/nodes/experimental_detectron_topkrois.h
@@ -43,8 +43,6 @@ private:
const int OUTPUT_ROIS{0};
int max_rois_num_;
-
- std::string errorPrefix;
};
} // namespace node
diff --git a/src/plugins/intel_cpu/src/nodes/extract_image_patches.cpp b/src/plugins/intel_cpu/src/nodes/extract_image_patches.cpp
index a60c3db28f3..534f5a518ad 100644
--- a/src/plugins/intel_cpu/src/nodes/extract_image_patches.cpp
+++ b/src/plugins/intel_cpu/src/nodes/extract_image_patches.cpp
@@ -364,22 +364,20 @@ ExtractImagePatches::ExtractImagePatches(const std::shared_ptr<ov::Node>& op, co
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix = "ExtractImagePatches layer with name '" + op->get_friendly_name() + "' ";
auto extImgPatcher = ov::as_type_ptr<const ov::opset3::ExtractImagePatches>(op);
if (inputShapes.size() != 1 || outputShapes.size() != 1)
- OPENVINO_THROW(errorPrefix,
- "has incorrect number of input or output edges!",
- " Input: ",
- inputShapes.size(),
- "); Output: ",
- outputShapes.size());
+ THROW_CPU_NODE_ERR("has incorrect number of input or output edges!",
+ " Input: ",
+ inputShapes.size(),
+ "); Output: ",
+ outputShapes.size());
if (getInputShapeAtPort(0).getRank() != 4)
- OPENVINO_THROW(errorPrefix, "must have 4D input tensor. Actual: ", getInputShapeAtPort(0).getRank());
+ THROW_CPU_NODE_ERR("must have 4D input tensor. Actual: ", getInputShapeAtPort(0).getRank());
if (getOutputShapeAtPort(0).getRank() != 4)
- OPENVINO_THROW(errorPrefix, "must have 4D output tensor. Actual: ", getOutputShapeAtPort(0).getRank());
+ THROW_CPU_NODE_ERR("must have 4D output tensor. Actual: ", getOutputShapeAtPort(0).getRank());
if (extImgPatcher->get_auto_pad() == ov::op::PadType::VALID) {
_auto_pad = ExtImgPatcherPadType::VALID;
@@ -388,7 +386,7 @@ ExtractImagePatches::ExtractImagePatches(const std::shared_ptr<ov::Node>& op, co
} else if (extImgPatcher->get_auto_pad() == ov::op::PadType::SAME_UPPER) {
_auto_pad = ExtImgPatcherPadType::SAME_UPPER;
} else {
- OPENVINO_THROW(errorPrefix, "has unsupported pad type: ", extImgPatcher->get_auto_pad());
+ THROW_CPU_NODE_ERR("has unsupported pad type: ", extImgPatcher->get_auto_pad());
}
_ksizes = extImgPatcher->get_sizes();
@@ -396,7 +394,7 @@ ExtractImagePatches::ExtractImagePatches(const std::shared_ptr<ov::Node>& op, co
_strides = extImgPatcher->get_strides();
_rates = extImgPatcher->get_rates();
if (_ksizes.size() != 2 || _strides.size() != 2 || _rates.size() != 2)
- OPENVINO_THROW(errorPrefix, "must have the following attributes with shape {2}: sizes, strides, rates.");
+ THROW_CPU_NODE_ERR("must have the following attributes with shape {2}: sizes, strides, rates.");
}
void ExtractImagePatches::prepareParams() {
@@ -444,7 +442,7 @@ void ExtractImagePatches::initSupportedPrimitiveDescriptors() {
const auto precision = getOriginalInputPrecisionAtPort(0);
if (_supported_precisions_sizes.find(precision.size()) == _supported_precisions_sizes.end())
- OPENVINO_THROW(errorPrefix, "has unsupported precision: ", precision.get_type_name());
+ THROW_CPU_NODE_ERR("has unsupported precision: ", precision.get_type_name());
addSupportedPrimDesc({{LayoutType::ncsp, precision}}, {{LayoutType::ncsp, precision}}, impl_desc_type::ref_any);
}
diff --git a/src/plugins/intel_cpu/src/nodes/extract_image_patches.h b/src/plugins/intel_cpu/src/nodes/extract_image_patches.h
index bb1a45a9f01..f4f3ecc5090 100644
--- a/src/plugins/intel_cpu/src/nodes/extract_image_patches.h
+++ b/src/plugins/intel_cpu/src/nodes/extract_image_patches.h
@@ -63,8 +63,6 @@ private:
static const std::set<size_t> _supported_precisions_sizes;
ExtImgPatcherPadType _auto_pad;
- std::string errorPrefix;
-
struct ExtractImagePatchesExecutor {
ExtractImagePatchesExecutor() = default;
virtual void exec(void* src, void* dst, const VectorDims& istrides, const VectorDims& ostrides) = 0;
diff --git a/src/plugins/intel_cpu/src/nodes/eye.cpp b/src/plugins/intel_cpu/src/nodes/eye.cpp
index deb47abdba2..57fbdd66d03 100644
--- a/src/plugins/intel_cpu/src/nodes/eye.cpp
+++ b/src/plugins/intel_cpu/src/nodes/eye.cpp
@@ -53,15 +53,15 @@ Eye::Eye(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr context)
outType = op->get_output_element_type(0);
withBatchShape = (op->get_input_size() == 4);
if (!one_of(outType, ov::element::f32, ov::element::bf16, ov::element::i32, ov::element::i8, ov::element::u8)) {
- THROW_ERROR(errorPrefix, "doesn't support demanded output precision");
+ THROW_CPU_NODE_ERR("doesn't support demanded output precision");
}
}
void Eye::getSupportedDescriptors() {
if (!one_of(getParentEdges().size(), 3u, 4u))
- THROW_ERROR(errorPrefix, "has incorrect number of input edges: ", getParentEdges().size());
+ THROW_CPU_NODE_ERR("has incorrect number of input edges: ", getParentEdges().size());
if (getChildEdges().empty())
- THROW_ERROR(errorPrefix, "has incorrect number of output edges: ", getChildEdges().size());
+ THROW_CPU_NODE_ERR("has incorrect number of output edges: ", getChildEdges().size());
}
template <typename T>
@@ -106,7 +106,7 @@ void Eye::executeSpecified() {
const int64_t shift = getDiagIndex();
auto outPtr = getDstMemoryAtPort(0);
if (!outPtr || !outPtr->isDefined())
- THROW_ERROR(errorPrefix, "Destination memory is undefined.");
+ THROW_CPU_NODE_ERR("Destination memory is undefined.");
T* dst = outPtr->getDataAs<T>();
const size_t batchVolume = getBatchVolume(getBatchShape());
diff --git a/src/plugins/intel_cpu/src/nodes/eye.h b/src/plugins/intel_cpu/src/nodes/eye.h
index fc2b42a18bd..52f78e7cc33 100644
--- a/src/plugins/intel_cpu/src/nodes/eye.h
+++ b/src/plugins/intel_cpu/src/nodes/eye.h
@@ -43,7 +43,6 @@ public:
static bool isSupportedOperation(const std::shared_ptr<const ov::Node>& op, std::string& errorMessage) noexcept;
private:
- std::string errorPrefix = "";
ov::element::Type outType = ov::element::Type_t::undefined;
template <typename inputType>
void executeSpecified();
@@ -52,7 +51,7 @@ private:
inline const size_t getRowNum() const {
auto rowMem = getSrcMemoryAtPort(ROWS_NUM);
if (rowMem == nullptr)
- OPENVINO_THROW(errorPrefix, " doesn't contain row_count data");
+ THROW_CPU_NODE_ERR("doesn't contain row_count data");
const int* rowPtr = rowMem->getDataAs<const int>();
return rowPtr[0];
@@ -60,7 +59,7 @@ private:
inline const size_t getColNum() const {
auto colMem = getSrcMemoryAtPort(COLS_NUM);
if (colMem == nullptr)
- OPENVINO_THROW(errorPrefix, " doesn't contain col_count data");
+ THROW_CPU_NODE_ERR("doesn't contain col_count data");
const int* colPtr = colMem->getDataAs<const int>();
return colPtr[0];
@@ -68,7 +67,7 @@ private:
inline const int getDiagIndex() const {
auto diagIndMem = getSrcMemoryAtPort(DIAGONAL_INDEX);
if (diagIndMem == nullptr)
- OPENVINO_THROW(errorPrefix, " doesn't contain diag_index data");
+ THROW_CPU_NODE_ERR("doesn't contain diag_index data");
const int* diagIndexPtr = diagIndMem->getDataAs<const int>();
return diagIndexPtr[0];
diff --git a/src/plugins/intel_cpu/src/nodes/fake_quantize.cpp b/src/plugins/intel_cpu/src/nodes/fake_quantize.cpp
index 431c6f133e1..e7105f4f016 100644
--- a/src/plugins/intel_cpu/src/nodes/fake_quantize.cpp
+++ b/src/plugins/intel_cpu/src/nodes/fake_quantize.cpp
@@ -1063,15 +1063,14 @@ FakeQuantize::FakeQuantize(const std::shared_ptr<ov::Node>& op, const GraphConte
algorithm = Algorithm::FQCommon;
const auto fq = ov::as_type_ptr<const ov::opset1::FakeQuantize>(op);
- errorPrefix = "FakeQuantize node with name '" + getName() + "' ";
levels = fq->get_levels();
if (levels <= 1)
- OPENVINO_THROW(errorPrefix, "supports 'levels' attribute greater than or equal to 2");
+ THROW_CPU_NODE_ERR("supports 'levels' attribute greater than or equal to 2");
if (inputShapes.size() != 5)
- OPENVINO_THROW(errorPrefix, "has incorrect number of input edges: ", inputShapes.size());
+ THROW_CPU_NODE_ERR("has incorrect number of input edges: ", inputShapes.size());
if (outputShapes.size() != 1)
- OPENVINO_THROW(errorPrefix, "has incorrect number of output edges: ", outputShapes.size());
+ THROW_CPU_NODE_ERR("has incorrect number of output edges: ", outputShapes.size());
auto initAxisIdx = [&](const VectorDims& inputDims) {
size_t axisIdx = 0;
@@ -1126,7 +1125,7 @@ FakeQuantize::FakeQuantize(const std::shared_ptr<ov::Node>& op, const GraphConte
auto outputHighAxisSize = ov::is_scalar(ohShape) ? 1 : ohShape[outputHighAxis];
if (axisSize != -1 && !dimsEqualWeak(axisSize, getInputShapeAtPort(0).getDims()[axis])) {
- OPENVINO_THROW(errorPrefix, "has different quantization axis size on 'data' and 'range' inputs");
+ THROW_CPU_NODE_ERR("has different quantization axis size on 'data' and 'range' inputs");
}
const auto inputLowNode = ov::as_type_ptr<const ov::opset1::Constant>(fq->get_input_node_shared_ptr(1));
@@ -1411,25 +1410,25 @@ void FakeQuantize::init() {
void FakeQuantize::getSupportedDescriptors() {
if (getParentEdges().size() != 5)
- OPENVINO_THROW(errorPrefix, "has incorrect number of input edges: ", getParentEdges().size());
+ THROW_CPU_NODE_ERR("has incorrect number of input edges: ", getParentEdges().size());
if (getChildEdges().empty())
- OPENVINO_THROW(errorPrefix, "has incorrect number of output edges: ", getChildEdges().size());
+ THROW_CPU_NODE_ERR("has incorrect number of output edges: ", getChildEdges().size());
if (getInputShapeAtPort(0).getRank() != getOutputShapeAtPort(0).getRank()) {
- OPENVINO_THROW(errorPrefix, "has different ranks for input and output tensors");
+ THROW_CPU_NODE_ERR("has different ranks for input and output tensors");
}
if (isBinarization()) {
if (getInputShapeAtPort(0).getRank() != 4ul) {
- OPENVINO_THROW(errorPrefix, "doesn't support input/output rank != 4");
+ THROW_CPU_NODE_ERR("doesn't support input/output rank != 4");
}
}
if (getAxis() != 1) {
if (isBinarization())
- OPENVINO_THROW(errorPrefix, "doesn't support non per-tensor binarization for axis: ", getAxis());
+ THROW_CPU_NODE_ERR("doesn't support non per-tensor binarization for axis: ", getAxis());
if (getAxis() != 0)
- OPENVINO_THROW(errorPrefix, "doesn't support non per-tensor quantization for axis: ", getAxis());
+ THROW_CPU_NODE_ERR("doesn't support non per-tensor quantization for axis: ", getAxis());
}
}
diff --git a/src/plugins/intel_cpu/src/nodes/fake_quantize.h b/src/plugins/intel_cpu/src/nodes/fake_quantize.h
index 13ee001a314..4f985df4cda 100644
--- a/src/plugins/intel_cpu/src/nodes/fake_quantize.h
+++ b/src/plugins/intel_cpu/src/nodes/fake_quantize.h
@@ -320,8 +320,6 @@ private:
ov::element::Type inputPrecision = ov::element::f32;
ov::element::Type outputPrecision = ov::element::f32;
- std::string errorPrefix;
-
BroadcastingPolicy broadcastingPolicy;
};
diff --git a/src/plugins/intel_cpu/src/nodes/fullyconnected.cpp b/src/plugins/intel_cpu/src/nodes/fullyconnected.cpp
index 99d8ac35e34..decbea94be8 100644
--- a/src/plugins/intel_cpu/src/nodes/fullyconnected.cpp
+++ b/src/plugins/intel_cpu/src/nodes/fullyconnected.cpp
@@ -168,8 +168,7 @@ void FullyConnected::initTensorParallelConfig(const GraphContext::CPtr context)
}
FullyConnected::FullyConnected(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr context)
- : Node(op, context, FCShapeInferFactory(op)),
- errorPrefix("FullyConnected node with name '" + getName() + "'") {
+ : Node(op, context, FCShapeInferFactory(op)) {
std::string errorMessage;
initTensorParallelConfig(context);
if (!isSupportedOperation(op, errorMessage))
diff --git a/src/plugins/intel_cpu/src/nodes/fullyconnected.h b/src/plugins/intel_cpu/src/nodes/fullyconnected.h
index ff04bd01f85..0338b9906a5 100644
--- a/src/plugins/intel_cpu/src/nodes/fullyconnected.h
+++ b/src/plugins/intel_cpu/src/nodes/fullyconnected.h
@@ -123,7 +123,6 @@ private:
MemoryArgs memory;
ExecutorFactoryPtr<FCAttrs> factory;
ExecutorPtr executor = nullptr;
- std::string errorPrefix;
FCTensorParallelConfig tp_cfg;
};
diff --git a/src/plugins/intel_cpu/src/nodes/gather_elements.cpp b/src/plugins/intel_cpu/src/nodes/gather_elements.cpp
index 34b70afde5f..61dbe2f635e 100644
--- a/src/plugins/intel_cpu/src/nodes/gather_elements.cpp
+++ b/src/plugins/intel_cpu/src/nodes/gather_elements.cpp
@@ -37,22 +37,20 @@ GatherElements::GatherElements(const std::shared_ptr<ov::Node>& op, const GraphC
if (!isSupportedOperation(op, errorMessage)) {
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix_ = std::string("Layer GatherElements with name '") + op->get_friendly_name() + "'";
-
if (inputShapes.size() != 2 || outputShapes.size() != 1)
- OPENVINO_THROW(errorPrefix_, " has invalid number of input/output edges.");
+ THROW_CPU_NODE_ERR(" has invalid number of input/output edges.");
const auto dataRank = getInputShapeAtPort(dataIndex_).getRank();
const auto indicesRank = getInputShapeAtPort(indicesIndex_).getRank();
if (dataRank != indicesRank)
- OPENVINO_THROW(errorPrefix_, " has invalid input shapes. Inputs 'Data' and 'Indices' must have equal ranks.");
+ THROW_CPU_NODE_ERR(" has invalid input shapes. Inputs 'Data' and 'Indices' must have equal ranks.");
auto gatherElementsOp = ov::as_type_ptr<ov::op::v6::GatherElements>(op);
auto axis = gatherElementsOp->get_axis();
if (axis < 0)
axis += dataRank;
if (axis < 0 || axis >= static_cast<int>(dataRank))
- OPENVINO_THROW(errorPrefix_, " has invalid axis attribute: ", axis);
+ THROW_CPU_NODE_ERR(" has invalid axis attribute: ", axis);
axis_ = axis;
}
@@ -80,12 +78,12 @@ void GatherElements::initSupportedPrimitiveDescriptors() {
sizeof(element_type_traits<ov::element::i32>::value_type),
sizeof(element_type_traits<ov::element::i16>::value_type),
sizeof(element_type_traits<ov::element::i8>::value_type))) {
- OPENVINO_THROW(errorPrefix_, " has unsupported 'inputData' input precision: ", inDataPrecision);
+ THROW_CPU_NODE_ERR(" has unsupported 'inputData' input precision: ", inDataPrecision);
}
ov::element::Type indicesPrecision = getOriginalInputPrecisionAtPort(indicesIndex_);
if (!one_of(indicesPrecision, ov::element::i32, ov::element::i64)) {
- OPENVINO_THROW(errorPrefix_, " has unsupported 'indices' input precision: ", indicesPrecision);
+ THROW_CPU_NODE_ERR(" has unsupported 'indices' input precision: ", indicesPrecision);
}
dataTypeSize_ = inDataPrecision.size();
diff --git a/src/plugins/intel_cpu/src/nodes/gather_elements.h b/src/plugins/intel_cpu/src/nodes/gather_elements.h
index a7b237782db..c627dfb4b36 100644
--- a/src/plugins/intel_cpu/src/nodes/gather_elements.h
+++ b/src/plugins/intel_cpu/src/nodes/gather_elements.h
@@ -34,7 +34,6 @@ private:
int strideAxDst_ = 0;
int dstAxDim_ = 0;
int strideAx1Diff_ = 0;
- std::string errorPrefix_;
template <typename dataType>
void directExecution();
diff --git a/src/plugins/intel_cpu/src/nodes/gather_tree.cpp b/src/plugins/intel_cpu/src/nodes/gather_tree.cpp
index dc84a62d034..da868ec9c78 100644
--- a/src/plugins/intel_cpu/src/nodes/gather_tree.cpp
+++ b/src/plugins/intel_cpu/src/nodes/gather_tree.cpp
@@ -36,20 +36,19 @@ GatherTree::GatherTree(const std::shared_ptr<ov::Node>& op, const GraphContext::
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix = std::string("Node GatherTree with name '") + op->get_friendly_name() + "'";
if (inputShapes.size() != 4)
- OPENVINO_THROW(errorPrefix, " has incorrect number of input edges.");
+ THROW_CPU_NODE_ERR("has incorrect number of input edges.");
if (outputShapes.size() != 1)
- OPENVINO_THROW(errorPrefix, " has incorrect number of output edges.");
+ THROW_CPU_NODE_ERR("has incorrect number of output edges.");
if (getInputShapeAtPort(GATHER_TREE_STEP_IDX).getRank() != 3)
- OPENVINO_THROW(errorPrefix, " step_idx vector should be 3 dimension");
+ THROW_CPU_NODE_ERR("step_idx vector should be 3 dimension");
if (getInputShapeAtPort(GATHER_TREE_PARENT_IDX).getRank() != 3)
- OPENVINO_THROW(errorPrefix, " parent_idx vector should be 3 dimension");
+ THROW_CPU_NODE_ERR("parent_idx vector should be 3 dimension");
if (getInputShapeAtPort(GATHER_TREE_MAX_SEQ_LEN).getRank() != 1)
- OPENVINO_THROW(errorPrefix, " max_seq_len vector should be 1 dimension");
+ THROW_CPU_NODE_ERR("max_seq_len vector should be 1 dimension");
if (!is_scalar(op->get_input_partial_shape(GATHER_TREE_END_TOKEN)))
- OPENVINO_THROW(errorPrefix, " end_token should be scalar");
+ THROW_CPU_NODE_ERR("end_token should be scalar");
}
void GatherTree::initSupportedPrimitiveDescriptors() {
@@ -64,7 +63,7 @@ void GatherTree::initSupportedPrimitiveDescriptors() {
getOriginalInputPrecisionAtPort(GATHER_TREE_MAX_SEQ_LEN) != precision ||
getOriginalInputPrecisionAtPort(GATHER_TREE_END_TOKEN) != precision ||
getOriginalOutputPrecisionAtPort(0) != precision) {
- OPENVINO_THROW(errorPrefix, " has incorrect input/output data precision. Must be the same.");
+ THROW_CPU_NODE_ERR("has incorrect input/output data precision. Must be the same.");
}
addSupportedPrimDesc({{LayoutType::ncsp, precision},
@@ -77,7 +76,7 @@ void GatherTree::initSupportedPrimitiveDescriptors() {
void GatherTree::execute(dnnl::stream strm) {
if (!execPtr)
- OPENVINO_THROW(errorPrefix, " has not compiled executor.");
+ THROW_CPU_NODE_ERR("has not compiled executor.");
if (precision == ov::element::f32)
execPtr->exec<float>(getSrcMemoryAtPort(GATHER_TREE_STEP_IDX),
@@ -100,15 +99,15 @@ void GatherTree::prepareParams() {
const auto& dstMemPtr = getDstMemoryAtPort(0);
if (!stepIdxMemPtr || !stepIdxMemPtr->isDefined())
- OPENVINO_THROW(errorPrefix, " has undefined input memory of 'step_ids'.");
+ THROW_CPU_NODE_ERR("has undefined input memory of 'step_ids'.");
if (!parentIdxMemPtr || !parentIdxMemPtr->isDefined())
- OPENVINO_THROW(errorPrefix, " has undefined input memory of 'parent_ids'.");
+ THROW_CPU_NODE_ERR("has undefined input memory of 'parent_ids'.");
if (!maxSeqLenMemPtr || !maxSeqLenMemPtr->isDefined())
- OPENVINO_THROW(errorPrefix, " has undefined input memory of 'max_seq_len'.");
+ THROW_CPU_NODE_ERR("has undefined input memory of 'max_seq_len'.");
if (!dstMemPtr || !dstMemPtr->isDefined())
- OPENVINO_THROW(errorPrefix, " has undefined output memory.");
+ THROW_CPU_NODE_ERR("has undefined output memory.");
if (getSelectedPrimitiveDescriptor() == nullptr)
- OPENVINO_THROW(errorPrefix, " has unidentified preferable primitive descriptor.");
+ THROW_CPU_NODE_ERR("has unidentified preferable primitive descriptor.");
const VectorDims& stepIdxDims = stepIdxMemPtr->getStaticDims();
const VectorDims& parentIdxDims = parentIdxMemPtr->getStaticDims();
diff --git a/src/plugins/intel_cpu/src/nodes/gather_tree.h b/src/plugins/intel_cpu/src/nodes/gather_tree.h
index 79ecb41183b..3a9368083e3 100644
--- a/src/plugins/intel_cpu/src/nodes/gather_tree.h
+++ b/src/plugins/intel_cpu/src/nodes/gather_tree.h
@@ -56,8 +56,6 @@ private:
static const size_t GATHER_TREE_END_TOKEN = 3;
ov::element::Type precision;
-
- std::string errorPrefix;
};
} // namespace node
diff --git a/src/plugins/intel_cpu/src/nodes/grn.cpp b/src/plugins/intel_cpu/src/nodes/grn.cpp
index d1275a153b4..f3a22bd7f49 100644
--- a/src/plugins/intel_cpu/src/nodes/grn.cpp
+++ b/src/plugins/intel_cpu/src/nodes/grn.cpp
@@ -33,18 +33,17 @@ GRN::GRN(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr context)
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix = "GRN layer with name '" + op->get_friendly_name() + "'";
const auto grn = ov::as_type_ptr<const ov::opset1::GRN>(op);
if (grn == nullptr)
- OPENVINO_THROW("Operation with name '", op->get_friendly_name(), "' is not an instance of GRN from opset1.");
+ THROW_CPU_NODE_ERR("is not an instance of GRN from opset1.");
if (inputShapes.size() != 1 || outputShapes.size() != 1)
- OPENVINO_THROW(errorPrefix, " has incorrect number of input/output edges!");
+ THROW_CPU_NODE_ERR("has incorrect number of input/output edges!");
const auto dataRank = getInputShapeAtPort(0).getRank();
if (dataRank != getOutputShapeAtPort(0).getRank())
- OPENVINO_THROW(errorPrefix, " has input/output rank mismatch");
+ THROW_CPU_NODE_ERR("has input/output rank mismatch");
bias = grn->get_bias();
}
@@ -63,18 +62,18 @@ void GRN::prepareParams() {
const auto& dstMemPtr = getDstMemoryAtPort(0);
if (!dataMemPtr || !dataMemPtr->isDefined())
- OPENVINO_THROW(errorPrefix, " has undefined input memory");
+ THROW_CPU_NODE_ERR("has undefined input memory");
if (!dstMemPtr || !dstMemPtr->isDefined())
- OPENVINO_THROW(errorPrefix, " has undefined output memory");
+ THROW_CPU_NODE_ERR("has undefined output memory");
if (getSelectedPrimitiveDescriptor() == nullptr)
- OPENVINO_THROW(errorPrefix, " has unidentified preferable primitive descriptor");
+ THROW_CPU_NODE_ERR("has unidentified preferable primitive descriptor");
const VectorDims& dataDims = dataMemPtr->getStaticDims();
const VectorDims& dstDims = dstMemPtr->getStaticDims();
for (size_t i = 0; i < dataDims.size(); ++i) {
if (dataDims[i] != dstDims[i])
- OPENVINO_THROW(errorPrefix, " hsd input/output tensors dimensions mismatch");
+ THROW_CPU_NODE_ERR("hsd input/output tensors dimensions mismatch");
}
if (dataDims.size() > 0)
diff --git a/src/plugins/intel_cpu/src/nodes/grn.h b/src/plugins/intel_cpu/src/nodes/grn.h
index 50686a8cfd0..11ff05e5fb4 100644
--- a/src/plugins/intel_cpu/src/nodes/grn.h
+++ b/src/plugins/intel_cpu/src/nodes/grn.h
@@ -30,8 +30,6 @@ private:
int C = 1;
int H = 1;
int W = 1;
-
- std::string errorPrefix;
};
} // namespace node
diff --git a/src/plugins/intel_cpu/src/nodes/interaction.cpp b/src/plugins/intel_cpu/src/nodes/interaction.cpp
index 55d5055ff45..c674ac13cb7 100644
--- a/src/plugins/intel_cpu/src/nodes/interaction.cpp
+++ b/src/plugins/intel_cpu/src/nodes/interaction.cpp
@@ -187,7 +187,6 @@ Interaction::Interaction(const std::shared_ptr<ov::Node>& op, const GraphContext
if (!isSupportedOperation(op, errorMessage)) {
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix = "Interaction node with name '" + getName() + "'";
const auto interaction = ov::as_type_ptr<const InteractionNode>(op);
const std::vector<float>& scales = interaction->get_output_scales();
if (!scales.empty()) {
diff --git a/src/plugins/intel_cpu/src/nodes/interaction.h b/src/plugins/intel_cpu/src/nodes/interaction.h
index c4b02f0ef7f..8dd446bb595 100644
--- a/src/plugins/intel_cpu/src/nodes/interaction.h
+++ b/src/plugins/intel_cpu/src/nodes/interaction.h
@@ -62,7 +62,6 @@ private:
size_t inputSizes = 0;
size_t outputFeaturesLen = 0;
size_t interactFeatureSize = 0;
- std::string errorPrefix;
MemoryPtr inputMemPtr;
MemoryPtr flatMemPtr;
MemoryPtr outputMemPtr;
diff --git a/src/plugins/intel_cpu/src/nodes/interpolate.cpp b/src/plugins/intel_cpu/src/nodes/interpolate.cpp
index b2c27b26914..cfcf868cae8 100644
--- a/src/plugins/intel_cpu/src/nodes/interpolate.cpp
+++ b/src/plugins/intel_cpu/src/nodes/interpolate.cpp
@@ -1876,15 +1876,14 @@ Interpolate::Interpolate(const std::shared_ptr<ov::Node>& op, const GraphContext
: Node(op, context, InterpolateShapeInferFactory(op)) {
std::string errorMessage;
if (isSupportedOperation(op, errorMessage)) {
- errorPrefix = "Interpolate node with name '" + getName() + "'";
dataRank = getInputShapeAtPort(DATA_ID).getRank();
if (const auto interp = ov::as_type_ptr<const ov::opset4::Interpolate>(op)) {
is_version11 = false;
const auto numInputs = inputShapes.size();
if (numInputs != 3 && numInputs != 4)
- OPENVINO_THROW(errorPrefix, " has incorrect number of input edges");
+ THROW_CPU_NODE_ERR("has incorrect number of input edges");
if (outputShapes.size() != 1)
- OPENVINO_THROW(errorPrefix, " has incorrect number of output edges");
+ THROW_CPU_NODE_ERR("has incorrect number of output edges");
isAxesSpecified = numInputs != 3;
const auto& interpAttr = interp->get_attrs();
@@ -1903,7 +1902,7 @@ Interpolate::Interpolate(const std::shared_ptr<ov::Node>& op, const GraphContext
} else if (interpMode == ngInterpMode::CUBIC) {
interpAttrs.mode = InterpolateMode::cubic;
} else {
- OPENVINO_THROW(errorPrefix, " has unsupported interpolate mode");
+ THROW_CPU_NODE_ERR("has unsupported interpolate mode");
}
const auto& interpCoordTransMode = interpAttr.coordinate_transformation_mode;
@@ -1918,7 +1917,7 @@ Interpolate::Interpolate(const std::shared_ptr<ov::Node>& op, const GraphContext
} else if (interpCoordTransMode == ngInterpCoordTransf::ALIGN_CORNERS) {
interpAttrs.coordTransMode = InterpolateCoordTransMode::align_corners;
} else {
- OPENVINO_THROW(errorPrefix, " has unsupported coordination transformation mode");
+ THROW_CPU_NODE_ERR("has unsupported coordination transformation mode");
}
if (interpAttrs.mode == InterpolateMode::nearest) {
@@ -1934,7 +1933,7 @@ Interpolate::Interpolate(const std::shared_ptr<ov::Node>& op, const GraphContext
} else if (interpNearestMode == ngInterpNearMode::SIMPLE) {
interpAttrs.nearestMode = InterpolateNearestMode::simple;
} else {
- OPENVINO_THROW(errorPrefix, " has unsupported nearest mode");
+ THROW_CPU_NODE_ERR("has unsupported nearest mode");
}
} else if (interpAttrs.mode == InterpolateMode::cubic) {
interpAttrs.cubeCoeff = static_cast<float>(interpAttr.cube_coeff);
@@ -1947,7 +1946,7 @@ Interpolate::Interpolate(const std::shared_ptr<ov::Node>& op, const GraphContext
} else if (interpShapeCalcMode == ngInterpShapeCalcMode::SIZES) {
interpAttrs.shapeCalcMode = InterpolateShapeCalcMode::sizes;
} else {
- OPENVINO_THROW(errorPrefix, " has unsupported shape calculation mode");
+ THROW_CPU_NODE_ERR("has unsupported shape calculation mode");
}
if (interpAttr.pads_begin.empty()) {
@@ -1986,9 +1985,9 @@ Interpolate::Interpolate(const std::shared_ptr<ov::Node>& op, const GraphContext
is_version11 = true;
const auto numInputs = inputShapes.size();
if (numInputs != 2 && numInputs != 3)
- OPENVINO_THROW(errorPrefix, " has incorrect number of input edges");
+ THROW_CPU_NODE_ERR("has incorrect number of input edges");
if (outputShapes.size() != 1)
- OPENVINO_THROW(errorPrefix, " has incorrect number of output edges");
+ THROW_CPU_NODE_ERR("has incorrect number of output edges");
isAxesSpecified = numInputs != 2;
const auto& interpAttr = interp->get_attrs();
@@ -1999,7 +1998,7 @@ Interpolate::Interpolate(const std::shared_ptr<ov::Node>& op, const GraphContext
interpAttrs.mode = InterpolateMode::bicubic_pillow;
interpAttrs.cubeCoeff = static_cast<float>(interpAttr.cube_coeff); // fixed to be -0.5
} else {
- OPENVINO_THROW(errorPrefix, " has unsupported interpolate mode");
+ THROW_CPU_NODE_ERR("has unsupported interpolate mode");
}
// pillow use fixed tf_half_pixel_for_nn style mode for coodinate transformation
@@ -2018,7 +2017,7 @@ Interpolate::Interpolate(const std::shared_ptr<ov::Node>& op, const GraphContext
} else if (interpShapeCalcMode == ngInterpShapeCalcMode::SIZES) {
interpAttrs.shapeCalcMode = InterpolateShapeCalcMode::sizes;
} else {
- OPENVINO_THROW(errorPrefix, " has unsupported shape calculation mode");
+ THROW_CPU_NODE_ERR("has unsupported shape calculation mode");
}
if (interpAttr.pads_begin.empty()) {
@@ -2061,9 +2060,9 @@ void Interpolate::getSupportedDescriptors() {
if (getParentEdges().size() != 2 && getParentEdges().size() != 3 && getParentEdges().size() != 4)
// v4: data, target_shape, scale, axis(optional).
// v11: data, size_or_scale, axis(optional)
- OPENVINO_THROW(errorPrefix, " has incorrect number of input edges");
+ THROW_CPU_NODE_ERR("has incorrect number of input edges");
if (getChildEdges().empty())
- OPENVINO_THROW(errorPrefix, " has incorrect number of output edges");
+ THROW_CPU_NODE_ERR("has incorrect number of output edges");
// get pad
for (size_t i = 0; i < interpAttrs.padBegin.size(); i++) {
@@ -2360,31 +2359,31 @@ void Interpolate::prepareParams() {
auto dstMemPtr = getDstMemoryAtPort(0);
if (!dstMemPtr || !dstMemPtr->isDefined())
- OPENVINO_THROW(errorPrefix, " has undefined destination memory");
+ THROW_CPU_NODE_ERR("has undefined destination memory");
auto srcMemPtr = getSrcMemoryAtPort(DATA_ID);
if (!srcMemPtr || !srcMemPtr->isDefined())
- OPENVINO_THROW(errorPrefix, " has undefined input memory");
+ THROW_CPU_NODE_ERR("has undefined input memory");
if (interpAttrs.shapeCalcMode == InterpolateShapeCalcMode::sizes) {
auto tsMemPtr = getSrcMemoryAtPort(TARGET_SHAPE_ID);
if (!tsMemPtr || !tsMemPtr->isDefined())
- OPENVINO_THROW(errorPrefix, " has undefined target shape memory");
+ THROW_CPU_NODE_ERR("has undefined target shape memory");
} else {
auto scaleMemPtr = getSrcMemoryAtPort(get_scale_id());
if (!scaleMemPtr || !scaleMemPtr->isDefined())
- OPENVINO_THROW(errorPrefix, " has undefined scales memory");
+ THROW_CPU_NODE_ERR("has undefined scales memory");
}
if (isAxesSpecified) {
auto axesMemPtr = getSrcMemoryAtPort(get_axis_id());
if (!axesMemPtr || !axesMemPtr->isDefined())
- OPENVINO_THROW(errorPrefix, " has undefined axes memory");
+ THROW_CPU_NODE_ERR("has undefined axes memory");
}
const NodeDesc* selected_pd = getSelectedPrimitiveDescriptor();
if (selected_pd == nullptr)
- OPENVINO_THROW(errorPrefix, " did not set preferable primitive descriptor");
+ THROW_CPU_NODE_ERR("did not set preferable primitive descriptor");
const auto& srcDimsOrign = srcMemPtr->getStaticDims();
const auto& dstDimsOrign = dstMemPtr->getStaticDims();
@@ -2479,9 +2478,9 @@ void Interpolate::createPrimitive() {
auto srcMemPtr = getSrcMemoryAtPort(DATA_ID);
auto dstMemPtr = getDstMemoryAtPort(0);
if (!srcMemPtr)
- OPENVINO_THROW(errorPrefix, " has null input memory");
+ THROW_CPU_NODE_ERR("has null input memory");
if (!dstMemPtr)
- OPENVINO_THROW(errorPrefix, " has null destination memory");
+ THROW_CPU_NODE_ERR("has null destination memory");
if (dstMemPtr->getDesc().hasLayoutType(LayoutType::ncsp)) {
interpAttrs.layout = InterpolateLayoutType::planar;
@@ -3110,7 +3109,7 @@ float Interpolate::InterpolateExecutorBase::coordTransToInput(int outCoord,
break;
}
default: {
- OPENVINO_THROW("errorPrefix", " does not support specified coordinate transformation mode");
+ OPENVINO_THROW("does not support specified coordinate transformation mode");
break;
}
}
@@ -3146,7 +3145,7 @@ int Interpolate::InterpolateExecutorBase::nearestRound(float originCoord,
return static_cast<int>(originCoord);
}
default: {
- OPENVINO_THROW("errorPrefix", " does not support specified nearest round mode");
+ OPENVINO_THROW("does not support specified nearest round mode");
break;
}
}
diff --git a/src/plugins/intel_cpu/src/nodes/interpolate.h b/src/plugins/intel_cpu/src/nodes/interpolate.h
index 77ea04296fe..ab9b6688ac3 100644
--- a/src/plugins/intel_cpu/src/nodes/interpolate.h
+++ b/src/plugins/intel_cpu/src/nodes/interpolate.h
@@ -347,8 +347,6 @@ private:
VectorDims lastOutputDims;
- std::string errorPrefix;
-
bool canUseAclExecutor = false;
std::shared_ptr<InterpolateExecutor> aclExecPtr = nullptr;
};
diff --git a/src/plugins/intel_cpu/src/nodes/log_softmax.cpp b/src/plugins/intel_cpu/src/nodes/log_softmax.cpp
index 57c84b7c822..172f4fd3ebe 100644
--- a/src/plugins/intel_cpu/src/nodes/log_softmax.cpp
+++ b/src/plugins/intel_cpu/src/nodes/log_softmax.cpp
@@ -33,7 +33,6 @@ LogSoftmax::LogSoftmax(const std::shared_ptr<ov::Node>& op, const GraphContext::
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix = "LogSoftmax layer with name '" + op->get_friendly_name() + "'";
const auto logSoftMax = ov::as_type_ptr<const ov::opset5::LogSoftmax>(op);
if (logSoftMax == nullptr)
OPENVINO_THROW("Operation with name '",
@@ -41,7 +40,7 @@ LogSoftmax::LogSoftmax(const std::shared_ptr<ov::Node>& op, const GraphContext::
"' is not an instance of LogSoftmax from opset5.");
if (inputShapes.size() != 1 || outputShapes.size() != 1)
- OPENVINO_THROW(errorPrefix, " has incorrect number of input/output edges!");
+ THROW_CPU_NODE_ERR("has incorrect number of input/output edges!");
auto dimsSize = getInputShapeAtPort(0).getDims().size();
if (dimsSize == 0)
@@ -51,7 +50,7 @@ LogSoftmax::LogSoftmax(const std::shared_ptr<ov::Node>& op, const GraphContext::
axis += dimsSize;
if (dimsSize < static_cast<size_t>((size_t)(1) + axis))
- OPENVINO_THROW(errorPrefix, " has incorrect input parameters dimensions and axis number!");
+ THROW_CPU_NODE_ERR("has incorrect input parameters dimensions and axis number!");
}
void LogSoftmax::initSupportedPrimitiveDescriptors() {
diff --git a/src/plugins/intel_cpu/src/nodes/log_softmax.h b/src/plugins/intel_cpu/src/nodes/log_softmax.h
index fd7064a08f6..e2f64e52449 100644
--- a/src/plugins/intel_cpu/src/nodes/log_softmax.h
+++ b/src/plugins/intel_cpu/src/nodes/log_softmax.h
@@ -30,8 +30,6 @@ private:
size_t reducedAxisStride = 1;
size_t axisStep = 1;
bool isLastDim = false;
-
- std::string errorPrefix;
};
} // namespace node
diff --git a/src/plugins/intel_cpu/src/nodes/lrn.cpp b/src/plugins/intel_cpu/src/nodes/lrn.cpp
index 9b1746bd43c..b913e831dda 100644
--- a/src/plugins/intel_cpu/src/nodes/lrn.cpp
+++ b/src/plugins/intel_cpu/src/nodes/lrn.cpp
@@ -113,8 +113,6 @@ Lrn::Lrn(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr context)
: Node(op, context, PassThroughShapeInferFactory()) {
std::string errorMessage;
if (isSupportedOperation(op, errorMessage)) {
- errorPrefix = "LRN node with name '" + getName() + "'";
-
auto lrn = ov::as_type_ptr<const ov::opset1::LRN>(op);
auto axes =
ov::as_type_ptr<const ov::opset1::Constant>(lrn->get_input_node_shared_ptr(1))->cast_vector<int64_t>();
@@ -134,9 +132,9 @@ void Lrn::getSupportedDescriptors() {
return;
if (getParentEdges().size() != 2)
- OPENVINO_THROW(errorPrefix, " has incorrect number of input edges");
+ THROW_CPU_NODE_ERR("has incorrect number of input edges");
if (getChildEdges().empty())
- OPENVINO_THROW(errorPrefix, " has incorrect number of output edges");
+ THROW_CPU_NODE_ERR("has incorrect number of output edges");
ov::element::Type precision = getOriginalOutputPrecisionAtPort(0);
if (precision != ov::element::f32 && precision != ov::element::bf16)
@@ -166,13 +164,13 @@ void Lrn::prepareParams() {
auto srcMemPtr = getSrcMemoryAtPort(0);
auto dstMemPtr = getDstMemoryAtPort(0);
if (!srcMemPtr || !srcMemPtr->isDefined())
- OPENVINO_THROW(errorPrefix, " input memory is undefined");
+ THROW_CPU_NODE_ERR("input memory is undefined");
if (!dstMemPtr || !dstMemPtr->isDefined())
- OPENVINO_THROW(errorPrefix, "destination memory is undefined");
+ THROW_CPU_NODE_ERR("destination memory is undefined");
const NodeDesc* selected_pd = getSelectedPrimitiveDescriptor();
if (selected_pd == nullptr)
- OPENVINO_THROW(errorPrefix, "preferable primitive descriptor did not set");
+ THROW_CPU_NODE_ERR("preferable primitive descriptor did not set");
auto inpDesc = getParentEdgeAt(0)->getMemory().getDescWithType<DnnlMemoryDesc>();
@@ -246,7 +244,7 @@ void Lrn::execute(dnnl::stream strm) {
if (execPtr) {
execPtr->exec(primArgs, strm);
} else {
- OPENVINO_THROW(errorPrefix, " doesn't have an initialized executor");
+ THROW_CPU_NODE_ERR("doesn't have an initialized executor");
}
}
diff --git a/src/plugins/intel_cpu/src/nodes/lrn.h b/src/plugins/intel_cpu/src/nodes/lrn.h
index 43fd0ec318f..bb87e797538 100644
--- a/src/plugins/intel_cpu/src/nodes/lrn.h
+++ b/src/plugins/intel_cpu/src/nodes/lrn.h
@@ -41,8 +41,6 @@ private:
int k = 1;
float alpha = 1.0f;
float beta = 1.0f;
-
- std::string errorPrefix;
};
} // namespace node
diff --git a/src/plugins/intel_cpu/src/nodes/mathematics.h b/src/plugins/intel_cpu/src/nodes/mathematics.h
index 99bb65cb492..4849bceab4e 100644
--- a/src/plugins/intel_cpu/src/nodes/mathematics.h
+++ b/src/plugins/intel_cpu/src/nodes/mathematics.h
@@ -33,8 +33,6 @@ private:
float alpha = 0.0f;
float beta = 0.0f;
float gamma = 0.0f;
-
- std::string errorPrefix;
};
} // namespace node
diff --git a/src/plugins/intel_cpu/src/nodes/matmul.cpp b/src/plugins/intel_cpu/src/nodes/matmul.cpp
index b0853737040..a9020ea8798 100644
--- a/src/plugins/intel_cpu/src/nodes/matmul.cpp
+++ b/src/plugins/intel_cpu/src/nodes/matmul.cpp
@@ -116,7 +116,6 @@ MatMul::MatMul(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr con
: Node(op, context, MMShapeInferFactory(op)),
withBiases(false) {
std::string errorMessage;
- errorPrefix = "MatMul node with name '" + getName() + "'";
if (!isSupportedOperation(op, errorMessage))
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
@@ -269,9 +268,9 @@ dnnl::memory::desc MatMul::getBiasDescFrom(const DnnlMemoryDescCPtr outMemDesc)
void MatMul::getSupportedDescriptors() {
if (getParentEdges().size() != getOriginalInputsNumber())
- OPENVINO_THROW(errorPrefix, " has incorrect number of input edges for layer ", getName());
+ THROW_CPU_NODE_ERR("has incorrect number of input edges for layer ", getName());
if (getChildEdges().empty())
- OPENVINO_THROW(errorPrefix, " has incorrect number of output edges for layer ", getName());
+ THROW_CPU_NODE_ERR("has incorrect number of output edges for layer ", getName());
withBiases = getOriginalInputsNumber() == 3;
@@ -317,7 +316,7 @@ void MatMul::getSupportedDescriptors() {
auto outputShape = getOutputShapeAtPort(0);
if (inputShape0.getRank() != inputShape1.getRank() || inputShape0.getRank() != outputShape.getRank())
- OPENVINO_THROW(errorPrefix, " has invalid dims count");
+ THROW_CPU_NODE_ERR("has invalid dims count");
const int nDims = inputShape0.getRank();
const auto xAxis = nDims - 1;
@@ -334,12 +333,12 @@ void MatMul::getSupportedDescriptors() {
// coverity[copy_paste_error]
if (!dimsEqualWeak(inDims0[xAxis0], inDims1[yAxis1]) || !dimsEqualWeak(inDims0[yAxis0], outDims[yAxis]) ||
!dimsEqualWeak(inDims1[xAxis1], outDims[xAxis]))
- OPENVINO_THROW(errorPrefix, " has incorrect spatial input and output dimensions");
+ THROW_CPU_NODE_ERR("has incorrect spatial input and output dimensions");
for (int dim_idx = nDims - 3; dim_idx >= 0; dim_idx--) {
if ((!dimsEqualWeak(inDims0[dim_idx], outDims[dim_idx]) && !dimsEqualWeak(inDims0[dim_idx], 1)) ||
(!dimsEqualWeak(inDims1[dim_idx], outDims[dim_idx]) && !dimsEqualWeak(inDims1[dim_idx], 1))) {
- OPENVINO_THROW(errorPrefix, " has incorrect input batch dimensions");
+ THROW_CPU_NODE_ERR("has incorrect input batch dimensions");
}
}
@@ -565,9 +564,9 @@ void MatMul::prepareParams() {
auto src0MemPtr = getSrcMemoryAtPort(0);
auto src1MemPtr = getSrcMemoryAtPort(1);
if (!dstMemPtr || !dstMemPtr->isDefined())
- OPENVINO_THROW(errorPrefix, " has undefined destination memory");
+ THROW_CPU_NODE_ERR("has undefined destination memory");
if (!src0MemPtr || !src0MemPtr->isDefined() || !src1MemPtr || !src1MemPtr->isDefined())
- OPENVINO_THROW(errorPrefix, " has undefined input memory");
+ THROW_CPU_NODE_ERR("has undefined input memory");
// check for a degenerate case. In this context the degenerate case is a matrix multiplication where the
// collapsing dimension is zero, e.g., AB=C, where A has the shape [10, 0] and B has the shape [0, 20],
@@ -585,7 +584,7 @@ void MatMul::prepareParams() {
const NodeDesc* selected_pd = getSelectedPrimitiveDescriptor();
if (selected_pd == nullptr)
- OPENVINO_THROW(errorPrefix, " did not set preferable primitive descriptor");
+ THROW_CPU_NODE_ERR("did not set preferable primitive descriptor");
DnnlMemoryDescPtr src0TransposedDesc;
DnnlMemoryDescPtr src1TransposedDesc;
@@ -617,7 +616,7 @@ void MatMul::prepareParams() {
if (withBiases) {
auto biasMemory = getSrcMemoryAtPort(2);
if (!biasMemory || !biasMemory->isDefined())
- OPENVINO_THROW(errorPrefix, " has undefined bias memory");
+ THROW_CPU_NODE_ERR("has undefined bias memory");
dnnlBiasMemDesc = biasMemory->getDescWithType<DnnlMemoryDesc>();
}
@@ -692,7 +691,7 @@ void MatMul::execute(dnnl::stream strm) {
// this is a degenerate case, fill output with zeroes
getDstMemoryAtPort(0)->nullify();
} else {
- OPENVINO_THROW(errorPrefix, " doesn't have an initialized executor");
+ THROW_CPU_NODE_ERR("doesn't have an initialized executor");
}
}
diff --git a/src/plugins/intel_cpu/src/nodes/matmul.h b/src/plugins/intel_cpu/src/nodes/matmul.h
index 93dcb93fb44..aea709970e2 100644
--- a/src/plugins/intel_cpu/src/nodes/matmul.h
+++ b/src/plugins/intel_cpu/src/nodes/matmul.h
@@ -59,8 +59,6 @@ private:
void setPostOps(dnnl::primitive_attr& attr, const VectorDims& dims, bool initWeights);
- std::string errorPrefix;
-
/* whether to transpose input */
std::array<bool, 2> transposeIn;
diff --git a/src/plugins/intel_cpu/src/nodes/matrix_nms.cpp b/src/plugins/intel_cpu/src/nodes/matrix_nms.cpp
index 302f1574c4e..2f9758fbc1b 100644
--- a/src/plugins/intel_cpu/src/nodes/matrix_nms.cpp
+++ b/src/plugins/intel_cpu/src/nodes/matrix_nms.cpp
@@ -54,16 +54,14 @@ MatrixNms::MatrixNms(const std::shared_ptr<ov::Node>& op, const GraphContext::CP
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- m_errorPrefix = "MatrixNMS layer with name '" + getName() + "' ";
-
if (one_of(op->get_type_info(), ov::op::internal::NmsStaticShapeIE<ov::op::v8::MatrixNms>::get_type_info_static()))
m_outStaticShape = true;
if (getOriginalInputsNumber() != 2)
- OPENVINO_THROW(m_errorPrefix, "has incorrect number of input edges: ", getOriginalInputsNumber());
+ THROW_CPU_NODE_ERR("has incorrect number of input edges: ", getOriginalInputsNumber());
if (getOriginalOutputsNumber() != 3)
- OPENVINO_THROW(m_errorPrefix, "has incorrect number of output edges: ", getOriginalOutputsNumber());
+ THROW_CPU_NODE_ERR("has incorrect number of output edges: ", getOriginalOutputsNumber());
const auto matrix_nms = ov::as_type_ptr<const ov::op::v8::MatrixNms>(op);
@@ -101,12 +99,12 @@ MatrixNms::MatrixNms(const std::shared_ptr<ov::Node>& op, const GraphContext::CP
const auto& boxes_dims = getInputShapeAtPort(NMS_BOXES).getDims();
if (boxes_dims.size() != 3)
- OPENVINO_THROW(m_errorPrefix, "has unsupported 'boxes' input rank: ", boxes_dims.size());
+ THROW_CPU_NODE_ERR("has unsupported 'boxes' input rank: ", boxes_dims.size());
if (boxes_dims[2] != 4)
- OPENVINO_THROW(m_errorPrefix, "has unsupported 'boxes' input 3rd dimension size: ", boxes_dims[2]);
+ THROW_CPU_NODE_ERR("has unsupported 'boxes' input 3rd dimension size: ", boxes_dims[2]);
const auto& scores_dims = getInputShapeAtPort(NMS_SCORES).getDims();
if (scores_dims.size() != 3)
- OPENVINO_THROW(m_errorPrefix, "has unsupported 'scores' input rank: ", scores_dims.size());
+ THROW_CPU_NODE_ERR("has unsupported 'scores' input rank: ", scores_dims.size());
}
void MatrixNms::initSupportedPrimitiveDescriptors() {
@@ -265,7 +263,7 @@ void MatrixNms::prepareParams() {
const auto& boxes_dims = getParentEdgeAt(NMS_BOXES)->getMemory().getStaticDims();
const auto& scores_dims = getParentEdgeAt(NMS_SCORES)->getMemory().getStaticDims();
if (!(boxes_dims[0] == scores_dims[0] && boxes_dims[1] == scores_dims[2])) {
- OPENVINO_THROW(m_errorPrefix, "has incompatible 'boxes' and 'scores' input dmensions");
+ THROW_CPU_NODE_ERR("has incompatible 'boxes' and 'scores' input dmensions");
}
m_numBatches = boxes_dims[0];
@@ -450,7 +448,7 @@ void MatrixNms::checkPrecision(const ov::element::Type prec,
const std::string name,
const std::string type) {
if (std::find(precList.begin(), precList.end(), prec) == precList.end())
- OPENVINO_THROW(m_errorPrefix, "has unsupported '", name, "' ", type, " precision: ", prec);
+ THROW_CPU_NODE_ERR("has unsupported '", name, "' ", type, " precision: ", prec);
}
} // namespace node
diff --git a/src/plugins/intel_cpu/src/nodes/matrix_nms.h b/src/plugins/intel_cpu/src/nodes/matrix_nms.h
index 017ddba9e54..ad872dc3eeb 100644
--- a/src/plugins/intel_cpu/src/nodes/matrix_nms.h
+++ b/src/plugins/intel_cpu/src/nodes/matrix_nms.h
@@ -96,7 +96,6 @@ private:
int64_t classIndex = -1;
float score = 0.0f;
};
- std::string m_errorPrefix;
const std::string m_inType = "input", m_outType = "output";
std::vector<int64_t> m_numPerBatch;
std::vector<std::vector<int64_t>> m_numPerBatchClass;
diff --git a/src/plugins/intel_cpu/src/nodes/multiclass_nms.cpp b/src/plugins/intel_cpu/src/nodes/multiclass_nms.cpp
index 510dcc8678a..67d840ebbc4 100644
--- a/src/plugins/intel_cpu/src/nodes/multiclass_nms.cpp
+++ b/src/plugins/intel_cpu/src/nodes/multiclass_nms.cpp
@@ -48,20 +48,19 @@ MultiClassNms::MultiClassNms(const std::shared_ptr<ov::Node>& op, const GraphCon
if (!isSupportedOperation(op, errorMessage)) {
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- m_errorPrefix = "MultiClassNms layer with name '" + getName() + "' ";
if (one_of(op->get_type_info(), ov::op::internal::MulticlassNmsIEInternal::get_type_info_static()))
m_outStaticShape = true;
if (getOriginalInputsNumber() != 2 && getOriginalInputsNumber() != 3)
- OPENVINO_THROW(m_errorPrefix, "has incorrect number of input edges: ", getOriginalInputsNumber());
+ THROW_CPU_NODE_ERR("has incorrect number of input edges: ", getOriginalInputsNumber());
if (getOriginalOutputsNumber() != 3)
- OPENVINO_THROW(m_errorPrefix, "has incorrect number of output edges: ", getOriginalOutputsNumber());
+ THROW_CPU_NODE_ERR("has incorrect number of output edges: ", getOriginalOutputsNumber());
auto nmsBase = ov::as_type_ptr<ov::op::util::MulticlassNmsBase>(op);
if (nmsBase == nullptr)
- OPENVINO_THROW(m_errorPrefix, " is not an instance of MulticlassNmsBase.");
+ THROW_CPU_NODE_ERR("is not an instance of MulticlassNmsBase.");
auto& atrri = nmsBase->get_attrs();
m_sortResultAcrossBatch = atrri.sort_result_across_batch;
m_nmsTopK = atrri.nms_top_k;
@@ -85,32 +84,23 @@ MultiClassNms::MultiClassNms(const std::shared_ptr<ov::Node>& op, const GraphCon
auto boxes_ps = PartialShape(boxes_dims);
auto scores_ps = PartialShape(scores_dims);
if (boxes_dims.size() != 3)
- OPENVINO_THROW(m_errorPrefix, "has unsupported 'boxes' input rank: ", boxes_dims.size());
+ THROW_CPU_NODE_ERR("has unsupported 'boxes' input rank: ", boxes_dims.size());
if (boxes_dims[2] != 4)
- OPENVINO_THROW(m_errorPrefix, "has unsupported 'boxes' input 3rd dimension size: ", boxes_dims[2]);
+ THROW_CPU_NODE_ERR("has unsupported 'boxes' input 3rd dimension size: ", boxes_dims[2]);
if (scores_dims.size() == 3) {
if (!boxes_ps[0].compatible(scores_ps[0]) || !boxes_ps[1].compatible(scores_ps[2]))
- OPENVINO_THROW(m_errorPrefix,
- "has incompatible 'boxes' and 'scores' shape ",
- boxes_ps,
- " v.s. ",
- scores_ps);
+ THROW_CPU_NODE_ERR("has incompatible 'boxes' and 'scores' shape ", boxes_ps, " v.s. ", scores_ps);
} else if (scores_dims.size() == 2) {
if (op->get_type_info() == ov::op::v8::MulticlassNms::get_type_info_static())
- OPENVINO_THROW(m_errorPrefix, "has unsupported 'scores' input rank: ", scores_dims.size());
+ THROW_CPU_NODE_ERR("has unsupported 'scores' input rank: ", scores_dims.size());
if (!boxes_ps[0].compatible(scores_ps[0]) || !boxes_ps[1].compatible(scores_ps[1]))
- OPENVINO_THROW(m_errorPrefix,
- "has incompatible 'boxes' and 'scores' shape ",
- boxes_ps,
- " v.s. ",
- scores_ps);
+ THROW_CPU_NODE_ERR("has incompatible 'boxes' and 'scores' shape ", boxes_ps, " v.s. ", scores_ps);
if (getOriginalInputsNumber() != 3)
- OPENVINO_THROW(m_errorPrefix,
- "has incorrect number of input edges: ",
- getOriginalInputsNumber(),
- " when input 'scores' is 2D.");
+ THROW_CPU_NODE_ERR("has incorrect number of input edges: ",
+ getOriginalInputsNumber(),
+ " when input 'scores' is 2D.");
} else {
- OPENVINO_THROW(m_errorPrefix, "has unsupported 'scores' input rank: ", scores_dims.size());
+ THROW_CPU_NODE_ERR("has unsupported 'scores' input rank: ", scores_dims.size());
}
}
@@ -169,31 +159,28 @@ void MultiClassNms::prepareParams() {
if (shared) {
if (boxes_dims[0] != scores_dims[0] || boxes_dims[1] != scores_dims[2])
- OPENVINO_THROW(m_errorPrefix,
- "has incompatible 'boxes' and 'scores' shape ",
- PartialShape(boxes_dims),
- " v.s. ",
- PartialShape(scores_dims));
+ THROW_CPU_NODE_ERR("has incompatible 'boxes' and 'scores' shape ",
+ PartialShape(boxes_dims),
+ " v.s. ",
+ PartialShape(scores_dims));
} else if (scores_dims.size() == 2) {
if (boxes_dims[0] != scores_dims[0] || boxes_dims[1] != scores_dims[1])
- OPENVINO_THROW(m_errorPrefix,
- "has incompatible 'boxes' and 'scores' shape ",
- PartialShape(boxes_dims),
- " v.s. ",
- PartialShape(scores_dims));
+ THROW_CPU_NODE_ERR("has incompatible 'boxes' and 'scores' shape ",
+ PartialShape(boxes_dims),
+ " v.s. ",
+ PartialShape(scores_dims));
if (!has_roinum)
- OPENVINO_THROW(m_errorPrefix,
- "has incorrect number of input edges: ",
- getOriginalInputsNumber(),
- " when input 'scores' is 2D.");
+ THROW_CPU_NODE_ERR("has incorrect number of input edges: ",
+ getOriginalInputsNumber(),
+ " when input 'scores' is 2D.");
} else {
- OPENVINO_THROW(m_errorPrefix, "has unsupported 'scores' input rank: ", scores_dims.size());
+ THROW_CPU_NODE_ERR("has unsupported 'scores' input rank: ", scores_dims.size());
}
if (has_roinum) {
const auto& roisnum_dims = getParentEdgeAt(NMS_ROISNUM)->getMemory().getStaticDims();
if (roisnum_dims.size() != 1)
- OPENVINO_THROW(m_errorPrefix, "has unsupported 'roisnum' input rank: ", roisnum_dims.size());
+ THROW_CPU_NODE_ERR("has unsupported 'roisnum' input rank: ", roisnum_dims.size());
m_numBatches = shared ? boxes_dims[0] : roisnum_dims[0];
} else {
m_numBatches = boxes_dims[0];
@@ -657,7 +644,7 @@ void MultiClassNms::checkPrecision(const ov::element::Type prec,
const std::string name,
const std::string type) {
if (std::find(precList.begin(), precList.end(), prec) == precList.end())
- OPENVINO_THROW(m_errorPrefix, "has unsupported '", name, "' ", type, " precision: ", prec);
+ THROW_CPU_NODE_ERR("has unsupported '", name, "' ", type, " precision: ", prec);
}
} // namespace node
diff --git a/src/plugins/intel_cpu/src/nodes/multiclass_nms.hpp b/src/plugins/intel_cpu/src/nodes/multiclass_nms.hpp
index 2a6a3d9f344..030a14e56b6 100644
--- a/src/plugins/intel_cpu/src/nodes/multiclass_nms.hpp
+++ b/src/plugins/intel_cpu/src/nodes/multiclass_nms.hpp
@@ -66,8 +66,6 @@ private:
bool m_outStaticShape = false;
- std::string m_errorPrefix;
-
std::vector<std::vector<size_t>> m_numFiltBox; // number of rois after nms for each class in each image
std::vector<size_t> m_numBoxOffset;
const std::string m_inType = "input", m_outType = "output";
diff --git a/src/plugins/intel_cpu/src/nodes/non_zero.cpp b/src/plugins/intel_cpu/src/nodes/non_zero.cpp
index 57d9c4395b1..57eee8520d0 100644
--- a/src/plugins/intel_cpu/src/nodes/non_zero.cpp
+++ b/src/plugins/intel_cpu/src/nodes/non_zero.cpp
@@ -34,21 +34,19 @@ bool NonZero::isSupportedOperation(const std::shared_ptr<const ov::Node>& op, st
NonZero::NonZero(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr context)
: Node(op, context, InternalDynShapeInferFactory()) {
std::string errorMessage;
- if (isSupportedOperation(op, errorMessage)) {
- errorPrefix = "NonZero layer with name '" + getName() + "' ";
- } else {
+ if (!isSupportedOperation(op, errorMessage)) {
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
if (op->get_output_element_type(0) != ov::element::i32) {
- OPENVINO_THROW(errorPrefix, "doesn't support demanded output precision");
+ THROW_CPU_NODE_ERR("doesn't support demanded output precision");
}
}
void NonZero::getSupportedDescriptors() {
if (getParentEdges().size() != 1)
- OPENVINO_THROW(errorPrefix, "has incorrect number of input edges: ", getParentEdges().size());
+ THROW_CPU_NODE_ERR("has incorrect number of input edges: ", getParentEdges().size());
if (!getChildEdges().size())
- OPENVINO_THROW(errorPrefix, "has incorrect number of output edges: ", getChildEdges().size());
+ THROW_CPU_NODE_ERR("has incorrect number of output edges: ", getChildEdges().size());
}
void NonZero::initSupportedPrimitiveDescriptors() {
diff --git a/src/plugins/intel_cpu/src/nodes/non_zero.h b/src/plugins/intel_cpu/src/nodes/non_zero.h
index 58fa4263987..7ba3552a45c 100644
--- a/src/plugins/intel_cpu/src/nodes/non_zero.h
+++ b/src/plugins/intel_cpu/src/nodes/non_zero.h
@@ -40,7 +40,6 @@ public:
private:
int threadsCount = 1;
- std::string errorPrefix;
template <typename inputType>
void executeSpecified();
template <typename T>
diff --git a/src/plugins/intel_cpu/src/nodes/one_hot.cpp b/src/plugins/intel_cpu/src/nodes/one_hot.cpp
index cfeed26f3ab..2a8f6aea669 100644
--- a/src/plugins/intel_cpu/src/nodes/one_hot.cpp
+++ b/src/plugins/intel_cpu/src/nodes/one_hot.cpp
@@ -48,7 +48,6 @@ OneHot::OneHot(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr con
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix = "OneHot layer with name '" + op->get_friendly_name() + "'";
const auto oneHot = ov::as_type_ptr<const ov::opset1::OneHot>(op);
const auto depthNode = ov::as_type_ptr<const ov::opset1::Constant>(oneHot->get_input_node_shared_ptr(DEPTH_ID));
if (depthNode) {
@@ -70,12 +69,12 @@ OneHot::OneHot(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr con
axis += output_dims_size;
}
if (axis < 0 || axis >= output_dims_size) {
- OPENVINO_THROW(errorPrefix, " has unsupported 'axis' attribute: ", oneHot->get_axis());
+ THROW_CPU_NODE_ERR("has unsupported 'axis' attribute: ", oneHot->get_axis());
}
if (!(((1 + srcDims.size()) == dstDims.size()) ||
(depthNode && (srcDims.size() == 1 && dstDims.size() == 1 && dstDims[0] == depth && srcDims[0] == 1))))
- OPENVINO_THROW(errorPrefix, " has incorrect number of input/output dimensions!");
+ THROW_CPU_NODE_ERR("has incorrect number of input/output dimensions!");
}
bool OneHot::needShapeInfer() const {
@@ -95,7 +94,7 @@ void OneHot::initSupportedPrimitiveDescriptors() {
// check a precision of the input tensor
auto input_precision = getOriginalInputPrecisionAtPort(INDICES_ID);
if (input_precision != ov::element::i32) {
- OPENVINO_THROW(errorPrefix, " has incorrect input precision for the input. Only I32 is supported!");
+ THROW_CPU_NODE_ERR("has incorrect input precision for the input. Only I32 is supported!");
}
output_precision = getOriginalOutputPrecisionAtPort(0);
diff --git a/src/plugins/intel_cpu/src/nodes/one_hot.h b/src/plugins/intel_cpu/src/nodes/one_hot.h
index fd451e9eaca..f33efaef39f 100644
--- a/src/plugins/intel_cpu/src/nodes/one_hot.h
+++ b/src/plugins/intel_cpu/src/nodes/one_hot.h
@@ -49,8 +49,6 @@ private:
ov::element::Type output_precision;
- std::string errorPrefix;
-
static const size_t INDICES_ID = 0;
static const size_t DEPTH_ID = 1;
static const size_t ON_VALUE_ID = 2;
diff --git a/src/plugins/intel_cpu/src/nodes/pad.cpp b/src/plugins/intel_cpu/src/nodes/pad.cpp
index 28beb4bd9b2..efbf51b3e05 100644
--- a/src/plugins/intel_cpu/src/nodes/pad.cpp
+++ b/src/plugins/intel_cpu/src/nodes/pad.cpp
@@ -44,20 +44,19 @@ Pad::Pad(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr context)
if (!isSupportedOperation(op, errorMessage)) {
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix = NameFromType(getType()) + " node with name '" + getName() + "' ";
if (inputShapes.size() != 3 && inputShapes.size() != 4)
- OPENVINO_THROW(errorPrefix, " has incorrect number of input edges");
+ THROW_CPU_NODE_ERR("has incorrect number of input edges");
if (outputShapes.size() != 1)
- OPENVINO_THROW(errorPrefix, "Incorrect number of output edges");
+ THROW_CPU_NODE_ERR("Incorrect number of output edges");
const size_t srcDimsRank = inputShapes[DATA_ID].getRank();
const size_t dstDimsRank = outputShapes[DATA_ID].getRank();
if (srcDimsRank != dstDimsRank)
- OPENVINO_THROW(errorPrefix, "has incorrect number of input/output dimensions!");
+ THROW_CPU_NODE_ERR("has incorrect number of input/output dimensions!");
auto pad = ov::as_type<const op::util::PadBase>(op.get());
if (!pad) {
- OPENVINO_THROW(errorPrefix, "couldn't be casted to op of opset1");
+ THROW_CPU_NODE_ERR("couldn't be casted to op of opset1");
}
shapeHasDataDependency = !ov::is_type<op::v0::Constant>(op->get_input_node_shared_ptr(PADS_BEGIN_ID)) ||
@@ -74,7 +73,7 @@ Pad::Pad(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr context)
parameter.push_back(value);
}
if (parameter.size() != srcDimsRank)
- OPENVINO_THROW(errorPrefix, "has incorrect number of input/output dimensions!");
+ THROW_CPU_NODE_ERR("has incorrect number of input/output dimensions!");
}
};
@@ -88,7 +87,7 @@ Pad::Pad(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr context)
if (isPadValueSpecified && op->get_input_node_shared_ptr(PAD_VALUE_ID)->get_type_info() ==
ov::op::v0::Constant::get_type_info_static()) {
if (!ov::is_scalar(pad->get_input_shape(PAD_VALUE_ID)))
- OPENVINO_THROW(errorPrefix, "has non scalar 'pad_value' input");
+ THROW_CPU_NODE_ERR("has non scalar 'pad_value' input");
attrs.padValue = ov::as_type_ptr<const op::v0::Constant>(pad->get_input_node_shared_ptr(PAD_VALUE_ID))
->cast_vector<float>()[0];
attrs.constPadValue = true;
@@ -100,7 +99,7 @@ Pad::Pad(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr context)
} else if (pad_mode == op::PadMode::SYMMETRIC) {
attrs.padMode = SYMMETRIC;
} else {
- OPENVINO_THROW(errorPrefix, "has unsupported pad_mode: " + ov::as_string(pad_mode));
+ THROW_CPU_NODE_ERR("has unsupported pad_mode: " + ov::as_string(pad_mode));
}
}
@@ -205,14 +204,12 @@ bool Pad::isExecutable() const {
void Pad::prepareParams() {
updateLastInputDims();
- execPtr = std::make_shared<PadExecutor>(attrs, srcMemory, dstMemory, errorPrefix);
+ execPtr = std::make_shared<PadExecutor>(attrs, srcMemory, dstMemory);
}
Pad::PadExecutor::PadExecutor(const PadAttrs& attrs,
const std::vector<MemoryCPtr>& srcMemory,
- const std::vector<MemoryCPtr>& dstMemory,
- const std::string& errorPrefix)
- : errorPrefix(errorPrefix) {
+ const std::vector<MemoryCPtr>& dstMemory) {
paramsInitialization(attrs, srcMemory, dstMemory);
workPartition();
innerParamsInitialization();
@@ -225,9 +222,9 @@ void Pad::PadExecutor::paramsInitialization(const PadAttrs& attrs,
auto& srcMemPtr = srcMemory[DATA_ID];
auto& dstMemPtr = dstMemory[DATA_ID];
if (!dstMemPtr || !dstMemPtr->isDefined())
- OPENVINO_THROW(errorPrefix, "has undefined source memory.");
+ OPENVINO_THROW("Pad executor has undefined source memory.");
if (!srcMemPtr || !srcMemPtr->isDefined())
- OPENVINO_THROW(errorPrefix, "has undefined destination memory.");
+ OPENVINO_THROW("Pad executor has undefined destination memory.");
const auto srcBlockMemDesc = srcMemPtr->getDescWithType<BlockedMemoryDesc>();
const auto dstBlockMemDesc = dstMemPtr->getDescWithType<BlockedMemoryDesc>();
const auto& srcDims = srcBlockMemDesc->getBlockDims();
@@ -392,7 +389,7 @@ void Pad::PadExecutor::exec(const MemoryPtr& srcMemPtr, const MemoryPtr& dstMemP
void Pad::execute(dnnl::stream strm) {
if (!execPtr)
- OPENVINO_THROW(errorPrefix, "has not compiled executor.");
+ THROW_CPU_NODE_ERR("has not compiled executor.");
execPtr->exec(getSrcMemoryAtPort(0), getDstMemoryAtPort(0));
}
diff --git a/src/plugins/intel_cpu/src/nodes/pad.h b/src/plugins/intel_cpu/src/nodes/pad.h
index 4654bb71468..38fb57e4c99 100644
--- a/src/plugins/intel_cpu/src/nodes/pad.h
+++ b/src/plugins/intel_cpu/src/nodes/pad.h
@@ -48,8 +48,7 @@ private:
struct PadExecutor {
PadExecutor(const PadAttrs& attrs,
const std::vector<MemoryCPtr>& srcMemory,
- const std::vector<MemoryCPtr>& dstMemory,
- const std::string& errorPrefix);
+ const std::vector<MemoryCPtr>& dstMemory);
void exec(const MemoryPtr& srcMemPtr, const MemoryPtr& dstMemPtr);
~PadExecutor() = default;
@@ -106,7 +105,6 @@ private:
size_t innerEndPadCount = 0lu;
PadMode padMode;
} params;
- const std::string errorPrefix;
};
static constexpr size_t DATA_ID = 0lu;
@@ -120,7 +118,6 @@ private:
executorPtr execPtr = nullptr;
std::vector<MemoryCPtr> srcMemory;
std::vector<MemoryCPtr> dstMemory;
- std::string errorPrefix;
bool shapeHasDataDependency = false;
};
diff --git a/src/plugins/intel_cpu/src/nodes/psroi_pooling.cpp b/src/plugins/intel_cpu/src/nodes/psroi_pooling.cpp
index 1b42d0f0cbc..3049e82dcd9 100644
--- a/src/plugins/intel_cpu/src/nodes/psroi_pooling.cpp
+++ b/src/plugins/intel_cpu/src/nodes/psroi_pooling.cpp
@@ -66,25 +66,20 @@ PSROIPooling::PSROIPooling(const std::shared_ptr<ov::Node>& op, const GraphConte
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix = std::string(op->get_type_name()) + " node with name '" + op->get_friendly_name() + "'";
-
const auto psroi = ov::as_type_ptr<const ov::opset1::PSROIPooling>(op);
const auto defPsroi = ov::as_type_ptr<const ov::opset1::DeformablePSROIPooling>(op);
noTrans = op->get_input_size() == 2;
if (op->get_input_shape(0).size() != 4)
- OPENVINO_THROW(errorPrefix,
- " has first input with incorrect rank: " + std::to_string(op->get_input_shape(0).size()));
+ THROW_CPU_NODE_ERR("has first input with incorrect rank: " + std::to_string(op->get_input_shape(0).size()));
if (op->get_input_shape(1).size() != 2)
- OPENVINO_THROW(errorPrefix,
- " has second input with incorrect rank: " + std::to_string(op->get_input_shape(1).size()));
+ THROW_CPU_NODE_ERR("has second input with incorrect rank: " + std::to_string(op->get_input_shape(1).size()));
if (!noTrans && op->get_input_shape(2).size() != 4)
- OPENVINO_THROW(errorPrefix,
- " has third input with incorrect rank: " + std::to_string(op->get_input_shape(2).size()));
+ THROW_CPU_NODE_ERR("has third input with incorrect rank: " + std::to_string(op->get_input_shape(2).size()));
if (psroi) {
if (psroi->get_input_size() != 2)
- OPENVINO_THROW(errorPrefix, " has incorrect number of input/output edges!");
+ THROW_CPU_NODE_ERR("has incorrect number of input/output edges!");
mode = psroi->get_mode();
if (mode == "average") {
@@ -104,7 +99,7 @@ PSROIPooling::PSROIPooling(const std::shared_ptr<ov::Node>& op, const GraphConte
} else if (defPsroi) {
if (defPsroi->get_input_size() != 2 && defPsroi->get_input_size() != 3)
- OPENVINO_THROW(errorPrefix, " has incorrect number of input/output edges!");
+ THROW_CPU_NODE_ERR("has incorrect number of input/output edges!");
algorithm = Algorithm::PSROIPoolingBilinearDeformable;
@@ -211,19 +206,17 @@ void PSROIPooling::unpackParams(const BlockedMemoryDesc& srcDesc,
auto inBlkDims = srcDesc.getBlockDims();
auto outBlkDims = dstDesc.getBlockDims();
if (inBlkDims.size() != expectedInBlockDimsSize)
- OPENVINO_THROW(errorPrefix,
- " has unexpected size of blocking dims in input (given ",
- inBlkDims.size(),
- ", expected ",
- expectedInBlockDimsSize,
- ")");
+ THROW_CPU_NODE_ERR("has unexpected size of blocking dims in input (given ",
+ inBlkDims.size(),
+ ", expected ",
+ expectedInBlockDimsSize,
+ ")");
if (outBlkDims.size() != expectedOutBlockDimsSize)
- OPENVINO_THROW(errorPrefix,
- " has unexpected size of blocking dims in output (given ",
- outBlkDims.size(),
- ", expected ",
- expectedOutBlockDimsSize,
- ")");
+ THROW_CPU_NODE_ERR("has unexpected size of blocking dims in output (given ",
+ outBlkDims.size(),
+ ", expected ",
+ expectedOutBlockDimsSize,
+ ")");
inBlockSize = (inpIsBlk ? srcDesc.getBlockDims()[4] : 1);
outBlockSize = (outIsBlk ? dstDesc.getBlockDims()[4] : 1);
@@ -614,8 +607,8 @@ void PSROIPooling::execute(dnnl::stream strm) {
if (!((inputPrec == ov::element::bf16 && outputPrec == ov::element::bf16) ||
(inputPrec == ov::element::f32 && outputPrec == ov::element::f32))) {
- OPENVINO_THROW(errorPrefix + " has different precisions on input: " + inputPrec.get_type_name() +
- " and output: " + outputPrec.get_type_name());
+ THROW_CPU_NODE_ERR("has different precisions on input: " + inputPrec.get_type_name() +
+ " and output: " + outputPrec.get_type_name());
}
PSROIPoolingContext ctx = {
diff --git a/src/plugins/intel_cpu/src/nodes/psroi_pooling.h b/src/plugins/intel_cpu/src/nodes/psroi_pooling.h
index 3a39d6e072c..2a0f59de264 100644
--- a/src/plugins/intel_cpu/src/nodes/psroi_pooling.h
+++ b/src/plugins/intel_cpu/src/nodes/psroi_pooling.h
@@ -46,8 +46,6 @@ private:
int partSize = 1;
float transStd = 1.f;
- std::string errorPrefix;
-
void unpackParams(const BlockedMemoryDesc& srcDesc,
const BlockedMemoryDesc& dstDesc,
int& hInputStride,
diff --git a/src/plugins/intel_cpu/src/nodes/range.cpp b/src/plugins/intel_cpu/src/nodes/range.cpp
index 64897085142..02eb470d2f6 100644
--- a/src/plugins/intel_cpu/src/nodes/range.cpp
+++ b/src/plugins/intel_cpu/src/nodes/range.cpp
@@ -36,26 +36,24 @@ Range::Range(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr conte
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix = "Range layer with name '" + op->get_friendly_name() + "'";
-
if (getOriginalInputsNumber() != 3 || getOriginalOutputsNumber() != 1)
- OPENVINO_THROW(errorPrefix, " has incorrect number of input/output edges!");
+ THROW_CPU_NODE_ERR("has incorrect number of input/output edges!");
auto start_dims = op->get_input_shape(RANGE_START);
if (ov::shape_size(start_dims) != 1)
- OPENVINO_THROW(errorPrefix, " has start scalar with more than 1 value");
+ THROW_CPU_NODE_ERR("has start scalar with more than 1 value");
auto limit_dims = op->get_input_shape(RANGE_LIMIT);
if (ov::shape_size(limit_dims) != 1)
- OPENVINO_THROW(errorPrefix, " has limit scalar with more than 1 value");
+ THROW_CPU_NODE_ERR("has limit scalar with more than 1 value");
auto delta_dims = op->get_input_shape(RANGE_DELTA);
if (ov::shape_size(delta_dims) != 1)
- OPENVINO_THROW(errorPrefix, " has delta scalar with more than 1 value");
+ THROW_CPU_NODE_ERR("has delta scalar with more than 1 value");
size_t dstRank = op->get_output_partial_shape(0).size();
if (dstRank > 1)
- OPENVINO_THROW(errorPrefix, " has unsupported rank for output: ", dstRank);
+ THROW_CPU_NODE_ERR("has unsupported rank for output: ", dstRank);
}
void Range::initSupportedPrimitiveDescriptors() {
diff --git a/src/plugins/intel_cpu/src/nodes/range.h b/src/plugins/intel_cpu/src/nodes/range.h
index d5cbd79be1f..bd21f12495f 100644
--- a/src/plugins/intel_cpu/src/nodes/range.h
+++ b/src/plugins/intel_cpu/src/nodes/range.h
@@ -41,8 +41,6 @@ private:
static const size_t RANGE_START = 0;
static const size_t RANGE_LIMIT = 1;
static const size_t RANGE_DELTA = 2;
-
- std::string errorPrefix;
};
} // namespace node
diff --git a/src/plugins/intel_cpu/src/nodes/reduce.cpp b/src/plugins/intel_cpu/src/nodes/reduce.cpp
index a8165b0226b..f320ed270c6 100644
--- a/src/plugins/intel_cpu/src/nodes/reduce.cpp
+++ b/src/plugins/intel_cpu/src/nodes/reduce.cpp
@@ -1963,21 +1963,20 @@ Reduce::Reduce(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr con
: Node(op, context, NgraphShapeInferFactory(op)) {
std::string errorMessage;
if (isSupportedOperation(op, errorMessage)) {
- errorPrefix = "Reduce node with name '" + getName() + "'";
getInitializers().at(op->get_type_info())(op, *this);
if (const auto reduce = ov::as_type_ptr<ov::op::util::ArithmeticReductionKeepDims>(op)) {
keep_dims = reduce->get_keep_dims();
auto reduceConst =
ov::as_type_ptr<const ov::opset1::Constant>(reduce->get_input_node_shared_ptr(REDUCE_INDEXES));
if (!reduceConst)
- OPENVINO_THROW(errorPrefix, " second tensor is not constant!");
+ THROW_CPU_NODE_ERR("second tensor is not constant!");
raw_axes = reduceConst->cast_vector<int>();
} else if (const auto reduce = ov::as_type_ptr<ov::op::util::LogicalReductionKeepDims>(op)) {
keep_dims = reduce->get_keep_dims();
auto reduceConst =
ov::as_type_ptr<const ov::opset1::Constant>(reduce->get_input_node_shared_ptr(REDUCE_INDEXES));
if (!reduceConst)
- OPENVINO_THROW(errorPrefix, " second tensor is not constant!");
+ THROW_CPU_NODE_ERR("second tensor is not constant!");
raw_axes = reduceConst->cast_vector<int>();
}
set_use_aux_kernel = false;
@@ -1993,24 +1992,24 @@ Reduce::Reduce(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr con
void Reduce::getSupportedDescriptors() {
if (getParentEdges().size() != 2)
- OPENVINO_THROW(errorPrefix, " gets incorrect number of input edges!");
+ THROW_CPU_NODE_ERR("gets incorrect number of input edges!");
if (getChildEdges().empty())
- OPENVINO_THROW(errorPrefix, " gets incorrect number of output edges!");
+ THROW_CPU_NODE_ERR("gets incorrect number of output edges!");
if (getInputShapeAtPort(REDUCE_INDEXES).getRank() != 1) {
- OPENVINO_THROW(errorPrefix, " gets incorrect index vector dimension! Index vector should be 1 dimension.");
+ THROW_CPU_NODE_ERR("gets incorrect index vector dimension! Index vector should be 1 dimension.");
}
if (keep_dims) {
if (getInputShapeAtPort(REDUCE_DATA).getRank() != getOutputShapeAtPort(0).getRank())
- OPENVINO_THROW(errorPrefix, " gets incorrect number of input/output dimensions!");
+ THROW_CPU_NODE_ERR("gets incorrect number of input/output dimensions!");
} else {
// In fact, after the Reduce operation, the shape must be a scalar if the previous one was 1d.
// But for now, 0d tensor (scalar) is emulated as 1d tensor. Skip checking in such cases.
bool is_emulated_0d_as_1d =
getInputShapeAtPort(REDUCE_DATA).getRank() == 1 && getOutputShapeAtPort(0).getRank() == 1;
if (getInputShapeAtPort(REDUCE_DATA).getRank() <= getOutputShapeAtPort(0).getRank() && !is_emulated_0d_as_1d)
- OPENVINO_THROW(errorPrefix, "gets incorrect number of input/output dimensions!");
+ THROW_CPU_NODE_ERR("gets incorrect number of input/output dimensions!");
}
}
@@ -2252,7 +2251,7 @@ void Reduce::prepareParams() {
auto cache = context->getParamsCache();
auto result = cache->getOrCreate(key, builder);
if (!result.first) {
- OPENVINO_THROW(errorPrefix, " has not found jit_uni_reduce_post_kernel_f32.");
+ THROW_CPU_NODE_ERR("has not found jit_uni_reduce_post_kernel_f32.");
}
reduce_post_kernel = result.first;
@@ -2271,11 +2270,11 @@ void Reduce::createPrimitive() {
auto dstMemPtr = getDstMemoryAtPort(0);
auto srcMemPtr = getSrcMemoryAtPort(REDUCE_DATA);
if (!dstMemPtr)
- OPENVINO_THROW(errorPrefix, " has null destination memory.");
+ THROW_CPU_NODE_ERR("has null destination memory.");
if (!srcMemPtr)
- OPENVINO_THROW(errorPrefix, " has null input memory.");
+ THROW_CPU_NODE_ERR("has null input memory.");
if (getSelectedPrimitiveDescriptor() == nullptr)
- OPENVINO_THROW(errorPrefix, " has nullable preferable primitive descriptor");
+ THROW_CPU_NODE_ERR("has nullable preferable primitive descriptor");
if (srcMemPtr->getDesc().hasLayoutType(LayoutType::ncsp)) {
layout = ReduceLayoutType::reduce_ncsp;
@@ -2410,7 +2409,7 @@ void Reduce::execute(dnnl::stream strm) {
auto out_ptr = reinterpret_cast<float*>(dst_data);
reduce_ref(in_ptr, out_ptr);
} else {
- OPENVINO_THROW(errorPrefix, " supports only plain layout on machine w/o sse42.");
+ THROW_CPU_NODE_ERR("supports only plain layout on machine w/o sse42.");
}
}
}
@@ -3282,7 +3281,7 @@ inline void Reduce::init_dst_data(uint8_t* out_ptr, size_t dst_size) {
}
break;
default:
- OPENVINO_THROW(errorPrefix, " gets unsupported reduce mode.");
+ THROW_CPU_NODE_ERR("gets unsupported reduce mode.");
}
}
@@ -3345,7 +3344,7 @@ inline void Reduce::calc_process_dst_dims(std::vector<int>& reduce_axes, const V
if (axis < 0)
axis += src_dims.size();
if (static_cast<size_t>(axis) > src_dims.size())
- OPENVINO_THROW(errorPrefix, " exceeds data tensor dimension on index to reduce");
+ THROW_CPU_NODE_ERR("exceeds data tensor dimension on index to reduce");
axes.insert(static_cast<size_t>(axis));
}
for (size_t i = 0; i < src_dims.size(); i++) {
@@ -3369,11 +3368,11 @@ inline void Reduce::calc_process_dst_dims(std::vector<int>& reduce_axes, const V
if (jit_mode && jit_beyond_5D) {
if (std::accumulate(out_dims.begin(), out_dims.end(), size_t(1), std::multiplies<size_t>()) !=
std::accumulate(dst_dims.begin(), dst_dims.end(), size_t(1), std::multiplies<size_t>()))
- OPENVINO_THROW(errorPrefix, "gets incorrect number of output dimensions!");
+ THROW_CPU_NODE_ERR("gets incorrect number of output dimensions!");
} else {
for (size_t i = 0; i < std::min(out_dims.size(), dst_dims.size()); i++) {
if (out_dims[i] != dst_dims[i])
- OPENVINO_THROW(errorPrefix, "gets incorrect number of output dimensions!");
+ THROW_CPU_NODE_ERR("gets incorrect number of output dimensions!");
}
}
}
@@ -3518,7 +3517,7 @@ inline void Reduce::reduce_ref(const float* in_ptr, float* out_ptr) {
});
break;
default:
- OPENVINO_THROW(errorPrefix, "gets unsupported reduce mode.");
+ THROW_CPU_NODE_ERR("gets unsupported reduce mode.");
}
}
@@ -3609,7 +3608,7 @@ inline void Reduce::reduce_ref_map(float* out_ptr, size_t work_amount_dst, size_
});
break;
default:
- OPENVINO_THROW(errorPrefix, "gets unsupported reduce mode.");
+ THROW_CPU_NODE_ERR("gets unsupported reduce mode.");
}
}
diff --git a/src/plugins/intel_cpu/src/nodes/reduce.h b/src/plugins/intel_cpu/src/nodes/reduce.h
index 3f35fd8bc5a..e0d68241365 100644
--- a/src/plugins/intel_cpu/src/nodes/reduce.h
+++ b/src/plugins/intel_cpu/src/nodes/reduce.h
@@ -197,8 +197,6 @@ private:
std::function<void(const std::shared_ptr<ov::Node>& op, Reduce& node)>>&
getInitializers();
- std::string errorPrefix;
-
#if defined(OV_CPU_WITH_ACL)
ReduceAttrs reduceAttrs;
bool canUseAclExecutor = false;
diff --git a/src/plugins/intel_cpu/src/nodes/region_yolo.cpp b/src/plugins/intel_cpu/src/nodes/region_yolo.cpp
index 43c281c669a..fc198bc0cc2 100644
--- a/src/plugins/intel_cpu/src/nodes/region_yolo.cpp
+++ b/src/plugins/intel_cpu/src/nodes/region_yolo.cpp
@@ -265,9 +265,8 @@ RegionYolo::RegionYolo(const std::shared_ptr<ov::Node>& op, const GraphContext::
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix = std::string(op->get_type_name()) + " node with name '" + op->get_friendly_name() + "'";
if (op->get_input_size() != 1 || op->get_output_size() != 1)
- OPENVINO_THROW(errorPrefix, " has incorrect number of input/output edges!");
+ THROW_CPU_NODE_ERR("has incorrect number of input/output edges!");
const auto regionYolo = ov::as_type_ptr<const ov::opset1::RegionYolo>(op);
classes = regionYolo->get_num_classes();
diff --git a/src/plugins/intel_cpu/src/nodes/region_yolo.h b/src/plugins/intel_cpu/src/nodes/region_yolo.h
index fbd88d98514..1f34e8cb043 100644
--- a/src/plugins/intel_cpu/src/nodes/region_yolo.h
+++ b/src/plugins/intel_cpu/src/nodes/region_yolo.h
@@ -64,8 +64,6 @@ private:
std::vector<int64_t> mask;
ov::element::Type input_prec, output_prec;
- std::string errorPrefix;
-
int block_size;
std::shared_ptr<jit_uni_logistic_kernel> logistic_kernel = nullptr;
std::shared_ptr<SoftmaxGeneric> softmax_kernel;
diff --git a/src/plugins/intel_cpu/src/nodes/reorg_yolo.cpp b/src/plugins/intel_cpu/src/nodes/reorg_yolo.cpp
index 63b4e2985ff..015bc38adea 100644
--- a/src/plugins/intel_cpu/src/nodes/reorg_yolo.cpp
+++ b/src/plugins/intel_cpu/src/nodes/reorg_yolo.cpp
@@ -33,14 +33,13 @@ ReorgYolo::ReorgYolo(const std::shared_ptr<ov::Node>& op, const GraphContext::CP
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix = std::string(op->get_type_name()) + " node with name '" + op->get_friendly_name() + "'";
if (getOriginalInputsNumber() != 1 || getOriginalOutputsNumber() != 1)
- OPENVINO_THROW(errorPrefix, " has incorrect number of input/output edges!");
+ THROW_CPU_NODE_ERR("has incorrect number of input/output edges!");
const auto reorgYolo = ov::as_type_ptr<const ov::opset2::ReorgYolo>(op);
const auto strides = reorgYolo->get_strides();
if (strides.empty())
- OPENVINO_THROW(errorPrefix, " has empty strides");
+ THROW_CPU_NODE_ERR("has empty strides");
stride = strides[0];
}
diff --git a/src/plugins/intel_cpu/src/nodes/reorg_yolo.h b/src/plugins/intel_cpu/src/nodes/reorg_yolo.h
index bf7486f4f78..a2f341fee4a 100644
--- a/src/plugins/intel_cpu/src/nodes/reorg_yolo.h
+++ b/src/plugins/intel_cpu/src/nodes/reorg_yolo.h
@@ -27,8 +27,6 @@ public:
private:
int stride;
-
- std::string errorPrefix;
};
} // namespace node
diff --git a/src/plugins/intel_cpu/src/nodes/reshape.cpp b/src/plugins/intel_cpu/src/nodes/reshape.cpp
index 6189a888153..f4ee25aab83 100644
--- a/src/plugins/intel_cpu/src/nodes/reshape.cpp
+++ b/src/plugins/intel_cpu/src/nodes/reshape.cpp
@@ -37,8 +37,6 @@ Reshape::Reshape(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr c
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix = std::string(op->get_type_name()) + " node with name '" + getName() + "'";
-
if (isDynamicNode()) {
auto checkSecondInput = [](const std::shared_ptr<ov::Node>& op, const std::string opType) {
if (op->get_input_partial_shape(1).is_dynamic()) {
diff --git a/src/plugins/intel_cpu/src/nodes/reshape.h b/src/plugins/intel_cpu/src/nodes/reshape.h
index 126e8d90c6b..f64c6e2807b 100644
--- a/src/plugins/intel_cpu/src/nodes/reshape.h
+++ b/src/plugins/intel_cpu/src/nodes/reshape.h
@@ -31,8 +31,6 @@ public:
private:
mutable std::vector<int> lastSecondInputValues;
-
- std::string errorPrefix;
};
} // namespace node
diff --git a/src/plugins/intel_cpu/src/nodes/reverse_sequence.cpp b/src/plugins/intel_cpu/src/nodes/reverse_sequence.cpp
index 41f7c88f69d..9cdc9fa596b 100644
--- a/src/plugins/intel_cpu/src/nodes/reverse_sequence.cpp
+++ b/src/plugins/intel_cpu/src/nodes/reverse_sequence.cpp
@@ -35,36 +35,33 @@ ReverseSequence::ReverseSequence(const std::shared_ptr<ov::Node>& op, const Grap
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix = "ReverseSequence layer with name '" + op->get_friendly_name() + "'";
const auto revSeq = ov::as_type_ptr<const ov::opset1::ReverseSequence>(op);
if (revSeq == nullptr)
- OPENVINO_THROW("Operation with name '",
- op->get_friendly_name(),
- "' is not an instance of ReverseSequence from opset1.");
+ THROW_CPU_NODE_ERR("is not an instance of ReverseSequence from opset1.");
if (inputShapes.size() != 2 || outputShapes.size() != 1)
- OPENVINO_THROW(errorPrefix, " has incorrect number of input/output edges!");
+ THROW_CPU_NODE_ERR("has incorrect number of input/output edges!");
const auto dataRank = getInputShapeAtPort(REVERSESEQUENCE_DATA).getRank();
if (dataRank < 2)
- OPENVINO_THROW(errorPrefix, " 'data' rank should be greater than or equal to 2");
+ THROW_CPU_NODE_ERR("'data' rank should be greater than or equal to 2");
if (getInputShapeAtPort(REVERSESEQUENCE_LENGTHS).getRank() != 1)
- OPENVINO_THROW(errorPrefix, " 'seq_lengths' should be 1D tensor");
+ THROW_CPU_NODE_ERR("'seq_lengths' should be 1D tensor");
if (dataRank != getOutputShapeAtPort(0).getRank())
- OPENVINO_THROW(errorPrefix, " has input/output rank mismatch");
+ THROW_CPU_NODE_ERR("has input/output rank mismatch");
seq_axis = revSeq->get_sequence_axis();
if (seq_axis < 0 || seq_axis >= static_cast<int>(dataRank))
- OPENVINO_THROW(errorPrefix, " has incorrect 'seq_axis' parameters dimensions and axis number!");
+ THROW_CPU_NODE_ERR("has incorrect 'seq_axis' parameters dimensions and axis number!");
batch_axis = revSeq->get_batch_axis();
if (batch_axis < 0 || batch_axis >= static_cast<int>(dataRank))
- OPENVINO_THROW(errorPrefix, " has incorrect 'batch_axis' parameters dimensions and axis number!");
+ THROW_CPU_NODE_ERR("has incorrect 'batch_axis' parameters dimensions and axis number!");
}
void ReverseSequence::initSupportedPrimitiveDescriptors() {
@@ -86,13 +83,13 @@ void ReverseSequence::prepareParams() {
const auto& dstMemPtr = getDstMemoryAtPort(0);
if (!dataMemPtr || !dataMemPtr->isDefined())
- OPENVINO_THROW(errorPrefix, " has undefined input memory of 'data'");
+ THROW_CPU_NODE_ERR("has undefined input memory of 'data'");
if (!seqLengthsMemPtr || !seqLengthsMemPtr->isDefined())
- OPENVINO_THROW(errorPrefix, " has undefined input memory of 'seq_lengths'");
+ THROW_CPU_NODE_ERR("has undefined input memory of 'seq_lengths'");
if (!dstMemPtr || !dstMemPtr->isDefined())
- OPENVINO_THROW(errorPrefix, " has undefined output memory");
+ THROW_CPU_NODE_ERR("has undefined output memory");
if (getSelectedPrimitiveDescriptor() == nullptr)
- OPENVINO_THROW(errorPrefix, " has unidentified preferable primitive descriptor");
+ THROW_CPU_NODE_ERR("has unidentified preferable primitive descriptor");
const VectorDims& dataDims = dataMemPtr->getStaticDims();
const VectorDims& seqLengthsDims = seqLengthsMemPtr->getStaticDims();
@@ -174,7 +171,7 @@ void ReverseSequence::ReverseSequenceExecutor::exec(const MemoryPtr& dataMemPtr,
void ReverseSequence::execute(dnnl::stream strm) {
if (!execPtr)
- OPENVINO_THROW(errorPrefix, " has no compiled executor");
+ THROW_CPU_NODE_ERR("has no compiled executor");
const auto precision = getParentEdgeAt(REVERSESEQUENCE_LENGTHS)->getMemory().getDesc().getPrecision();
if (!one_of(precision, ov::element::f32, ov::element::i32))
diff --git a/src/plugins/intel_cpu/src/nodes/reverse_sequence.h b/src/plugins/intel_cpu/src/nodes/reverse_sequence.h
index c40d651db4f..3e9fa7e352a 100644
--- a/src/plugins/intel_cpu/src/nodes/reverse_sequence.h
+++ b/src/plugins/intel_cpu/src/nodes/reverse_sequence.h
@@ -53,7 +53,6 @@ private:
int batch_axis;
ov::element::Type lengthsPrecision;
- std::string errorPrefix;
};
} // namespace node
diff --git a/src/plugins/intel_cpu/src/nodes/roi_align.cpp b/src/plugins/intel_cpu/src/nodes/roi_align.cpp
index 8ef5dfff25b..38bf4594c4d 100644
--- a/src/plugins/intel_cpu/src/nodes/roi_align.cpp
+++ b/src/plugins/intel_cpu/src/nodes/roi_align.cpp
@@ -698,8 +698,6 @@ ROIAlign::ROIAlign(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr
: Node(op, context, NgraphShapeInferFactory(op)) {
std::string errorMessage;
if (isSupportedOperation(op, errorMessage)) {
- errorPrefix = "ROIPooling layer with name '" + getName() + "' ";
-
auto roiAlign = ov::as_type_ptr<const ov::opset9::ROIAlign>(op);
pooledH = roiAlign->get_pooled_h();
pooledW = roiAlign->get_pooled_w();
@@ -726,39 +724,38 @@ ROIAlign::ROIAlign(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr
void ROIAlign::getSupportedDescriptors() {
if (getParentEdges().size() != 3)
- OPENVINO_THROW(errorPrefix, "has incorrect number of input edges: ", getParentEdges().size());
+ THROW_CPU_NODE_ERR("has incorrect number of input edges: ", getParentEdges().size());
if (getChildEdges().empty())
- OPENVINO_THROW(errorPrefix, "has incorrect number of output edges: ", getChildEdges().size());
+ THROW_CPU_NODE_ERR("has incorrect number of output edges: ", getChildEdges().size());
if (getInputShapeAtPort(0).getRank() != 4) {
- OPENVINO_THROW(errorPrefix, "doesn't support 0th input with rank: ", getInputShapeAtPort(0).getRank());
+ THROW_CPU_NODE_ERR("doesn't support 0th input with rank: ", getInputShapeAtPort(0).getRank());
}
if (getInputShapeAtPort(1).getRank() != 2) {
- OPENVINO_THROW(errorPrefix, "doesn't support 1st input with rank: ", getInputShapeAtPort(1).getRank());
+ THROW_CPU_NODE_ERR("doesn't support 1st input with rank: ", getInputShapeAtPort(1).getRank());
}
if (getInputShapeAtPort(2).getRank() != 1) {
- OPENVINO_THROW(errorPrefix, "doesn't support 2nd input with rank: ", getInputShapeAtPort(2).getRank());
+ THROW_CPU_NODE_ERR("doesn't support 2nd input with rank: ", getInputShapeAtPort(2).getRank());
}
if (getOutputShapeAtPort(0).getRank() != 4) {
- OPENVINO_THROW(errorPrefix, "doesn't support output with rank: ", getOutputShapeAtPort(0).getRank());
+ THROW_CPU_NODE_ERR("doesn't support output with rank: ", getOutputShapeAtPort(0).getRank());
}
const auto& proposalsDims = getInputShapeAtPort(1).getDims();
if (proposalsDims[1] != 4) {
- OPENVINO_THROW(errorPrefix, "has invalid shape on 1st input: [", proposalsDims[0], ",", proposalsDims[1], "]");
+ THROW_CPU_NODE_ERR("has invalid shape on 1st input: [", proposalsDims[0], ",", proposalsDims[1], "]");
}
const auto& indexesDims = getInputShapeAtPort(2).getDims();
if (!dimsEqualWeak(proposalsDims[0], indexesDims[0])) {
- OPENVINO_THROW(errorPrefix,
- "has different sizes of inputs for proposals (",
- proposalsDims[0],
- ") and indexes (",
- indexesDims[0],
- ")");
+ THROW_CPU_NODE_ERR("has different sizes of inputs for proposals (",
+ proposalsDims[0],
+ ") and indexes (",
+ indexesDims[0],
+ ")");
}
}
@@ -835,9 +832,9 @@ void ROIAlign::createPrimitive() {
auto srcMemPtr = getSrcMemoryAtPort(0);
auto dstMemPtr = getDstMemoryAtPort(0);
if (!srcMemPtr)
- OPENVINO_THROW(errorPrefix, " has null input memory");
+ THROW_CPU_NODE_ERR("has null input memory");
if (!dstMemPtr)
- OPENVINO_THROW(errorPrefix, " has null destination memory");
+ THROW_CPU_NODE_ERR("has null destination memory");
if (!roi_align_kernel) {
ROIAlignLayoutType selectedLayout = ROIAlignLayoutType::nspc;
diff --git a/src/plugins/intel_cpu/src/nodes/roi_align.h b/src/plugins/intel_cpu/src/nodes/roi_align.h
index 20437d51fa9..dc78a23b4c7 100644
--- a/src/plugins/intel_cpu/src/nodes/roi_align.h
+++ b/src/plugins/intel_cpu/src/nodes/roi_align.h
@@ -81,8 +81,6 @@ private:
void createJitKernel(const ov::element::Type& dataPrec, const ROIAlignLayoutType& selectLayout);
std::shared_ptr<jit_uni_roi_align_kernel> roi_align_kernel = nullptr;
-
- std::string errorPrefix;
};
} // namespace node
diff --git a/src/plugins/intel_cpu/src/nodes/roi_pooling.cpp b/src/plugins/intel_cpu/src/nodes/roi_pooling.cpp
index a388a836961..20013eef3c6 100644
--- a/src/plugins/intel_cpu/src/nodes/roi_pooling.cpp
+++ b/src/plugins/intel_cpu/src/nodes/roi_pooling.cpp
@@ -408,8 +408,6 @@ ROIPooling::ROIPooling(const std::shared_ptr<ov::Node>& op, const GraphContext::
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- std::string errorPrefix = "ROIPooling layer with name '" + getName() + "' ";
-
auto roiPooling = ov::as_type_ptr<const ov::opset2::ROIPooling>(op);
refParams.pooled_h = roiPooling->get_output_roi()[0];
refParams.pooled_w = roiPooling->get_output_roi()[1];
@@ -424,25 +422,25 @@ ROIPooling::ROIPooling(const std::shared_ptr<ov::Node>& op, const GraphContext::
void ROIPooling::getSupportedDescriptors() {
if (getParentEdges().size() != 2)
- OPENVINO_THROW(errorPrefix, "has incorrect number of input edges: ", getParentEdges().size());
+ THROW_CPU_NODE_ERR("has incorrect number of input edges: ", getParentEdges().size());
if (getChildEdges().empty())
- OPENVINO_THROW(errorPrefix, "has incorrect number of output edges: ", getChildEdges().size());
+ THROW_CPU_NODE_ERR("has incorrect number of output edges: ", getChildEdges().size());
if (getInputShapeAtPort(0).getRank() != 4) {
- OPENVINO_THROW(errorPrefix, "doesn't support 0th input with rank: ", getInputShapeAtPort(0).getRank());
+ THROW_CPU_NODE_ERR("doesn't support 0th input with rank: ", getInputShapeAtPort(0).getRank());
}
if (getInputShapeAtPort(1).getRank() != 2) {
- OPENVINO_THROW(errorPrefix, "doesn't support 1st input with rank: ", getInputShapeAtPort(1).getRank());
+ THROW_CPU_NODE_ERR("doesn't support 1st input with rank: ", getInputShapeAtPort(1).getRank());
}
if (getOutputShapeAtPort(0).getRank() != 4) {
- OPENVINO_THROW(errorPrefix, "doesn't support output with rank: ", getOutputShapeAtPort(0).getRank());
+ THROW_CPU_NODE_ERR("doesn't support output with rank: ", getOutputShapeAtPort(0).getRank());
}
const auto& dims = getInputShapeAtPort(1).getDims();
if (dims[1] != 5) {
- OPENVINO_THROW(errorPrefix, "has invalid shape on 1st input: [", dims[0], ",", dims[1], "]");
+ THROW_CPU_NODE_ERR("has invalid shape on 1st input: [", dims[0], ",", dims[1], "]");
}
}
diff --git a/src/plugins/intel_cpu/src/nodes/roi_pooling.h b/src/plugins/intel_cpu/src/nodes/roi_pooling.h
index 9fe79623b3c..e02be525f0c 100644
--- a/src/plugins/intel_cpu/src/nodes/roi_pooling.h
+++ b/src/plugins/intel_cpu/src/nodes/roi_pooling.h
@@ -84,8 +84,6 @@ private:
jit_roi_pooling_params refParams = {};
- std::string errorPrefix;
-
class ROIPoolingExecutor {
public:
ROIPoolingExecutor() = default;
diff --git a/src/plugins/intel_cpu/src/nodes/roll.cpp b/src/plugins/intel_cpu/src/nodes/roll.cpp
index 2547b945bb5..3d6a422b634 100644
--- a/src/plugins/intel_cpu/src/nodes/roll.cpp
+++ b/src/plugins/intel_cpu/src/nodes/roll.cpp
@@ -38,49 +38,44 @@ Roll::Roll(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr context
: Node(op, context, NgraphShapeInferFactory(op)) {
std::string errorMessage;
if (isSupportedOperation(op, errorMessage)) {
- layerErrorPrefix = "Roll layer with name '" + getName() + "'";
if (inputShapes.size() != 3 || outputShapes.size() != 1) {
- OPENVINO_THROW(layerErrorPrefix, " has incorrect number of input/output edges!");
+ THROW_CPU_NODE_ERR("has incorrect number of input/output edges!");
}
const auto& dataPrecision = getOriginalInputPrecisionAtPort(DATA_INDEX);
if (std::find(supportedPrecisionSizes.begin(), supportedPrecisionSizes.end(), dataPrecision.size()) ==
supportedPrecisionSizes.end())
- OPENVINO_THROW(layerErrorPrefix, "has unsupported precision: ", dataPrecision.get_type_name());
+ THROW_CPU_NODE_ERR("as unsupported precision: ", dataPrecision.get_type_name());
const auto dataRank = getInputShapeAtPort(DATA_INDEX).getRank();
if (dataRank < 1) {
- OPENVINO_THROW(layerErrorPrefix, " doesn't support 'data' input tensor with rank: ", dataRank);
+ THROW_CPU_NODE_ERR("doesn't support 'data' input tensor with rank: ", dataRank);
}
if (dataRank != getOutputShapeAtPort(0).getRank())
- OPENVINO_THROW(layerErrorPrefix, " has input/output rank mismatch");
+ THROW_CPU_NODE_ERR("has input/output rank mismatch");
/* Axes */
const auto& axesTensorPrec = getOriginalInputPrecisionAtPort(AXES_INDEX);
if (axesTensorPrec != ov::element::i32 && axesTensorPrec != ov::element::i64) {
- OPENVINO_THROW(layerErrorPrefix,
- " has unsupported 'axes' input precision: ",
- axesTensorPrec.get_type_name());
+ THROW_CPU_NODE_ERR("has unsupported 'axes' input precision: ", axesTensorPrec.get_type_name());
}
const auto axesTensorRank = getInputShapeAtPort(AXES_INDEX).getRank();
if (axesTensorRank > 1) {
- OPENVINO_THROW(layerErrorPrefix, " doesn't support 'axes' input tensor with rank: ", axesTensorRank);
+ THROW_CPU_NODE_ERR("doesn't support 'axes' input tensor with rank: ", axesTensorRank);
}
/* Shift */
const auto& shiftTensorPrec = getOriginalInputPrecisionAtPort(SHIFT_INDEX);
if (shiftTensorPrec != ov::element::i32 && shiftTensorPrec != ov::element::i64) {
- OPENVINO_THROW(layerErrorPrefix,
- " has unsupported 'shift' input precision: ",
- shiftTensorPrec.get_type_name());
+ THROW_CPU_NODE_ERR("has unsupported 'shift' input precision: ", shiftTensorPrec.get_type_name());
}
const auto shiftTensorRank = getInputShapeAtPort(SHIFT_INDEX).getRank();
if (shiftTensorRank > 1) {
- OPENVINO_THROW(layerErrorPrefix, " doesn't support 'shift' input tensor with rank: ", shiftTensorRank);
+ THROW_CPU_NODE_ERR("doesn't support 'shift' input tensor with rank: ", shiftTensorRank);
}
} else {
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
@@ -108,15 +103,15 @@ void Roll::prepareParams() {
const auto& dstMemPtr = getDstMemoryAtPort(0);
if (!dataMemPtr || !dataMemPtr->isDefined())
- OPENVINO_THROW(layerErrorPrefix, " has undefined input memory of 'data'");
+ THROW_CPU_NODE_ERR("has undefined input memory of 'data'");
if (!shiftMemPtr || !shiftMemPtr->isDefined())
- OPENVINO_THROW(layerErrorPrefix, " has undefined input memory of 'shift'");
+ THROW_CPU_NODE_ERR("has undefined input memory of 'shift'");
if (!axesMemPtr || !axesMemPtr->isDefined())
- OPENVINO_THROW(layerErrorPrefix, " has undefined input memory of 'axes'");
+ THROW_CPU_NODE_ERR("has undefined input memory of 'axes'");
if (!dstMemPtr || !dstMemPtr->isDefined())
- OPENVINO_THROW(layerErrorPrefix, " has undefined output memory");
+ THROW_CPU_NODE_ERR("has undefined output memory");
if (getSelectedPrimitiveDescriptor() == nullptr)
- OPENVINO_THROW(layerErrorPrefix, " has unidentified preferable primitive descriptor");
+ THROW_CPU_NODE_ERR("has unidentified preferable primitive descriptor");
const VectorDims& dataDims = dataMemPtr->getStaticDims();
const VectorDims& shiftDims = shiftMemPtr->getStaticDims();
@@ -132,7 +127,7 @@ void Roll::executeDynamicImpl(dnnl::stream strm) {
void Roll::execute(dnnl::stream strm) {
if (!execPtr)
- OPENVINO_THROW(layerErrorPrefix, " has no compiled executor");
+ THROW_CPU_NODE_ERR("has no compiled executor");
const auto dataPrecision = getParentEdgeAt(DATA_INDEX)->getMemory().getDesc().getPrecision();
const auto& dataTypeSize = dataPrecision.size();
@@ -159,7 +154,7 @@ void Roll::execute(dnnl::stream strm) {
break;
}
default:
- OPENVINO_THROW(layerErrorPrefix, "has unsupported 'data' input precision: ", dataPrecision.get_type_name());
+ THROW_CPU_NODE_ERR("as unsupported 'data' input precision: ", dataPrecision.get_type_name());
}
}
diff --git a/src/plugins/intel_cpu/src/nodes/roll.h b/src/plugins/intel_cpu/src/nodes/roll.h
index c32967068e0..35fe87994aa 100644
--- a/src/plugins/intel_cpu/src/nodes/roll.h
+++ b/src/plugins/intel_cpu/src/nodes/roll.h
@@ -48,8 +48,6 @@ private:
using ExecutorPtr = std::shared_ptr<RollExecutor>;
ExecutorPtr execPtr = nullptr;
- std::string layerErrorPrefix;
-
static constexpr std::array<size_t, 3> supportedPrecisionSizes{1, 2, 4};
static constexpr size_t DATA_INDEX = 0ul;
static constexpr size_t SHIFT_INDEX = 1ul;
diff --git a/src/plugins/intel_cpu/src/nodes/scatter_update.cpp b/src/plugins/intel_cpu/src/nodes/scatter_update.cpp
index 0a5c95ff18f..3225d9d8f8d 100644
--- a/src/plugins/intel_cpu/src/nodes/scatter_update.cpp
+++ b/src/plugins/intel_cpu/src/nodes/scatter_update.cpp
@@ -82,9 +82,7 @@ ScatterUpdate::ScatterUpdate(const std::shared_ptr<ov::Node>& op, const GraphCon
indicesPrec(ov::element::undefined),
axisPrec(ov::element::undefined) {
std::string errorMessage;
- if (isSupportedOperation(op, errorMessage)) {
- errorPrefix = std::string(op->get_type_name()) + " node with name '" + getName() + "'";
- } else {
+ if (!isSupportedOperation(op, errorMessage)) {
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
// In ov::PartialShape with rank 0 (scalars) is converted to ov::intel_cpu::Shape with rank 1.
@@ -105,10 +103,10 @@ ScatterUpdate::ScatterUpdate(const std::shared_ptr<ov::Node>& op, const GraphCon
axisRelaxed = false;
isUpdateScalar = ov::is_scalar(op->get_input_partial_shape(2));
} else {
- THROW_CPU_NODE_ERR(errorPrefix, " is not supported");
+ THROW_CPU_NODE_ERR("is not supported");
}
if (is_not_supported_input) {
- THROW_CPU_NODE_ERR(errorPrefix, " do not support scalar input");
+ THROW_CPU_NODE_ERR("do not support scalar input");
}
reduction_type = ScatterUpdate::Reduction::NONE;
@@ -168,9 +166,9 @@ ScatterUpdate::ScatterUpdate(const std::shared_ptr<ov::Node>& op, const GraphCon
void ScatterUpdate::getSupportedDescriptors() {
if ((getParentEdges().size() != 3) && (getParentEdges().size() != 4))
- THROW_CPU_NODE_ERR(errorPrefix, " has incorrect number of input edges");
+ THROW_CPU_NODE_ERR("has incorrect number of input edges");
if (getChildEdges().empty())
- THROW_CPU_NODE_ERR(errorPrefix, " has incorrect number of output edges");
+ THROW_CPU_NODE_ERR("has incorrect number of output edges");
}
void ScatterUpdate::initSupportedPrimitiveDescriptors() {
@@ -189,12 +187,11 @@ void ScatterUpdate::initSupportedPrimitiveDescriptors() {
// common check
if (srcRank != dstRank) {
- THROW_CPU_NODE_ERR(errorPrefix, " should have same rank for input and output tensor");
+ THROW_CPU_NODE_ERR("should have same rank for input and output tensor");
} else {
for (size_t r = 0; r < srcRank; r++) {
if (!dimsEqualWeak(srcDataDim[r], dstDataDim[r])) {
- THROW_CPU_NODE_ERR(errorPrefix,
- " should have same shape for input and output tensor. The input shape is ",
+ THROW_CPU_NODE_ERR("should have same shape for input and output tensor. The input shape is ",
srcDataDim[r],
", while output shape is ",
dstDataDim[r],
@@ -208,8 +205,7 @@ void ScatterUpdate::initSupportedPrimitiveDescriptors() {
switch (scatterUpdateMode) {
case ScatterUpdateMode::ScatterUpdate: {
if (updateRank != (srcRank + indicesRank - 1)) {
- THROW_CPU_NODE_ERR(errorPrefix,
- " do not have matched tensor rank relationship for input, indices and update");
+ THROW_CPU_NODE_ERR("do not have matched tensor rank relationship for input, indices and update");
}
break;
}
@@ -217,8 +213,7 @@ void ScatterUpdate::initSupportedPrimitiveDescriptors() {
if (indicesDim[indicesRank - 1] != Shape::UNDEFINED_DIM) {
size_t k = indicesDim[indicesRank - 1];
if (k > srcRank) {
- THROW_CPU_NODE_ERR(errorPrefix,
- "' do not have an correct indices' last dimension value, ",
+ THROW_CPU_NODE_ERR("do not have an correct indices' last dimension value, ",
"which should be smaller than or equal to input tensor rank");
}
@@ -238,13 +233,11 @@ void ScatterUpdate::initSupportedPrimitiveDescriptors() {
updateAxisIter++;
}
if (expectUpdateShape.size() != updateRank) {
- THROW_CPU_NODE_ERR(errorPrefix,
- " do not have matched tensor rank relationship for input, indices and update");
+ THROW_CPU_NODE_ERR("do not have matched tensor rank relationship for input, indices and update");
}
for (size_t ru = 0; ru < updateRank; ru++) {
if (!dimsEqualWeak(updateDim[ru], expectUpdateShape[ru])) {
- THROW_CPU_NODE_ERR(errorPrefix,
- " do not have matched tensor shape relationship for input, indices and update");
+ THROW_CPU_NODE_ERR("do not have matched tensor shape relationship for input, indices and update");
}
}
}
@@ -252,17 +245,17 @@ void ScatterUpdate::initSupportedPrimitiveDescriptors() {
}
case ScatterUpdateMode::ScatterElementsUpdate: {
if (srcRank != indicesRank || srcRank != updateRank) {
- THROW_CPU_NODE_ERR(errorPrefix, " do not have the same tensor rank for input, indices and update");
+ THROW_CPU_NODE_ERR("do not have the same tensor rank for input, indices and update");
}
for (size_t ri = 0; ri < indicesRank; ri++) {
if (!dimsEqualWeak(indicesDim[ri], updateDim[ri])) {
- THROW_CPU_NODE_ERR(errorPrefix, " do not have the same tensor shape for indices and update");
+ THROW_CPU_NODE_ERR("do not have the same tensor shape for indices and update");
}
}
break;
}
default: {
- THROW_CPU_NODE_ERR(errorPrefix, " is not supported");
+ THROW_CPU_NODE_ERR("is not supported");
}
}
@@ -881,8 +874,7 @@ void ScatterUpdate::execute(dnnl::stream strm) {
}
if (axis >= static_cast<int>(srcRank) || axis < (static_cast<int>(srcRank) * -1)) {
- THROW_CPU_NODE_ERR(errorPrefix,
- " should have axis value in range [-r, r - 1], where r is the rank of input data");
+ THROW_CPU_NODE_ERR("should have axis value in range [-r, r - 1], where r is the rank of input data");
}
axis = axis < 0 ? (axis + srcRank) : axis;
@@ -895,8 +887,7 @@ void ScatterUpdate::execute(dnnl::stream strm) {
int64_t idxValue = getIndicesValue(indicesPtr, i);
if (idxValue >= static_cast<int64_t>(srcDimAxis) ||
(idxValue < 0 && scatterUpdateMode != ScatterUpdateMode::ScatterElementsUpdate)) {
- THROW_CPU_NODE_ERR(errorPrefix,
- " have indices value that points to non-existing output tensor element");
+ THROW_CPU_NODE_ERR("have indices value that points to non-existing output tensor element");
}
}
});
@@ -920,15 +911,13 @@ void ScatterUpdate::execute(dnnl::stream strm) {
}
}
if (updateRank > expectUpdateShape.size())
- THROW_CPU_NODE_ERR(errorPrefix,
- " cannot update shape. New rank: ",
+ THROW_CPU_NODE_ERR("cannot update shape. New rank: ",
updateRank,
", expected: ",
expectUpdateShape.size());
for (size_t ru = 0; ru < updateRank; ru++) {
if (updateDim[ru] != expectUpdateShape[ru]) {
- THROW_CPU_NODE_ERR(errorPrefix,
- " do not have matched tensor shape relationship for input, indices and update");
+ THROW_CPU_NODE_ERR("do not have matched tensor shape relationship for input, indices and update");
}
}
}
@@ -963,7 +952,7 @@ void ScatterUpdate::execute(dnnl::stream strm) {
break;
}
default: {
- THROW_CPU_NODE_ERR(errorPrefix, " is not supported");
+ THROW_CPU_NODE_ERR("is not supported");
}
}
}
diff --git a/src/plugins/intel_cpu/src/nodes/scatter_update.h b/src/plugins/intel_cpu/src/nodes/scatter_update.h
index ae2c30a37cc..4dc9ed1be59 100644
--- a/src/plugins/intel_cpu/src/nodes/scatter_update.h
+++ b/src/plugins/intel_cpu/src/nodes/scatter_update.h
@@ -137,8 +137,6 @@ private:
// In ov::PartialShape with rank 0 (scalars) is converted to ov::intel_cpu::Shape with rank 1.
// Add flag set in constructor for workaround for ScatterNDUpdates
bool isUpdateScalar = false;
-
- std::string errorPrefix;
};
} // namespace node
diff --git a/src/plugins/intel_cpu/src/nodes/shapeof.cpp b/src/plugins/intel_cpu/src/nodes/shapeof.cpp
index 5426c0dda51..43f30b680c8 100644
--- a/src/plugins/intel_cpu/src/nodes/shapeof.cpp
+++ b/src/plugins/intel_cpu/src/nodes/shapeof.cpp
@@ -29,9 +29,8 @@ ShapeOf::ShapeOf(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr c
: Node(op, context, ShapeOfShapeInferFactory()) {
std::string errorMessage;
if (isSupportedOperation(op, errorMessage)) {
- errorPrefix = "ShapeOf layer with name '" + getName() + "' ";
if (op->get_input_partial_shape(0).size() == 0)
- OPENVINO_THROW(errorPrefix, "gets unsupported input 0D tensor (scalar)");
+ THROW_CPU_NODE_ERR("gets unsupported input 0D tensor (scalar)");
} else {
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
@@ -39,9 +38,9 @@ ShapeOf::ShapeOf(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr c
void ShapeOf::getSupportedDescriptors() {
if (getParentEdges().size() != 1)
- OPENVINO_THROW(errorPrefix, "has incorrect number of input edges: ", getParentEdges().size());
+ THROW_CPU_NODE_ERR("has incorrect number of input edges: ", getParentEdges().size());
if (getChildEdges().empty())
- OPENVINO_THROW(errorPrefix, "has incorrect number of output edges: ", getChildEdges().size());
+ THROW_CPU_NODE_ERR("has incorrect number of output edges: ", getChildEdges().size());
}
void ShapeOf::initSupportedPrimitiveDescriptors() {
@@ -89,7 +88,7 @@ void ShapeOf::execute(dnnl::stream strm) {
auto&& inDims = inPtr->getStaticDims();
size_t dimsCount = inDims.size();
if (outPtr->getStaticDims().size() != 1 || dimsCount != outPtr->getStaticDims()[0])
- OPENVINO_THROW(errorPrefix, "has inconsistent input shape and output size");
+ THROW_CPU_NODE_ERR("has inconsistent input shape and output size");
auto* dst = outPtr->getDataAs<int>();
diff --git a/src/plugins/intel_cpu/src/nodes/shapeof.h b/src/plugins/intel_cpu/src/nodes/shapeof.h
index 6dfd63946ec..7b2ebb733e9 100644
--- a/src/plugins/intel_cpu/src/nodes/shapeof.h
+++ b/src/plugins/intel_cpu/src/nodes/shapeof.h
@@ -35,9 +35,6 @@ public:
bool isExecutable() const override;
static bool isSupportedOperation(const std::shared_ptr<const ov::Node>& op, std::string& errorMessage) noexcept;
-
-private:
- std::string errorPrefix;
};
} // namespace node
diff --git a/src/plugins/intel_cpu/src/nodes/space_to_batch.cpp b/src/plugins/intel_cpu/src/nodes/space_to_batch.cpp
index c2d28fa6eba..c01cd65a940 100644
--- a/src/plugins/intel_cpu/src/nodes/space_to_batch.cpp
+++ b/src/plugins/intel_cpu/src/nodes/space_to_batch.cpp
@@ -32,17 +32,15 @@ SpaceToBatch::SpaceToBatch(const std::shared_ptr<ov::Node>& op, const GraphConte
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix = "BatchToSpace layer with name '" + op->get_friendly_name() + "'";
-
if (inputShapes.size() != 4 || outputShapes.size() != 1)
- OPENVINO_THROW(errorPrefix, " has incorrect number of input or output edges!");
+ THROW_CPU_NODE_ERR("has incorrect number of input or output edges!");
const size_t srcRank = getInputShapeAtPort(0).getRank();
const size_t dstRank = getOutputShapeAtPort(0).getRank();
if (srcRank < 4 || srcRank > 5)
- OPENVINO_THROW(errorPrefix, " has unsupported 'data' input rank: ", srcRank);
+ THROW_CPU_NODE_ERR("has unsupported 'data' input rank: ", srcRank);
if (srcRank != dstRank)
- OPENVINO_THROW(errorPrefix, " has incorrect number of input/output dimensions");
+ THROW_CPU_NODE_ERR("has incorrect number of input/output dimensions");
}
void SpaceToBatch::initSupportedPrimitiveDescriptors() {
@@ -53,7 +51,7 @@ void SpaceToBatch::initSupportedPrimitiveDescriptors() {
const auto precision = getOriginalInputPrecisionAtPort(0);
const std::set<size_t> supported_precision_sizes = {1, 2, 4, 8};
if (supported_precision_sizes.find(precision.size()) == supported_precision_sizes.end())
- OPENVINO_THROW(errorPrefix, " has unsupported precision: ", precision.get_type_name());
+ THROW_CPU_NODE_ERR("has unsupported precision: ", precision.get_type_name());
addSupportedPrimDesc({{LayoutType::nspc, precision},
{LayoutType::ncsp, ov::element::i32},
diff --git a/src/plugins/intel_cpu/src/nodes/space_to_batch.h b/src/plugins/intel_cpu/src/nodes/space_to_batch.h
index 82861bac602..fec4423a91a 100644
--- a/src/plugins/intel_cpu/src/nodes/space_to_batch.h
+++ b/src/plugins/intel_cpu/src/nodes/space_to_batch.h
@@ -37,8 +37,6 @@ private:
std::vector<size_t> blockShapeIn;
std::vector<size_t> padsBeginIn;
- std::string errorPrefix;
-
template <typename T>
void SpaceToBatchKernel();
};
diff --git a/src/plugins/intel_cpu/src/nodes/strided_slice.cpp b/src/plugins/intel_cpu/src/nodes/strided_slice.cpp
index 45067b9addc..542f8897c2d 100644
--- a/src/plugins/intel_cpu/src/nodes/strided_slice.cpp
+++ b/src/plugins/intel_cpu/src/nodes/strided_slice.cpp
@@ -39,7 +39,6 @@ StridedSlice::StridedSlice(const std::shared_ptr<ov::Node>& op, const GraphConte
if (!isSupportedOperation(op, errorMessage)) {
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix = NameFromType(getType()) + " node with name '" + getName() + "' ";
attrs.isStridedSliceOp = ov::is_type<ov::op::v1::StridedSlice>(op);
attrs.isSliceScatterOp = ov::is_type<ov::op::v15::SliceScatter>(op);
@@ -58,10 +57,10 @@ StridedSlice::StridedSlice(const std::shared_ptr<ov::Node>& op, const GraphConte
if ((attrs.isStridedSliceOp && (inputShapes.size() < 3 || inputShapes.size() > 4)) ||
(!attrs.isStridedSliceOp &&
(inputShapes.size() < (attrs.STRIDE_ID + 1) || inputShapes.size() > (attrs.AXES_ID + 1)))) {
- OPENVINO_THROW(errorPrefix, "has incorrect number of input edges");
+ THROW_CPU_NODE_ERR("has incorrect number of input edges");
}
if (outputShapes.size() != 1) {
- OPENVINO_THROW(errorPrefix, "has incorrect number of output edges");
+ THROW_CPU_NODE_ERR("has incorrect number of output edges");
}
if (inputShapes.size() > attrs.STRIDE_ID) {
@@ -128,7 +127,7 @@ StridedSlice::StridedSlice(const std::shared_ptr<ov::Node>& op, const GraphConte
attrs.ellipsisPos1 = attrs.ellipsisMask[i] == 1 && attrs.ellipsisPos1 == -1 ? i : attrs.ellipsisPos1;
}
if (attrs.ellipsisMaskCounter > 1)
- OPENVINO_THROW(errorPrefix, "has incorrect 'Ellipsis_mask'. Only one non-zero bit is allowed");
+ THROW_CPU_NODE_ERR("has incorrect 'Ellipsis_mask'. Only one non-zero bit is allowed");
int newAxis = std::accumulate(attrs.newAxisMask.begin(), attrs.newAxisMask.end(), 0);
int shrinkAxis = std::accumulate(attrs.shrinkAxisMask.begin(), attrs.shrinkAxisMask.end(), 0);
@@ -334,7 +333,7 @@ void StridedSlice::prepareParams() {
dstMemory.push_back(getDstMemoryAtPort(i));
}
}
- execPtr = std::make_shared<StridedSliceCommonExecutor>(attrs, srcMemory, dstMemory, errorPrefix);
+ execPtr = std::make_shared<StridedSliceCommonExecutor>(attrs, srcMemory, dstMemory);
}
bool StridedSlice::needShapeInfer() const {
@@ -343,7 +342,7 @@ bool StridedSlice::needShapeInfer() const {
void StridedSlice::execute(dnnl::stream strm) {
if (!execPtr)
- OPENVINO_THROW(errorPrefix, "doesn't have compiled executor!");
+ THROW_CPU_NODE_ERR("doesn't have compiled executor!");
execPtr->exec(srcMemory, dstMemory);
}
@@ -358,9 +357,8 @@ bool StridedSlice::created() const {
StridedSlice::StridedSliceCommonExecutor::StridedSliceCommonExecutor(const StridedSliceAttributes& attrs,
const std::vector<MemoryCPtr>& srcMemory,
- const std::vector<MemoryCPtr>& dstMemory,
- const std::string& errorPrefix)
- : StridedSliceExecutor(attrs, srcMemory, dstMemory, errorPrefix) {
+ const std::vector<MemoryCPtr>& dstMemory)
+ : StridedSliceExecutor(attrs, srcMemory, dstMemory) {
paramsInitialization(attrs, srcMemory, dstMemory);
dimsNormalization();
dimsGluing();
@@ -442,11 +440,11 @@ void StridedSlice::StridedSliceCommonExecutor::paramsInitialization(const Stride
params.attrs.beginDims = srcMemory[attrs.BEGIN_ID]->getShape().getStaticDims();
params.attrs.endDims = srcMemory[attrs.END_ID]->getShape().getStaticDims();
if (params.attrs.beginDims.size() != 1)
- OPENVINO_THROW(errorPrefix, "should have begin vector with 1 dimension");
+ OPENVINO_THROW("Strided slice common executor should have begin vector with 1 dimension");
if (params.attrs.endDims.size() != 1)
- OPENVINO_THROW(errorPrefix, "should have end vector with 1 dimension");
+ OPENVINO_THROW("Strided slice common executor should have end vector with 1 dimension");
if (params.attrs.beginDims[0] != params.attrs.endDims[0])
- OPENVINO_THROW(errorPrefix, "should have begin vector with size equal to end vector size");
+ OPENVINO_THROW("Strided slice common executor should have begin vector with size equal to end vector size");
if (params.attrs.begin.empty())
fillingInParameters(params.attrs.begin, attrs.BEGIN_ID, params.attrs.beginDims[0], 0);
@@ -456,9 +454,10 @@ void StridedSlice::StridedSliceCommonExecutor::paramsInitialization(const Stride
if (srcMemory.size() > attrs.STRIDE_ID) {
params.attrs.strideDims = srcMemory[attrs.STRIDE_ID]->getShape().getStaticDims();
if (params.attrs.strideDims.size() > 1)
- OPENVINO_THROW(errorPrefix, "should have stride vector with 1 dimension");
+ OPENVINO_THROW("Strided slice common executor should have stride vector with 1 dimension");
if (params.attrs.beginDims[0] != params.attrs.strideDims[0])
- OPENVINO_THROW(errorPrefix, "should have stride vector with size equal to begin vector size");
+ OPENVINO_THROW(
+ "Strided slice common executor should have stride vector with size equal to begin vector size");
if (params.attrs.stride.empty())
fillingInParameters(params.attrs.stride, attrs.STRIDE_ID, params.attrs.strideDims[0], 1);
@@ -467,9 +466,10 @@ void StridedSlice::StridedSliceCommonExecutor::paramsInitialization(const Stride
if (srcMemory.size() > attrs.AXES_ID) {
params.attrs.axesDims = srcMemory[attrs.AXES_ID]->getShape().getStaticDims();
if (params.attrs.axesDims.size() != 1)
- OPENVINO_THROW(errorPrefix, "should have axes vector with 1 dimension.");
+ OPENVINO_THROW("Strided slice common executor should have axes vector with 1 dimension.");
if (params.attrs.beginDims[0] != params.attrs.axesDims[0])
- OPENVINO_THROW(errorPrefix, "should have axes vector with size equal to begin vector size.");
+ OPENVINO_THROW(
+ "Strided slice common executor should have axes vector with size equal to begin vector size.");
if (params.attrs.axes.empty())
fillingInParameters(params.attrs.axes, attrs.AXES_ID, params.attrs.axesDims[0], 0);
diff --git a/src/plugins/intel_cpu/src/nodes/strided_slice.h b/src/plugins/intel_cpu/src/nodes/strided_slice.h
index e85ad381edf..b21e99c7efe 100644
--- a/src/plugins/intel_cpu/src/nodes/strided_slice.h
+++ b/src/plugins/intel_cpu/src/nodes/strided_slice.h
@@ -72,22 +72,16 @@ private:
public:
StridedSliceExecutor(const StridedSliceAttributes& attrs,
const std::vector<MemoryCPtr>& srcMemory,
- const std::vector<MemoryCPtr>& dstMemory,
- const std::string& errorPrefix)
- : errorPrefix(errorPrefix) {}
+ const std::vector<MemoryCPtr>& dstMemory) {}
virtual void exec(const std::vector<MemoryCPtr>& srcMemory, const std::vector<MemoryCPtr>& dstMemory) = 0;
virtual ~StridedSliceExecutor() = default;
-
- protected:
- const std::string errorPrefix;
};
class StridedSliceCommonExecutor : public StridedSliceExecutor {
public:
StridedSliceCommonExecutor(const StridedSliceAttributes& attrs,
const std::vector<MemoryCPtr>& srcMemory,
- const std::vector<MemoryCPtr>& dstMemory,
- const std::string& errorPrefix);
+ const std::vector<MemoryCPtr>& dstMemory);
void exec(const std::vector<MemoryCPtr>& srcMemory, const std::vector<MemoryCPtr>& dstMemory) override;
void execSliceScatter(const std::vector<MemoryCPtr>& srcMemory, const std::vector<MemoryCPtr>& dstMemory);
void execStridedSlice(const std::vector<MemoryCPtr>& srcMemory, const std::vector<MemoryCPtr>& dstMemory);
@@ -134,8 +128,6 @@ private:
std::vector<MemoryCPtr> srcMemory;
std::vector<MemoryCPtr> dstMemory;
-
- std::string errorPrefix;
};
} // namespace node
diff --git a/src/plugins/intel_cpu/src/nodes/tile.cpp b/src/plugins/intel_cpu/src/nodes/tile.cpp
index 55ecea64681..473d404a0b5 100644
--- a/src/plugins/intel_cpu/src/nodes/tile.cpp
+++ b/src/plugins/intel_cpu/src/nodes/tile.cpp
@@ -40,8 +40,6 @@ Tile::Tile(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr context
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
- errorPrefix = "Tile node with name '" + getName() + "'";
-
if (ov::is_type<ov::op::v0::Constant>(op->get_input_node_ptr(TILE_REPEATS))) {
constMap[TILE_REPEATS] = true;
repeats = originRepeats =
@@ -63,38 +61,34 @@ void Tile::getSupportedDescriptors() {
return result;
};
if (getParentEdges().size() != 2)
- OPENVINO_THROW(errorPrefix,
- " has incorrect number of input edges. "
- "Expected: 2, Actual: ",
- getParentEdges().size());
+ THROW_CPU_NODE_ERR("has incorrect number of input edges. "
+ "Expected: 2, Actual: ",
+ getParentEdges().size());
if (getChildEdges().empty())
- OPENVINO_THROW(errorPrefix, " has no output edges.");
+ THROW_CPU_NODE_ERR("has no output edges.");
const auto& dstDims0 = getOutputShapeAtPort(0).getDims();
for (size_t i = 1lu; i < outputShapes.size(); i++) {
const auto& dstDims = getOutputShapeAtPort(i).getDims();
if (dstDims.size() != dstDims0.size())
- OPENVINO_THROW(errorPrefix,
- " has output edges 0 and ",
- i,
- " with different ranks: ",
- dstDims0.size(),
- " and ",
- dstDims.size());
- for (size_t j = 0; j < dstDims0.size(); j++) {
- if (dstDims0[j] != dstDims[j]) {
- OPENVINO_THROW(errorPrefix,
- " has output edges 0 and ",
+ THROW_CPU_NODE_ERR("has output edges 0 and ",
i,
- " with different dims: ",
- vec_to_string(dstDims0),
+ " with different ranks: ",
+ dstDims0.size(),
" and ",
- vec_to_string(dstDims));
+ dstDims.size());
+ for (size_t j = 0; j < dstDims0.size(); j++) {
+ if (dstDims0[j] != dstDims[j]) {
+ THROW_CPU_NODE_ERR("has output edges 0 and ",
+ i,
+ " with different dims: ",
+ vec_to_string(dstDims0),
+ " and ",
+ vec_to_string(dstDims));
}
}
}
if (constMap[TILE_REPEATS] && getInputShapeAtPort(TILE_INPUT).getRank() > getOutputShapeAtPort(0).getRank())
- OPENVINO_THROW(
- errorPrefix,
+ THROW_CPU_NODE_ERR(
" has incorrect input/output data shape rank. Input shape rank cannot be more than output shape rank. "
"Actual input shape size: ",
getInputShapeAtPort(TILE_INPUT).getRank(),
diff --git a/src/plugins/intel_cpu/src/nodes/tile.h b/src/plugins/intel_cpu/src/nodes/tile.h
index 809aff7b704..0bb43ac91e8 100644
--- a/src/plugins/intel_cpu/src/nodes/tile.h
+++ b/src/plugins/intel_cpu/src/nodes/tile.h
@@ -39,8 +39,6 @@ private:
int tiles = 0;
bool noTiling = false;
VectorDims originRepeats;
-
- std::string errorPrefix;
};
} // namespace node
diff --git a/src/plugins/intel_cpu/src/nodes/topk.cpp b/src/plugins/intel_cpu/src/nodes/topk.cpp
index 673011c2c74..f20bfeb8f59 100644
--- a/src/plugins/intel_cpu/src/nodes/topk.cpp
+++ b/src/plugins/intel_cpu/src/nodes/topk.cpp
@@ -1891,8 +1891,6 @@ TopK::TopK(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr context
: Node(op, context, NgraphShapeInferFactory(op)) {
std::string errorMessage;
if (isSupportedOperation(op, errorMessage)) {
- errorPrefix = "TopK layer with name '" + getName() + "'";
-
auto topKOp = ov::as_type_ptr<const ov::op::util::TopKBase>(op);
auto in_dims = topKOp->get_input_partial_shape(TOPK_DATA);
@@ -1903,7 +1901,7 @@ TopK::TopK(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr context
if (!isDynamicNgraphNode(op)) {
auto topKConst = ov::as_type_ptr<const ov::op::v0::Constant>(topKOp->get_input_node_shared_ptr(TOPK_K));
if (!topKConst) {
- OPENVINO_THROW(errorPrefix, "gets non-constant second tensor in static shape mode!");
+ THROW_CPU_NODE_ERR("gets non-constant second tensor in static shape mode!");
}
}
@@ -1925,21 +1923,21 @@ TopK::TopK(const std::shared_ptr<ov::Node>& op, const GraphContext::CPtr context
vec_idx_block.clear();
if (inputShapes.size() != 2 || outputShapes.size() < 2)
- OPENVINO_THROW(errorPrefix, " gets incorrect number of input/output edges!");
+ THROW_CPU_NODE_ERR("gets incorrect number of input/output edges!");
if (getInputShapeAtPort(TOPK_DATA).getRank() != getOutputShapeAtPort(TOPK_DATA).getRank())
- OPENVINO_THROW(errorPrefix, " gets incorrect number of input/output dimensions!");
+ THROW_CPU_NODE_ERR("gets incorrect number of input/output dimensions!");
if (getInputShapeAtPort(TOPK_K).getRank() != 1)
- OPENVINO_THROW(errorPrefix, " gets incorrect index vector dimension! Index vector should be 1 dimension.");
+ THROW_CPU_NODE_ERR("gets incorrect index vector dimension! Index vector should be 1 dimension.");
if (out_dims != out_idx_dims)
- OPENVINO_THROW(errorPrefix, " gets incorrect output tensor dimension sizes!");
+ THROW_CPU_NODE_ERR("gets incorrect output tensor dimension sizes!");
if (axis < 0)
axis += in_dims_size;
if (axis < 0 || axis >= static_cast<int>(in_dims_size))
- OPENVINO_THROW(errorPrefix, " gets incorrect input parameters dimensions and axis number!");
+ THROW_CPU_NODE_ERR("gets incorrect input parameters dimensions and axis number!");
} else {
OPENVINO_THROW_NOT_IMPLEMENTED(errorMessage);
}
@@ -1976,7 +1974,7 @@ void TopK::initSupportedPrimitiveDescriptors() {
ov::element::Type dataPrecision = getOriginalOutputPrecisionAtPort(TOPK_DATA);
if (dataPrecision == ov::element::bf16 && !mayiuse(avx512_core))
- OPENVINO_THROW(errorPrefix, " gets incorrect isa for BF16! AVX512 must be supported!");
+ THROW_CPU_NODE_ERR("gets incorrect isa for BF16! AVX512 must be supported!");
bool precisionSupported = std::find(std::begin(supportedPrecision), std::end(supportedPrecision), dataPrecision) !=
std::end(supportedPrecision);
if (!precisionSupported) {
@@ -2046,11 +2044,11 @@ void TopK::prepareParams() {
auto dstMemPtr = getDstMemoryAtPort(TOPK_DATA);
auto srcMemPtr = getSrcMemoryAtPort(TOPK_DATA);
if (!dstMemPtr || !dstMemPtr->isDefined())
- OPENVINO_THROW(errorPrefix, " has undefined destination memory.");
+ THROW_CPU_NODE_ERR("has undefined destination memory.");
if (!srcMemPtr || !srcMemPtr->isDefined())
- OPENVINO_THROW(errorPrefix, " has undefined input memory.");
+ THROW_CPU_NODE_ERR("has undefined input memory.");
if (getSelectedPrimitiveDescriptor() == nullptr)
- OPENVINO_THROW(errorPrefix, " has nullable preferable primitive descriptor");
+ THROW_CPU_NODE_ERR("has nullable preferable primitive descriptor");
src_dims = srcMemPtr->getDesc().getShape().getDims();
dst_dims = dstMemPtr->getDesc().getShape().getDims();
@@ -2058,7 +2056,7 @@ void TopK::prepareParams() {
if (isDynamicNode()) {
const int src_k = getSrcDataAtPortAs<int>(TOPK_K)[0];
if (static_cast<size_t>(src_k) > src_dims[axis])
- OPENVINO_THROW(errorPrefix, " gets top_k out of range!");
+ THROW_CPU_NODE_ERR("gets top_k out of range!");
if (top_k != src_k) {
top_k = src_k;
}
@@ -2219,7 +2217,7 @@ void TopK::execute(dnnl::stream strm) {
auto out_idx_ptr = reinterpret_cast<int32_t*>(dst_idx);
topk_ref(in_ptr, out_ptr, out_idx_ptr);
} else {
- OPENVINO_THROW(errorPrefix, "only support plain layout on machine w/o sse42.");
+ THROW_CPU_NODE_ERR("only support plain layout on machine w/o sse42.");
}
}
}
diff --git a/src/plugins/intel_cpu/src/nodes/topk.h b/src/plugins/intel_cpu/src/nodes/topk.h
index 62789bda509..e0fbb4545cc 100644
--- a/src/plugins/intel_cpu/src/nodes/topk.h
+++ b/src/plugins/intel_cpu/src/nodes/topk.h
@@ -146,8 +146,6 @@ private:
std::vector<uint8_t> vec_process_idx_ptr;
std::shared_ptr<jit_uni_topk_kernel> topk_kernel = nullptr;
-
- std::string errorPrefix;
};
} // namespace node