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

Method get_algorithm_from_desc

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

Source from the content-addressed store, hash-verified

351}
352
353ConvolutionImpl::Algorithm* ConvolutionImpl::get_algorithm_from_desc(
354 const AlgorithmDesc& desc) {
355 if (!desc.valid()) {
356 return nullptr;
357 } else {
358 switch (desc.handle_type) {
359 case Handle::HandleType::FALLBACK: {
360 const auto& map = algo_pack().all_algos_map();
361 megdnn_assert(map.find(desc) != map.end());
362 return map.at(desc);
363 }
364 case Handle::HandleType::NAIVE: {
365 auto algo = static_cast<naive::HandleImpl*>(handle())
366 ->default_conv_fwd_algo();
367 megdnn_assert(algo->info().desc == desc);
368 return algo;
369 }
370 default:
371 megdnn_throw("Unknown handle type");
372 return nullptr;
373 }
374 }
375}
376
377ConvolutionImpl::Algorithm* ConvolutionImpl::get_algorithm(
378 const NCBKernSizeParam& param, size_t workspace_size) {

Callers

nothing calls this directly

Calls 6

default_conv_fwd_algoMethod · 0.80
validMethod · 0.45
findMethod · 0.45
endMethod · 0.45
atMethod · 0.45
infoMethod · 0.45

Tested by

no test coverage detected