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

Method get_default_handle

imperative/src/impl/ops/rng.cpp:114–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112 }
113
114 static Handle get_default_handle(CompNode comp_node) {
115 mgb_assert(comp_node.valid());
116 MGB_LOCK_GUARD(sm_mtx);
117 auto&& glob_handle = glob_default_handles[comp_node];
118 if (!glob_handle) {
119 glob_handle = inst().do_new_handle(comp_node, glob_default_seed);
120 }
121 mgb_assert(get_seed(glob_handle) == glob_default_seed);
122 return glob_handle;
123 }
124
125 static RNGDnnOpManager& inst() {
126 static RNGDnnOpManager mgr;

Callers

nothing calls this directly

Calls 3

instFunction · 0.85
do_new_handleMethod · 0.80
validMethod · 0.45

Tested by

no test coverage detected