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

Function TEST_F

dnn/test/cuda/relayout.cpp:20–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18} // namespace
19
20TEST_F(CUDA, RELAYOUT_TRANSPOSE) {
21 Checker<Relayout> checker(handle_cuda());
22 auto run = [&](size_t batch, size_t m, size_t n, size_t c, DType dtype) {
23 checker.set_dtype(0, dtype).set_dtype(1, dtype);
24 TensorLayout src = {{batch, m, n, c}, dtype};
25 src.init_contiguous_stride();
26 TensorLayout dst = {{batch, m, n, c}, dtype};
27 dst.stride[0] = m * n * c;
28 dst.stride[1] = c;
29 dst.stride[2] = m * c;
30 dst.stride[3] = 1;
31 checker.execl({src, dst});
32 };
33 run(16, 30, 40, 4, dtype::Int8());
34 run(16, 20, 10, 4, dtype::Int8());
35 run(1, 30, 20, 1, dtype::Int32());
36 run(1, 20, 30, 1, dtype::Int32());
37 run(1, 11, 21, 1, dtype::Float32());
38}
39
40#if MEGDNN_WITH_BENCHMARK
41TEST_F(CUDA, BENCHMARK_RELAYOUT_TRANSPOSE) {

Callers

nothing calls this directly

Calls 15

swapFunction · 0.85
TensorLayoutClass · 0.85
maxFunction · 0.85
set_dtypeMethod · 0.80
dimshuffleMethod · 0.80
emplace_backMethod · 0.80
runFunction · 0.50
powFunction · 0.50
roundFunction · 0.50
fabsFunction · 0.50
execlMethod · 0.45

Tested by

no test coverage detected