MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / mark_live

Method mark_live

tensorflow/core/common_runtime/pending_counts.h:198–218  ·  view source on GitHub ↗

Mark a merge node as live REQUIRES: Node corresponding to "h" is a merge node

Source from the content-addressed store, hash-verified

196 // Mark a merge node as live
197 // REQUIRES: Node corresponding to "h" is a merge node
198 void mark_live(Handle h) {
199 if (h.is_large_) {
200 std::atomic<LargeCounts>* c_ptr = Large(h);
201 auto c = c_ptr->load(std::memory_order_relaxed);
202 // Only do anything if the node hasn't already started executing.
203 if (PENDING_NOTREADY == NodeStateForStruct(c)) {
204 c.pending &= ~static_cast<int>(0x1);
205 c_ptr->store(c, std::memory_order_relaxed);
206 }
207 } else {
208 std::atomic<PackedCounts>* c_ptr = Packed(h);
209 auto c = c_ptr->load(std::memory_order_relaxed);
210 // Only do anything if the node hasn't already started executing.
211 if (PENDING_NOTREADY == NodeStateForStruct(c)) {
212 static_assert(7 == kMaxCountForPackedCounts,
213 "Live flag incorrect for max packed count");
214 c.pending &= 0x6;
215 c_ptr->store(c, std::memory_order_relaxed);
216 }
217 }
218 }
219
220 int dead_count(Handle h) {
221 int r = h.is_large_ ? Large(h)->load(std::memory_order_relaxed).dead_count

Callers 2

TESTFunction · 0.45
ActivateNodesSlowPathMethod · 0.45

Calls 1

loadMethod · 0.45

Tested by 1

TESTFunction · 0.36