| 7 | using namespace mgb; |
| 8 | |
| 9 | TEST(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 | |
| 22 | TEST(TestCPUDispatchChecker, Loop) { |
| 23 | HostTensorGenerator<> gen; |
nothing calls this directly
no test coverage detected