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

Method get_workspace

dnn/src/fallback/conv_bias/algos.cpp:182–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182size_t ConvBiasImpl::AlgoNaive::get_workspace(const NCBKernSizeParam& p) const {
183 MIDOUT_BEGIN(megdnn_fallback_naive, 1) {
184 auto layouts = get_layouts(p);
185 //! When group>1 or n>1, this algo will parallel by group and n
186 size_t nr_threads = p.nr_threads;
187 auto conv_opr = inplace_cpu_handle()->create_operator<ConvolutionForward>();
188 conv_opr->param() = get_param_convolution(p);
189 if (p.dst_type.enumv() == DTypeEnum::QuantizedS8 ||
190 p.dst_type.enumv() == DTypeEnum::Quantized8Asymm) {
191 TensorLayout conv_dst_layout;
192 conv_opr->deduce_layout(layouts[0], layouts[1], conv_dst_layout);
193 WorkspaceBundle bundle(nullptr, {conv_dst_layout.span().dist_byte()});
194 return bundle.total_size_in_bytes() * nr_threads;
195 }
196 return 0;
197 }
198 MIDOUT_END();
199 return 0;
200}
201
202SmallVector<ConvBiasImpl::NCBKern> ConvBiasImpl::AlgoNaive::dispatch_kerns(
203 const NCBKernSizeParam& p) const {

Callers 2

do_softmaxFunction · 0.45

Calls 10

get_param_convolutionFunction · 0.85
dist_byteMethod · 0.80
spanMethod · 0.80
total_size_in_bytesMethod · 0.80
get_layoutsFunction · 0.70
MIDOUT_BEGINFunction · 0.50
paramMethod · 0.45
enumvMethod · 0.45
deduce_layoutMethod · 0.45
get_workspace_sizeMethod · 0.45

Tested by

no test coverage detected