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

Method exec_with_ncb_kern

dnn/src/fallback/convolution/opr_impl.cpp:284–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282}
283
284void ConvolutionImpl::exec_with_ncb_kern(const NCBKernParam& param, Algorithm* algo) {
285 auto&& kerns = NCB_ALGO_FUNC(dispatch_kern, algo, param);
286 auto&& fallback_handle = handle();
287 for (auto&& kernel : kerns) {
288 megdnn_assert(
289 param.filter_meta.format == Param::Format::NCHW ||
290 param.filter_meta.format == Param::Format::NHWC ||
291 param.filter_meta.format == Param::Format::NCHW88 ||
292 param.filter_meta.format == Param::Format::NCHW44 ||
293 param.filter_meta.format == Param::Format::NCHW44_DOT,
294 "invalid conv format");
295 auto run = [param, kernel](size_t index, size_t thread_id) {
296 CpuNDRange ndrange_id(kernel.global_size, index);
297 kernel.kern(param, {thread_id, ndrange_id});
298 };
299 static_cast<naive::HandleImpl*>(fallback_handle)
300 ->dispatch_kern(run, kernel.global_size.total_size());
301 }
302}
303
304ConvolutionImpl::Algorithm* ConvolutionImpl::get_algorithm_heuristic_with_ncb(
305 const NCBKernSizeParam& param, size_t workspace_limit_in_bytes,

Callers

nothing calls this directly

Calls 5

get_algorithmFunction · 0.85
total_sizeMethod · 0.80
kernMethod · 0.45
dispatch_kernMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected