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

Method fill_flt

dnn/test/rocm/chanwise_convolution.cpp:94–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92 }
93
94 void fill_flt() {
95 rng->exec(flt1->tensornd(), {});
96 megdnn_memcpy_D2H(
97 handle, flt1_cpu->ptr(), flt1->ptr(), lflt1.span().dist_byte());
98
99 const size_t IC = lflt1[0], CHL_MUL = lflt1[1], FSIZE = lflt1[3] * lflt1[4];
100
101 // fill flt0 from flt1
102 float* src = flt1_cpu->ptr();
103 float* dst = flt0_cpu->ptr();
104 memset(dst, 0, lflt0.span().dist_byte());
105 for (size_t i = 0; i < IC; ++i) {
106 for (size_t j = 0; j < CHL_MUL; ++j) {
107 memcpy(dst + ((i * CHL_MUL + j) * IC + i) * FSIZE,
108 src + (i * CHL_MUL + j) * FSIZE, FSIZE * sizeof(float));
109 }
110 }
111
112 megdnn_memcpy_H2D(handle, flt0->ptr(), dst, lflt0.span().dist_byte());
113 }
114
115 void fill_dst() {
116 rng->exec(dst0->tensornd(), {});

Callers 1

TEST_FFunction · 0.45

Calls 5

dist_byteMethod · 0.80
spanMethod · 0.80
execMethod · 0.45
tensorndMethod · 0.45
ptrMethod · 0.45

Tested by

no test coverage detected