MCPcopy Create free account
hub / github.com/UbiquitousLearning/mllm / alloc

Method alloc

mllm/engine/BuddyMemPool.cpp:53–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53void BuddyMemPool::alloc(Storage* s) {
54 auto try_to_alloc_size = allocator_->allocSize(s);
55
56 // Object cache
57 BuddyMemBlock* omb = nullptr;
58 if (options_.cache_small_obj_enabled && isInObjCache(try_to_alloc_size)) { omb = allocObjCache(try_to_alloc_size); }
59
60 // Buddy
61 if (!omb) { omb = allocBuddy(try_to_alloc_size); }
62 s->ptr_ = omb->ptr;
63
64 // Reg to memory pool
65 st_.reg(s->custom_32bit_uuid_, omb);
66}
67
68void BuddyMemPool::alloc(const std::shared_ptr<Storage>& s) { alloc(s.get()); }
69

Callers 15

performMethod · 0.45
performMethod · 0.45
warmupMethod · 0.45
runMethod · 0.45
buildInputsMethod · 0.45
Tensor.cppFile · 0.45
constantMethod · 0.45
zerosMethod · 0.45
onesMethod · 0.45
arangeMethod · 0.45
randomMethod · 0.45
operator+Method · 0.45

Calls 3

allocSizeMethod · 0.45
regMethod · 0.45
getMethod · 0.45

Tested by 7

mainFunction · 0.36
mainFunction · 0.36
testConv2DOnceMethod · 0.36
matmulReferenceMethod · 0.36
mainFunction · 0.36