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

Function get_thread_bundle

dnn/src/fallback/conv_bias/im2col/algos.cpp:123–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123static WorkspaceBundle get_thread_bundle(
124 const fallback::ConvBiasImpl::NCBKernSizeParam& param,
125 const MatrixMulImpl::AlgoBase* matmul_algo,
126 const fallback::MatrixMulImpl::KernSizeParam& matmul_param,
127 const fallback::MatrixMulImpl::AlgoBase::MatmulDescription& matmul_desc,
128 size_t oc_tile_size, size_t ohw_tile_size) {
129 if (matmul_desc.packmode == Pack_Mode::DEFAULT) {
130 MIDOUT_BEGIN(
131 megdnn_fallback_im2col,
132 midout_iv("ConvBiasImpl::AlgoIm2col::get_bundle_dft"_hash)) {
133 Im2colKerns<Pack_Mode::DEFAULT> defaultkern;
134 return defaultkern.get_thread_bundle(
135 param, matmul_param, matmul_algo, ohw_tile_size, oc_tile_size);
136 }
137 MIDOUT_END();
138 } else if (
139 matmul_desc.packmode ==
140 fallback::MatrixMulImpl::AlgoBase::PackMode::ONLY_PACKA) {
141 MIDOUT_BEGIN(
142 megdnn_fallback_im2col,
143 midout_iv("ConvBiasImpl::AlgoIm2col::get_bundle_onlypacka"_hash)) {
144 Im2colKerns<Pack_Mode::ONLY_PACKA> onlypackakern;
145 return onlypackakern.get_thread_bundle(
146 param, matmul_param, matmul_algo, ohw_tile_size, oc_tile_size);
147 }
148 MIDOUT_END();
149 } else {
150 megdnn_assert(
151 matmul_desc.packmode ==
152 fallback::MatrixMulImpl::AlgoBase::PackMode::NO_PACK);
153 MIDOUT_BEGIN(
154 megdnn_fallback_im2col,
155 midout_iv("ConvBiasImpl::AlgoIm2col::get_thread_bundle_nopack"_hash)) {
156 Im2colKerns<Pack_Mode::NO_PACK> nopackkern;
157 return nopackkern.get_thread_bundle(
158 param, matmul_param, matmul_algo, ohw_tile_size, oc_tile_size);
159 }
160 MIDOUT_END();
161 }
162 return {nullptr, {}};
163}
164
165static WorkspaceBundle get_bundle(
166 const fallback::ConvBiasImpl::NCBKernSizeParam& param,

Callers 2

get_bundleFunction · 0.70
dispatch_kernsMethod · 0.70

Calls 2

MIDOUT_BEGINFunction · 0.50
get_thread_bundleMethod · 0.45

Tested by

no test coverage detected