Skip to content

Commit

Permalink
Refactor set output default ptr
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnick committed Aug 16, 2024
1 parent 01bb93c commit 1adc24c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/plugins/intel_cpu/src/infer_request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,11 @@ void SyncInferRequest::change_default_ptr() {
auto output = outputNodesMap.find(it.first);
OPENVINO_ASSERT(outputNodesMap.end() != output, "Cannot find output tensor with index: ", it.first);
auto parentEdge = output->second->getParentEdgeAt(0);
if (parentEdge->getMemory().getData() == static_cast<void*>(it.second->data()))
void* const outputRawPtr = parentEdge->getMemory().getData();
if (outputRawPtr == static_cast<void*>(it.second->data()))
continue;

bool canBeInPlace = true;
void* defaultPtr = parentEdge->getMemory().getData();
// Cannot be in-place after concat because concat is using different ptrs without offsets
auto parent = parentEdge->getParent();
NodePtr previousParent;
Expand All @@ -259,7 +259,7 @@ void SyncInferRequest::change_default_ptr() {
if (!e)
OPENVINO_THROW("Node ", parent->getName(), " contains empty parent edge");

if (e->getMemory().getData() == defaultPtr) {
if (parent_port == parent->inPlaceInputPort(e->getOutputNum())) {
parent = e->getParent();
parent_port = e->getInputNum();
break;
Expand Down

0 comments on commit 1adc24c

Please sign in to comment.