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

Method add_using_dynamic_loader

src/serialization/impl/opr_registry.cpp:225–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225void OprRegistry::add_using_dynamic_loader(
226 Typeinfo* type, const std::string& name, const OprDumper& dumper) {
227 // dynamic oprs are implemented by mapping different opr types to the same
228 // persist_type_id
229 add({type,
230 dynamic_registry()->persist_type_id,
231 name,
232 dumper,
233 {},
234 {},
235 dynamic_registry()->unversioned_type_id});
236 mgb_assert(type, "type must be not nullptr");
237 OprRegistryV2::versioned_add(
238 {type, dynamic_registry_v2()->type_id, type->name, dumper,
239 dynamic_registry_v2()->loader, nullptr},
240 CURRENT_VERSION, CURRENT_VERSION, true);
241}
242
243#if MGB_ENABLE_DEBUG_UTIL
244std::vector<std::vector<std::pair<size_t, std::string>>> OprRegistry::

Callers

nothing calls this directly

Calls 3

addFunction · 0.85
dynamic_registryFunction · 0.85
dynamic_registry_v2Function · 0.85

Tested by

no test coverage detected