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

Method set_allocator

imperative/src/impl/op_def.cpp:151–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

149static thread_local OpDef::allocator_t local_allocator;
150
151void OpDef::set_allocator(allocator_t allocator) {
152 mgb_assert(!local_allocator, "allocator has been set before");
153 local_allocator = allocator;
154}
155
156DeviceTensorStorage::RawStorage OpDef::allocate(CompNode device, size_t size) const {
157 return local_allocator(device, size);

Callers 1

set_optionMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected