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

Function make_func_pair

src/jit/test/fusion.cpp:86–101  ·  view source on GitHub ↗

make a pair of functions with and without JIT optimization

Source from the content-addressed store, hash-verified

84
85//! make a pair of functions with and without JIT optimization
86std::pair<std::unique_ptr<cg::AsyncExecutable>, std::unique_ptr<cg::AsyncExecutable>>
87make_func_pair(
88 HostTensorND& dst0, HostTensorND& dst1,
89 thin_function<SymbolVar(ComputingGraph&)> make_dst, uint8_t jit_level) {
90 auto g0 = ComputingGraph::make();
91 g0->options().graph_opt_level = 0;
92 auto f0 = g0->compile({make_callback_copy(make_dst(*g0), dst0)});
93
94 auto g1 = ComputingGraph::make();
95 g1->options().graph_opt_level = 3;
96 g1->options().graph_opt.jit = jit_level;
97 auto f1 = g1->compile({make_callback_copy(make_dst(*g1), dst1)});
98
99 EXPECT_FALSE(find_oprs<JITExecutor>(*f1).empty());
100 return {std::move(f0), std::move(f1)};
101}
102
103template <>
104void run<void>(Backend, CompNode) {}

Callers 10

run<basic>Function · 0.85
run<large_num_inps>Function · 0.85
run<multi_device>Function · 0.85
run<multi_shape>Function · 0.85
run<non_contig>Function · 0.85
run<visit_complexity>Function · 0.85
run<imm_scalar>Function · 0.85
run<special_graph_input>Function · 0.85
TESTFunction · 0.85
run_mlirFunction · 0.85

Calls 4

make_callback_copyFunction · 0.85
makeFunction · 0.50
compileMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected