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

Function Reorder

tensorflow/compiler/jit/graphcycles/graphcycles.cc:251–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249}
250
251static void Reorder(GraphCycles::Rep* r) {
252 Sort(r->nodes_, &r->deltab_);
253 Sort(r->nodes_, &r->deltaf_);
254
255 // Adds contents of delta lists to list_ (backwards deltas first).
256 r->list_.clear();
257 MoveToList(r, &r->deltab_, &r->list_);
258 MoveToList(r, &r->deltaf_, &r->list_);
259
260 // Produce sorted list of all ranks that will be reassigned.
261 r->merged_.resize(r->deltab_.size() + r->deltaf_.size());
262 std::merge(r->deltab_.begin(), r->deltab_.end(), r->deltaf_.begin(),
263 r->deltaf_.end(), r->merged_.begin());
264
265 // Assign the ranks in order to the collected list.
266 for (Vec<int32>::size_type i = 0; i < r->list_.size(); i++) {
267 r->nodes_[r->list_[i]]->rank = r->merged_[i];
268 }
269}
270
271static void Sort(const Vec<Node*>& nodes, Vec<int32>* delta) {
272 struct ByRank {

Callers 1

InsertEdgeMethod · 0.85

Calls 8

MoveToListFunction · 0.85
SortFunction · 0.70
mergeFunction · 0.50
clearMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected