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

Method make_callback

src/plugin/test/infkern_finder.cpp:25–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23 SymbolVar x;
24
25 auto make_callback(SymbolVar x) {
26 auto cb = [&](DeviceTensorND& dv) {
27 dv.comp_node().sync();
28 entered.store(true);
29 while (should_sleep.load())
30 ;
31 entered.store(false);
32 };
33 auto cbx = opr::CallbackInjector::make(x, cb).rename("cbx"),
34 y = (cbx * 23).rename("cby");
35 expected_bad_opr = cbx.node()->owner_opr();
36 return y;
37 }
38
39 void SetUp() override {
40 host_x = gen({1});

Callers

nothing calls this directly

Calls 8

renameMethod · 0.80
makeFunction · 0.50
syncMethod · 0.45
comp_nodeMethod · 0.45
storeMethod · 0.45
loadMethod · 0.45
owner_oprMethod · 0.45
nodeMethod · 0.45

Tested by

no test coverage detected