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

Function TEST

src/plugin/test/cpu_dispatch_checker.cpp:9–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7using namespace mgb;
8
9TEST(TestCPUDispatchChecker, Simple) {
10 HostTensorGenerator<> gen;
11 auto graph = ComputingGraph::make();
12 graph->options().var_sanity_check_first_run = false;
13 CPUDispatchChecker checker(graph.get());
14 auto host_x = gen({3}, CompNode::load("cpux"));
15 auto x = opr::Host2DeviceCopy::make(*graph, host_x),
16 y = opr::CallbackInjector::make(x, [](DeviceTensorND&) {}), z = y + 1;
17 auto func = graph->compile({{z, {}}});
18 func->execute();
19 ASSERT_EQ(1u, checker.failed_oprs().count(y.node()->owner_opr()));
20}
21
22TEST(TestCPUDispatchChecker, Loop) {
23 HostTensorGenerator<> gen;

Callers

nothing calls this directly

Calls 13

make_callback_copyFunction · 0.85
makeFunction · 0.50
genFunction · 0.50
loadFunction · 0.50
getMethod · 0.45
compileMethod · 0.45
executeMethod · 0.45
countMethod · 0.45
owner_oprMethod · 0.45
nodeMethod · 0.45
add_inputMethod · 0.45
make_scalarMethod · 0.45

Tested by

no test coverage detected