MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / query

Method query

src/core/impl/graph/swap/memory_swap.cpp:112–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110 }
111
112 void query(int k, int l, int r, int x, ThinHashSet<int>& cover_seg) {
113 if (m_seg_info.find(k) != m_seg_info.end()) {
114 for (auto x : m_seg_info[k]) {
115 cover_seg.insert(x);
116 }
117 }
118 if (l == r) {
119 mgb_assert(
120 x == l,
121 "bug occurs in memory_swap's Segment Tree in line %s:%d "
122 "%s\n",
123 __FILE__, __LINE__, __FUNCTION__);
124 return;
125 }
126 int mid = (l + r) >> 1;
127 if (x <= mid)
128 query(k << 1, l, mid, x, cover_seg);
129 else
130 query(k << 1 | 1, mid + 1, r, x, cover_seg);
131 }
132};
133
134/* ================ MemorySwap ================ */

Callers 1

determine_swap_edgeMethod · 0.80

Calls 3

findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected