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

Function TEST_F

dnn/test/rocm/relayout.cpp:22–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20} // namespace
21
22TEST_F(ROCM, RELAYOUT_MEMCPY_ASYNC) {
23 Checker<Relayout> checker(handle_rocm());
24 checker.set_epsilon(1e-3);
25 struct Arg {
26 TensorLayout src, dst;
27 Arg(TensorLayout src, TensorLayout dst) : src(src), dst(dst) {}
28 };
29 std::vector<Arg> args;
30 // test for contig
31 args.emplace_back(
32 Arg{{{51200}, {1}, dtype::Float32()}, {{51200}, {1}, dtype::Float32()}});
33
34 // test for copy_2d
35 args.emplace_back(
36 Arg{{{51200}, {9}, dtype::Float32()}, {{51200}, {1}, dtype::Float32()}});
37
38 for (auto&& arg : args) {
39 checker.set_dtype(0, dtype::Float32())
40 .set_dtype(1, dtype::Float32())
41 .execl({arg.src, arg.dst});
42 }
43}
44
45#if MEGDNN_WITH_BENCHMARK
46TEST_F(ROCM, RELAYOUT_BENCHMARK) {

Callers

nothing calls this directly

Calls 13

swapFunction · 0.85
TensorLayoutClass · 0.85
emplace_backMethod · 0.80
set_dtypeMethod · 0.80
dimshuffleMethod · 0.80
runFunction · 0.50
execlMethod · 0.45
to_stringMethod · 0.45
total_nr_elemsMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected