Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CPU] Add interface to release compiled model internal memory #26390

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f211b01
Rename mem manager to mem block
maxnick Aug 5, 2024
f723360
Remove isAllocated check from the memory class
maxnick Aug 6, 2024
5ced5f4
Fix tests build
maxnick Aug 7, 2024
e2440df
Remove incorrect checs from Input
maxnick Aug 7, 2024
d1b544e
Remove incorrect isDefined checks
maxnick Aug 7, 2024
0bf53b8
Redefine Split createPrimitive method
maxnick Aug 7, 2024
e20e7f2
Memory subsytem refactoring
maxnick Aug 12, 2024
3db1617
Merge remote-tracking branch 'origin/master' into flush_interim_tensors
maxnick Aug 12, 2024
bbbcdf4
Avoid using key word
maxnick Aug 13, 2024
692c02f
Bug fixes
maxnick Aug 13, 2024
ece559e
Fix linear offset calculation in static block
maxnick Aug 14, 2024
b9da47a
Fix output edges processing
maxnick Aug 14, 2024
8304f77
Add allocate and free actions
maxnick Aug 14, 2024
e58f01a
Add flushing intermediate tensors
maxnick Aug 14, 2024
334b757
Linter fixes
maxnick Aug 16, 2024
b0d0964
Avoid calling getData to not allocated memory
maxnick Aug 16, 2024
bfe54a0
Merge remote-tracking branch 'origin/master' into flush_interim_tensors
maxnick Aug 16, 2024
f6a8dee
Reallocate only defined mem
maxnick Aug 16, 2024
01bb93c
Refactor the Reorder node
maxnick Aug 16, 2024
1adc24c
Refactor set output default ptr
maxnick Aug 16, 2024
fd3b99a
Adapt FC executor
maxnick Aug 19, 2024
548e2d7
Fix dynamic memory allocation
maxnick Aug 19, 2024
2722aeb
Adapt Multimodal node
maxnick Aug 20, 2024
906d649
Skip memory refresh for inPlace up
maxnick Aug 20, 2024
5c41e7c
Skip string tensors in memory refresh
maxnick Aug 20, 2024
f570550
Avoid reading uninit data in Loop initialization
maxnick Aug 20, 2024
5b9d05a
Merge remote-tracking branch 'origin/master' into flush_interim_tensors
maxnick Aug 20, 2024
da1f184
Fix loop trip count reading in Loop
maxnick Aug 21, 2024
adeeb02
Introduce memory block stub
maxnick Aug 21, 2024
e4dbf00
WA in the Pad node to prevent reading uninit data
maxnick Aug 22, 2024
8ad88fb
Introduce network level memory control unit
maxnick Aug 22, 2024
4f38db6
Fix Loop for dynamic shape applications
maxnick Aug 26, 2024
8704e61
Add an interface call releasing intermediate memory
maxnick Aug 22, 2024
5cfb652
Merge remote-tracking branch 'origin/releases/2024/4' into release_in…
maxnick Sep 3, 2024
5f9e4d3
Code cleanup
maxnick Sep 2, 2024
f2bea35
Rename release_buffers to release_memory
maxnick Sep 3, 2024
297e65c
Trivial behavior test
maxnick Sep 3, 2024
735b90c
Fix clang format
maxnick Sep 3, 2024
e961b25
Modify behavior test to avoid recompilation
maxnick Sep 4, 2024
14df043
Fix mem size calculation for half byte types
maxnick Sep 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove isAllocated check from the memory class
  • Loading branch information
maxnick committed Aug 6, 2024
commit f723360e315b4ac83d46ce98ceda9b03df82e923
36 changes: 0 additions & 36 deletions src/plugins/intel_cpu/src/cpu_memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,22 +184,6 @@ dnnl::memory Memory::DnnlMemPrimHandle::getPrim() const {
return m_prim;
}

bool Memory::isAllocated() const noexcept {
if (m_blockHandle->getRawPtr()) {
return true;
}
if (!m_pMemDesc) {
return false;
}
if (!(m_pMemDesc->isDefined())) {
return true;
}
if (m_pMemDesc->getCurrentMemSize() == 0) {
return true;
}
return false;
}

void* Memory::getData() const {
void* data = getDataNoThrow();
if (data == nullptr &&
Expand Down Expand Up @@ -306,22 +290,6 @@ void StringMemory::nullify() {
}
}

bool StringMemory::isAllocated() const noexcept {
if (getData()) {
return true;
}
if (!m_mem_desc) {
return false;
}
if (!(m_mem_desc->isDefined())) {
return true;
}
if (m_mem_desc->getCurrentMemSize() == 0) {
return true;
}
return false;
}

size_t StringMemory::getSize() const { // In bytes
auto size = getDesc().getCurrentMemSize();
if (size == MemoryDesc::UNDEFINED_SIZE) {
Expand Down Expand Up @@ -461,10 +429,6 @@ StaticMemory::StaticMemory(const dnnl::engine& eng, MemoryDescPtr desc, const vo
StaticMemory::StaticMemory(const dnnl::engine& eng, const MemoryDesc& desc, const void* data, bool pads_zeroing) :
StaticMemory::StaticMemory(eng, desc.clone(), data, pads_zeroing) {}

bool StaticMemory::isAllocated() const noexcept {
return 0 == m_size || getData() != nullptr;
}

const MemoryDesc& StaticMemory::getDesc() const {
return *m_pMemDesc;
}
Expand Down
19 changes: 9 additions & 10 deletions src/plugins/intel_cpu/src/cpu_memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ class IMemory {
public:
virtual ~IMemory() = default;

virtual bool isAllocated() const noexcept = 0;

virtual const MemoryDesc& getDesc() const = 0;
virtual MemoryDescPtr getDescPtr() const = 0;

Expand Down Expand Up @@ -191,6 +189,15 @@ class IMemory {

virtual MemoryBlockPtr getMemoryBlock() const = 0;

virtual void nullify() = 0;

bool isDefined() const noexcept {
if (auto desc = getDescPtr()) {
return desc->isDefined();
}
return false;
}

//oneDNN specifics for backward compatibility
virtual dnnl::memory getPrimitive() const = 0;

Expand All @@ -202,8 +209,6 @@ class IMemory {
return DnnlExtensionUtils::ElementTypeToDataType(getDesc().getPrecision());
}

virtual void nullify() = 0;

template <typename T,
typename std::enable_if<!std::is_pointer<T>::value && !std::is_reference<T>::value, int>::type = 0,
typename std::enable_if<std::is_base_of<MemoryDesc, T>::value, int>::type = 0>
Expand Down Expand Up @@ -240,8 +245,6 @@ class StaticMemory final : public IMemory {
StaticMemory(Memory&&) = delete;
StaticMemory& operator= (StaticMemory&&) = delete;

bool isAllocated() const noexcept override;

const MemoryDesc& getDesc() const override;
MemoryDescPtr getDescPtr() const override;

Expand Down Expand Up @@ -287,8 +290,6 @@ class Memory : public IMemory {

dnnl::memory getPrimitive() const override;

bool isAllocated() const noexcept override;

const MemoryDesc& getDesc() const override {
return *m_pMemDesc;
}
Expand Down Expand Up @@ -393,8 +394,6 @@ class StringMemory : public IMemory {
StringMemory(const dnnl::engine& engine, const MemoryDesc& desc, const StringMemoryBlockPtr& block)
: StringMemory(engine, desc.clone(), block) {}

bool isAllocated() const noexcept override;

const MemoryDesc& getDesc() const override {
return *m_mem_desc;
}
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/intel_cpu/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,7 @@ bool Node::isInputTensorAtPortEmpty(size_t port) const {
auto edge = getParentEdgeAt(port);
if (one_of(edge->getStatus(), Edge::Status::Allocated, Edge::Status::Validated)) {
auto&& mem = edge->getMemory();
if (mem.isAllocated()) {
if (mem.isDefined()) {
return mem.getShape().hasZeroDims();
}
}
Expand All @@ -1511,7 +1511,7 @@ bool Node::isOutputTensorAtPortEmpty(size_t port) const {
return outputShapes[port].hasZeroDims();
}
auto&& mem = getChildEdgeAt(port)->getMemory();
if (mem.isAllocated()) {
if (mem.isDefined()) {
return mem.getShape().hasZeroDims();
}
return false;
Expand Down
12 changes: 6 additions & 6 deletions src/plugins/intel_cpu/src/nodes/bucketize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,12 @@ void Bucketize::prepareParams() {
auto inputTensorMemPtr = getSrcMemoryAtPort(INPUT_TENSOR_PORT);
auto inputBinsMemPtr = getSrcMemoryAtPort(INPUT_BINS_PORT);
auto dstMemPtr = getDstMemoryAtPort(0);
if (!dstMemPtr || !dstMemPtr->isAllocated())
OPENVINO_THROW("Destination memory didn't allocate.");
if (!inputTensorMemPtr || !inputTensorMemPtr->isAllocated())
OPENVINO_THROW("Input tensor didn't allocate.");
if (!inputBinsMemPtr || !inputBinsMemPtr->isAllocated())
OPENVINO_THROW("Input bins didn't allocate.");
if (!dstMemPtr || !dstMemPtr->isDefined())
OPENVINO_THROW("Destination memory is undefined.");
if (!inputTensorMemPtr || !inputTensorMemPtr->isDefined())
OPENVINO_THROW("Input tensor is undefined.");
if (!inputBinsMemPtr || !inputBinsMemPtr->isDefined())
OPENVINO_THROW("Input bins is undefined.");
if (getSelectedPrimitiveDescriptor() == nullptr)
OPENVINO_THROW("Preferable primitive descriptor is not set.");

Expand Down
8 changes: 4 additions & 4 deletions src/plugins/intel_cpu/src/nodes/concat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,8 @@ void Concat::prepareParams() {
return;

const auto& dstMemPtr = getDstMemoryAtPort(0);
if (!dstMemPtr || !dstMemPtr->isAllocated())
OPENVINO_THROW("Destination memory didn't allocate.");
if (!dstMemPtr || !dstMemPtr->isDefined())
OPENVINO_THROW("Destination memory is undefined.");
auto dstMemDesc = dstMemPtr->getDescWithType<BlockedMemoryDesc>();
if (getSelectedPrimitiveDescriptor() == nullptr)
OPENVINO_THROW("Preferable primitive descriptor is not set.");
Expand Down Expand Up @@ -375,9 +375,9 @@ void Concat::prepareParams() {
nelemTotal = 0;
for (size_t i = 0; i < getParentEdges().size(); i++) {
const auto& srcMemPtr = getSrcMemoryAtPort(i);
if (!srcMemPtr || !srcMemPtr->isAllocated()) {
if (!srcMemPtr || !srcMemPtr->isDefined()) {
auto parent = getParentEdgeAt(i)->getParent();
OPENVINO_THROW("Source memory from ", parent->getName(), " didn't allocate for node ", getName(), ".");
OPENVINO_THROW("Source memory from ", parent->getName(), " is undefined for node ", getName(), ".");
}

if (canExecRef) {
Expand Down
16 changes: 8 additions & 8 deletions src/plugins/intel_cpu/src/nodes/conv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1233,17 +1233,17 @@ void Convolution::prepareParams() {
auto srcMemPtr = getSrcMemoryAtPort(0);
auto wghMemPtr = getSrcMemoryAtPort(1);
auto dstMemPtr = getOutputMemory();
if (!dstMemPtr || !dstMemPtr->isAllocated())
OPENVINO_THROW("Destination memory was not allocated.");
if (!srcMemPtr || !srcMemPtr->isAllocated())
OPENVINO_THROW("Input memory was not allocated.");
if (!wghMemPtr || !wghMemPtr->isAllocated())
OPENVINO_THROW("Weight memory was not allocated.");
if (!dstMemPtr || !dstMemPtr->isDefined())
OPENVINO_THROW("Destination memory was undefined.");
if (!srcMemPtr || !srcMemPtr->isDefined())
OPENVINO_THROW("Input memory was undefined.");
if (!wghMemPtr || !wghMemPtr->isDefined())
OPENVINO_THROW("Weight memory was undefined.");
MemoryPtr biasMemPtr = nullptr;
if (withBiases) {
biasMemPtr = getSrcMemoryAtPort(2);
if (!biasMemPtr || !biasMemPtr->isAllocated())
OPENVINO_THROW("Input memory didn't allocate.");
if (!biasMemPtr || !biasMemPtr->isDefined())
OPENVINO_THROW("Input memory is undefined.");
}

const NodeDesc *selected_pd = getSelectedPrimitiveDescriptor();
Expand Down
20 changes: 10 additions & 10 deletions src/plugins/intel_cpu/src/nodes/deconv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -812,12 +812,12 @@ void Deconvolution::prepareParams() {
auto srcMemPtr = getSrcMemoryAtPort(0);
auto wghMemPtr = getSrcMemoryAtPort(1);
auto dstMemPtr = getDstMemoryAtPort(0);
if (!dstMemPtr || !dstMemPtr->isAllocated())
OPENVINO_THROW("Destination memory has not been allocated.");
if (!srcMemPtr || !srcMemPtr->isAllocated())
OPENVINO_THROW("Input memory has not been allocated.");
if (!wghMemPtr || !wghMemPtr->isAllocated())
OPENVINO_THROW("Weight memory has not been allocated.");
if (!dstMemPtr || !dstMemPtr->isDefined())
OPENVINO_THROW("Destination memory is undefined.");
if (!srcMemPtr || !srcMemPtr->isDefined())
OPENVINO_THROW("Input memory is undefined.");
if (!wghMemPtr || !wghMemPtr->isDefined())
OPENVINO_THROW("Weight memory is undefined.");
auto selected_pd = getSelectedPrimitiveDescriptor();
if (selected_pd == nullptr)
OPENVINO_THROW("Preferable primitive descriptor is not set for node ", getName(), ".");
Expand Down Expand Up @@ -869,8 +869,8 @@ void Deconvolution::prepareParams() {

if (withBiases) {
biasMemPtr = getSrcMemoryAtPort(biasPort);
if (!biasMemPtr || !biasMemPtr->isAllocated())
OPENVINO_THROW("Bias memory memory didn't allocate.");
if (!biasMemPtr || !biasMemPtr->isDefined())
OPENVINO_THROW("Bias memory memory is undefined.");
biasDesc = biasMemPtr->getDescWithType<DnnlMemoryDesc>();
}
bool is1x1PaddingAsymmetric = false;
Expand Down Expand Up @@ -1094,8 +1094,8 @@ std::vector<int32_t> Deconvolution::readOutputSpatialDims() const {
OPENVINO_THROW("Can't get output spatial dims. Inputs number = ", getParentEdges().size());
}
const auto &shapeMemPtr = getSrcMemoryAtPort(2);
if (!shapeMemPtr || !shapeMemPtr->isAllocated()) {
OPENVINO_THROW("'output_shape' input memory is not allocated.");
if (!shapeMemPtr || !shapeMemPtr->isDefined()) {
OPENVINO_THROW("'output_shape' input memory is undefined.");
}
const auto spDimsNum = getInputShapeAtPort(0).getRank() - 2;
if (shapeMemPtr->getStaticDims()[0] != spDimsNum) {
Expand Down
20 changes: 10 additions & 10 deletions src/plugins/intel_cpu/src/nodes/def_conv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1184,19 +1184,19 @@ void DeformableConvolution::prepareParams() {
auto offMemPtr = getSrcMemoryAtPort(OFF_ID);
auto weiMemPtr = getSrcMemoryAtPort(WEI_ID);

if (!dstMemPtr || !dstMemPtr->isAllocated())
OPENVINO_THROW(errorPrefix, " did not allocate destination memory");
if (!srcMemPtr || !srcMemPtr->isAllocated())
OPENVINO_THROW(errorPrefix, " did not allocate input memory");
if (!offMemPtr || !offMemPtr->isAllocated())
OPENVINO_THROW(errorPrefix, " did not allocate offsets shape memory");
if (!weiMemPtr || !weiMemPtr->isAllocated())
OPENVINO_THROW(errorPrefix, " did not allocate weights memory");
if (!dstMemPtr || !dstMemPtr->isDefined())
OPENVINO_THROW(errorPrefix, " has undefined destination memory");
if (!srcMemPtr || !srcMemPtr->isDefined())
OPENVINO_THROW(errorPrefix, " has undefined input memory");
if (!offMemPtr || !offMemPtr->isDefined())
OPENVINO_THROW(errorPrefix, " has undefined offsets shape memory");
if (!weiMemPtr || !weiMemPtr->isDefined())
OPENVINO_THROW(errorPrefix, " has undefined weights memory");

if (getOriginalInputsNumber() > 3) {
auto modMemPtr = getSrcMemoryAtPort(MOD_ID);
if (!modMemPtr || !modMemPtr->isAllocated())
OPENVINO_THROW(errorPrefix, " did not allocate modulations memory");
if (!modMemPtr || !modMemPtr->isDefined())
OPENVINO_THROW(errorPrefix, " has undefined modulations memory");
}

auto selectedPrimitiveDescriptor = getSelectedPrimitiveDescriptor();
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/intel_cpu/src/nodes/depth_to_space.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ void DepthToSpace::initSupportedPrimitiveDescriptors() {
void DepthToSpace::createPrimitive() {
auto dstMemPtr = getDstMemoryAtPort(0);
auto srcMemPtr = getSrcMemoryAtPort(0);
if (!dstMemPtr || !dstMemPtr->isAllocated())
THROW_ERROR("has not allocated destination memory");
if (!srcMemPtr || !srcMemPtr->isAllocated())
THROW_ERROR("has not allocated input memory");
if (!dstMemPtr || !dstMemPtr->isDefined())
THROW_ERROR("has undefined destination memory");
if (!srcMemPtr || !srcMemPtr->isDefined())
THROW_ERROR("has undefined input memory");
if (getSelectedPrimitiveDescriptor() == nullptr)
THROW_ERROR("has unidentified preferable primitive descriptor");

Expand Down
8 changes: 4 additions & 4 deletions src/plugins/intel_cpu/src/nodes/extract_image_patches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,10 @@ ExtractImagePatches::ExtractImagePatches(const std::shared_ptr<ov::Node>& op, co
void ExtractImagePatches::prepareParams() {
const auto& srcMemPtr0 = getSrcMemoryAtPort(0);
const auto& dstMemPtr = getDstMemoryAtPort(0);
if (!srcMemPtr0 || !srcMemPtr0->isAllocated())
OPENVINO_THROW("Input memory has not been allocated.");
if (!dstMemPtr || !dstMemPtr->isAllocated())
OPENVINO_THROW("Destination memory has not been allocated.");
if (!srcMemPtr0 || !srcMemPtr0->isDefined())
OPENVINO_THROW("Input memory is undefined.");
if (!dstMemPtr || !dstMemPtr->isDefined())
OPENVINO_THROW("Destination memory is undefined.");
if (getSelectedPrimitiveDescriptor() == nullptr)
OPENVINO_THROW("Preferable primitive descriptor is not set.");

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/intel_cpu/src/nodes/eye.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ void Eye::executeSpecified() {
const size_t colNum = getColNum();
const int64_t shift = getDiagIndex();
auto outPtr = getDstMemoryAtPort(0);
if (!outPtr || !outPtr ->isAllocated())
THROW_ERROR(errorPrefix, "Destination memory didn't allocate.");
if (!outPtr || !outPtr ->isDefined())
THROW_ERROR(errorPrefix, "Destination memory is undefined.");
T *dst = outPtr->getDataAs<T>();

const size_t batchVolume = getBatchVolume(getBatchShape());
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/intel_cpu/src/nodes/gather.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,11 @@ bool Gather::needPrepareParams() const {

void Gather::prepareParams() {
auto dataMemPtr = getSrcMemoryAtPort(GATHER_DATA);
if (!dataMemPtr || !dataMemPtr->isAllocated())
THROW_ERROR(" has not allocated input data memory.");
if (!dataMemPtr || !dataMemPtr->isDefined())
THROW_ERROR(" has undefined input data memory.");
auto idxMemPtr = getSrcMemoryAtPort(GATHER_INDICES);
if (!idxMemPtr || !idxMemPtr->isAllocated())
THROW_ERROR(" has not allocated input indices memory.");
if (!idxMemPtr || !idxMemPtr->isDefined())
THROW_ERROR(" has undefined input indices memory.");
if (getSelectedPrimitiveDescriptor() == nullptr)
THROW_ERROR(" has unidentified preferable primitive descriptor.");

Expand Down
12 changes: 6 additions & 6 deletions src/plugins/intel_cpu/src/nodes/gather_nd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ void GatherND::prepareParams() {
auto srcMemPtr = getSrcMemoryAtPort(GATHERND_DATA);
auto idxMemPtr = getSrcMemoryAtPort(GATHERND_INDEXES);
auto dstMemPtr = getDstMemoryAtPort(0);
if (!srcMemPtr || !srcMemPtr->isAllocated())
THROW_ERROR(" has not allocated input memory of 'data'.");
if (!idxMemPtr || !idxMemPtr->isAllocated())
THROW_ERROR(" has not allocated input memory of 'indices'.");
if (!dstMemPtr || !dstMemPtr->isAllocated())
THROW_ERROR(" has not allocated output memory.");
if (!srcMemPtr || !srcMemPtr->isDefined())
THROW_ERROR(" has undefined input memory of 'data'.");
if (!idxMemPtr || !idxMemPtr->isDefined())
THROW_ERROR(" has undefined input memory of 'indices'.");
if (!dstMemPtr || !dstMemPtr->isDefined())
THROW_ERROR(" has undefined output memory.");
if (getSelectedPrimitiveDescriptor() == nullptr)
THROW_ERROR(" has unidentified preferable primitive descriptor.");

Expand Down
16 changes: 8 additions & 8 deletions src/plugins/intel_cpu/src/nodes/gather_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ void GatherTree::prepareParams() {
const auto& maxSeqLenMemPtr = getSrcMemoryAtPort(GATHER_TREE_MAX_SEQ_LEN);
const auto& dstMemPtr = getDstMemoryAtPort(0);

if (!stepIdxMemPtr || !stepIdxMemPtr->isAllocated())
OPENVINO_THROW(errorPrefix, " has not allocated input memory of 'step_ids'.");
if (!parentIdxMemPtr || !parentIdxMemPtr->isAllocated())
OPENVINO_THROW(errorPrefix, " has not allocated input memory of 'parent_ids'.");
if (!maxSeqLenMemPtr || !maxSeqLenMemPtr->isAllocated())
OPENVINO_THROW(errorPrefix, " has not allocated input memory of 'max_seq_len'.");
if (!dstMemPtr || !dstMemPtr->isAllocated())
OPENVINO_THROW(errorPrefix, " has not allocated output memory.");
if (!stepIdxMemPtr || !stepIdxMemPtr->isDefined())
OPENVINO_THROW(errorPrefix, " has undefined input memory of 'step_ids'.");
if (!parentIdxMemPtr || !parentIdxMemPtr->isDefined())
OPENVINO_THROW(errorPrefix, " has undefined input memory of 'parent_ids'.");
if (!maxSeqLenMemPtr || !maxSeqLenMemPtr->isDefined())
OPENVINO_THROW(errorPrefix, " has undefined input memory of 'max_seq_len'.");
if (!dstMemPtr || !dstMemPtr->isDefined())
OPENVINO_THROW(errorPrefix, " has undefined output memory.");
if (getSelectedPrimitiveDescriptor() == nullptr)
OPENVINO_THROW(errorPrefix, " has unidentified preferable primitive descriptor.");

Expand Down
12 changes: 6 additions & 6 deletions src/plugins/intel_cpu/src/nodes/grid_sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,14 @@ void GridSample::createPrimitive() {

void GridSample::prepareParams() {
auto dataMemPtr = getSrcMemoryAtPort(IN_DATA);
if (!dataMemPtr || !dataMemPtr->isAllocated())
THROW_CPU_NODE_ERR("has not allocated input data memory.");
if (!dataMemPtr || !dataMemPtr->isDefined())
THROW_CPU_NODE_ERR("has undefined input data memory.");
auto gridMemPtr = getSrcMemoryAtPort(IN_GRID);
if (!gridMemPtr || !gridMemPtr->isAllocated())
THROW_CPU_NODE_ERR("has not allocated input grid memory.");
if (!gridMemPtr || !gridMemPtr->isDefined())
THROW_CPU_NODE_ERR("has undefined input grid memory.");
auto dstMemPtr = getDstMemoryAtPort(0);
if (!dstMemPtr || !dstMemPtr->isAllocated())
THROW_CPU_NODE_ERR("has not allocated output memory.");
if (!dstMemPtr || !dstMemPtr->isDefined())
THROW_CPU_NODE_ERR("has undefined output memory.");
if (getSelectedPrimitiveDescriptor() == nullptr)
THROW_CPU_NODE_ERR("has unidentified preferable primitive descriptor.");

Expand Down
Loading
Loading