diff options
author | Tracy Narine <tracy.narine@arm.com> | 2023-09-20 14:19:07 +0100 |
---|---|---|
committer | Tracy Narine <tracy.narine@arm.com> | 2023-09-28 14:25:16 +0100 |
commit | 6440ce89abb06e090d2b3cf91bafc14277072475 (patch) | |
tree | c55682891a0f01f3edbf5dad58720ded7af3fc64 /src/armnn/Graph.cpp | |
parent | 9a418d850333119e219fb05addc57b56cdc60a7e (diff) | |
download | armnn-6440ce89abb06e090d2b3cf91bafc14277072475.tar.gz |
IVGCVSW-7504 Create a backend specific optimization to fuse ADD+MUL+Add+(Activation) in CpuAcc
* Adding CpuAcc backend optimization to fuse add+mul+add into one layer
* Tests added/enhanced
* Also added optional extended parameter to Graph::Print()
and throw macros that could be used in place of assert
Signed-off-by: Tracy Narine <tracy.narine@arm.com>
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com>
Change-Id: I5f8d094b969a130d8c2c7b4da07426313a9fea76
Diffstat (limited to 'src/armnn/Graph.cpp')
-rw-r--r-- | src/armnn/Graph.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/armnn/Graph.cpp b/src/armnn/Graph.cpp index cf6f20f82b..f7fbba783e 100644 --- a/src/armnn/Graph.cpp +++ b/src/armnn/Graph.cpp @@ -65,7 +65,7 @@ Graph::Graph(const Graph& other) } } -Status Graph::Print() const +Status Graph::Print(bool extended) const { if (m_Layers.empty()) { @@ -80,8 +80,15 @@ Status Graph::Print() const auto numInputSlots = it->GetNumInputSlots(); auto numOutputSlots = it->GetNumOutputSlots(); + std::string guid; + if (extended) + { + guid += ":"; + guid += std::to_string(it->GetGuid()); + } ARMNN_LOG(info) << it->GetName() << ":" << GetLayerTypeAsCString(it->GetType()) << ":" << it->GetBackendId().Get() + << guid << " has " << numInputSlots << " input slots" << " and " << numOutputSlots << " output slots."; @@ -97,6 +104,13 @@ Status Graph::Print() const message << inputTensorShape[dim] << ","; } message << " ]"; + if (extended) + { + message << " Scale: " << i.GetConnectedOutputSlot()->GetTensorInfo().GetQuantizationScale(); + message << " Offset: " << i.GetConnectedOutputSlot()->GetTensorInfo().GetQuantizationOffset(); + message << " The input slot is connected to: "; + message << i.GetConnectedOutputSlot()->GetOwningIConnectableLayer().GetGuid(); + } ARMNN_LOG(info) << message.str(); } @@ -113,6 +127,13 @@ Status Graph::Print() const message << outputTensorShape[dim] << ","; } message << " ]"; + if (extended) + { + message << " Scale: " << layer->GetOutputSlots()[i].GetTensorInfo().GetQuantizationScale(); + message << " Offset: " << layer->GetOutputSlots()[i].GetTensorInfo().GetQuantizationOffset(); + message << " The output slot is connected to: "; + message << layer->GetOutputSlots()[i].GetConnection(0)->GetOwningIConnectableLayer().GetGuid(); + } ARMNN_LOG(info) << message.str(); } ARMNN_LOG(info) << "\n"; |