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

Function run_test

src/plugin/test/opr_footprint.cpp:45–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43
44template <typename Func, typename DType, typename Param>
45void run_test(
46 Func func, std::initializer_list<size_t>&& host_x_shape,
47 std::initializer_list<size_t>&& host_y_shape,
48 std::initializer_list<size_t>&& host_z_shape, uint64_t computation,
49 uint64_t nr_elems, DType dtype, const Param& param,
50 CompNode cn = CompNode::load("xpux")) {
51 HostTensorGenerator<DType> gen;
52 auto host_x = gen(host_x_shape, cn);
53 auto host_y = gen(host_y_shape, cn);
54 auto host_z = gen(host_z_shape, cn);
55
56 auto graph = ComputingGraph::make();
57 SymbolVar x = opr::SharedDeviceTensor::make(*graph, *host_x.get()).rename("x"),
58 y = opr::SharedDeviceTensor::make(*graph, *host_y.get()).rename("y"),
59 z = opr::SharedDeviceTensor::make(*graph, *host_z.get()).rename("z"),
60 f = func(x, y, z, param);
61
62 HostTensorND host_f;
63 compile_and_run(graph, f, host_f, computation, dtype.size(nr_elems));
64}
65
66template <class Param, typename Func>
67void test_conv_group(

Callers 3

test_conv_groupFunction · 0.70
TESTFunction · 0.70

Calls 8

compile_and_runFunction · 0.85
renameMethod · 0.80
loadFunction · 0.50
genFunction · 0.50
makeFunction · 0.50
funcFunction · 0.50
getMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected