MCPcopy Create free account
hub / github.com/ARM-software/armnn / AddDirectAntecedent

Method AddDirectAntecedent

src/armnn/SubgraphViewSelector.cpp:122–154  ·  view source on GitHub ↗

Marks the given subgraph as a direct antecedent (dependency) of this one.

Source from the content-addressed store, hash-verified

120
121 /// Marks the given subgraph as a direct antecedent (dependency) of this one.
122 void AddDirectAntecedent(PartialSubgraph* antecedent)
123 {
124 if (m_Parent == nullptr)
125 {
126 antecedent = antecedent->GetRepresentative();
127
128 m_Antecedents.insert(antecedent);
129 // Also record all of its antecedents, so that we end up with direct and indirect antecedents.
130 // This makes the lookup in HasAntecedent() faster.
131 m_Antecedents.insert(antecedent->m_Antecedents.begin(), antecedent->m_Antecedents.end());
132 // All of our dependents also need to include the new antecedents
133 for (PartialSubgraph* d : m_Dependants)
134 {
135 d->m_Antecedents.insert(antecedent);
136 d->m_Antecedents.insert(antecedent->m_Antecedents.begin(), antecedent->m_Antecedents.end());
137 }
138
139 // Store reverse dependencies as well, required so that we can efficiently navigate the graph
140 // when making updates.
141 antecedent->m_Dependants.insert(this);
142 antecedent->m_Dependants.insert(m_Dependants.begin(), m_Dependants.end());
143 for (PartialSubgraph* a : antecedent->m_Antecedents)
144 {
145 a->m_Dependants.insert(this);
146 a->m_Dependants.insert(m_Dependants.begin(), m_Dependants.end());
147 }
148 }
149 else
150 {
151 // Defer request to the representative
152 GetRepresentative()->AddDirectAntecedent(antecedent);
153 }
154 }
155
156 /// Checks if this subgraph is dependent on the given subgraph, either directly or indirectly.
157 bool HasAntecedent(PartialSubgraph* antecedent)

Callers 1

AssignSplitIdFunction · 0.80

Calls 3

GetRepresentativeMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected