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

Method get_wbundle

dnn/src/fallback/mask_conv/opr_impl.cpp:140–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140WorkspaceBundle MaskConvForwardImpl::get_wbundle(
141 const size_t OC, const size_t OH, const size_t OW, const size_t IC,
142 const size_t IH, const size_t IW, const size_t FH, const size_t FW,
143 const size_t PH, const size_t PW) {
144 size_t maskInd = OH * OW * sizeof(int);
145 size_t src_pad = IC * (IH + PH * 2) * (IW + PW * 2) * sizeof(float);
146 size_t matmul_dst = OC * OH * OW * sizeof(float);
147 size_t tmp = std::max<size_t>(src_pad, matmul_dst);
148 size_t img2col = IC * FH * FW * OH * OW * sizeof(float);
149 size_t matmul_cal;
150 {
151 TensorLayout A({OC, IC * FH * FW}, dtype::Float32());
152 TensorLayout B({IC * FH * FW, OH * OW}, dtype::Float32());
153 TensorLayout C({OC, OH * OW}, dtype::Float32());
154 matmul_cal = m_matmul_opr->get_workspace_in_bytes(A, B, C);
155 }
156 return WorkspaceBundle{nullptr, {maskInd, tmp, img2col, matmul_cal}};
157}
158
159void MaskConvForwardImpl::exec(
160 _megdnn_tensor_in src, _megdnn_tensor_in filter, _megdnn_tensor_in mask,

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected