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

Function TEST

src/core/test/static_mem_alloc.cpp:215–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213 {1, 256}, {1, 32}, {10, INTERVAL_MOVE_MAX_SIZE, 1000, 10000}));
214
215TEST(TestStaticMemAllocAlgo, PushdownChain) {
216 auto allocator = StaticMemAlloc::make(StaticMemAlloc::AllocatorAlgo::PUSHDOWN);
217 constexpr size_t NR = 5;
218 for (size_t i = 0; i < NR; ++i)
219 allocator->add(i, i + 2, i + 1, makeuk(i));
220 allocator->solve();
221 ASSERT_EQ(NR + NR - 1, allocator->tot_alloc_lower_bound());
222 ASSERT_EQ(NR + NR - 1, allocator->tot_alloc());
223}
224
225TEST(TestStaticMemAllocAlgo, PushdownConsistence) {
226 for (size_t run_nr = 0; run_nr < 500; ++run_nr) {

Callers

nothing calls this directly

Calls 6

makeukFunction · 0.85
tot_alloc_lower_boundMethod · 0.80
makeFunction · 0.70
addMethod · 0.45
solveMethod · 0.45
tot_allocMethod · 0.45

Tested by

no test coverage detected