Skip to content

Commit

Permalink
[convert] set planar layout if convert is before output
Browse files Browse the repository at this point in the history
  • Loading branch information
riverlijunjie committed Sep 27, 2023
1 parent 2481b4a commit 3d2e7a5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/plugins/intel_cpu/src/graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ void Graph::InitEdges() {
numberOfEdges--;
};

#if 1
#if 0
{
static std::mutex _lock;
std::lock_guard<std::mutex> guard(_lock);
Expand Down Expand Up @@ -598,7 +598,7 @@ void Graph::InitEdges() {
updateEdge(i);
}
}
#if 1
#if 0
{
static std::mutex _lock;
std::lock_guard<std::mutex> guard(_lock);
Expand Down
11 changes: 10 additions & 1 deletion src/plugins/intel_cpu/src/nodes/convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,16 @@ void Convert::initSupportedPrimitiveDescriptors() {
config.outConfs.push_back(dataConfigOut);

auto creators = BlockedDescCreator::getCommonCreators();
auto range = BlockedDescCreator::makeFilteredRange(creators, insShape.getRank());
bool hasOutputChild = false;
for (auto& childEdge : getChildEdgesAtPort(0)) {
if (Type::Output == childEdge->getChild()->getType()) {
hasOutputChild = true;
break;
}
}
auto range = hasOutputChild
? BlockedDescCreator::makeFilteredRange(creators, insShape.getRank(), {LayoutType::ncsp})
: BlockedDescCreator::makeFilteredRange(creators, insShape.getRank());

for (auto itr = range.first; itr != range.second; ++itr) {
config.inConfs[0].setMemDesc(std::make_shared<CpuBlockedMemoryDesc>(itr->second->createDesc(insPrecision, insShape)));
Expand Down

0 comments on commit 3d2e7a5

Please sign in to comment.