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

Method dispatch_kern

dnn/src/fallback/convolution/algos.cpp:455–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

453}
454
455ConvolutionBackwardDataImpl::ncb_kern_t ConvolutionBackwardDataImpl::AlgoNaive::
456 dispatch_kern(
457 ConvolutionBackwardDataImpl*, const NCBKernSizeParam& param) const {
458#define cb(_dt) \
459 do { \
460 if (param.filter_type.enumv() == DTypeTrait<_dt>::enumv) { \
461 MIDOUT_BEGIN(megdnn_fallback_deconv, midout_iv(DTypeTrait<_dt>::enumv)) { \
462 using ctype = DTypeTrait<_dt>::ctype; \
463 return kern_naive<ctype, ctype, ctype>; \
464 } \
465 MIDOUT_END(); \
466 } \
467 } while (0);
468 MEGDNN_FOREACH_COMPUTING_DTYPE_FLOAT(cb);
469#undef cb
470#define cb(dt_src, dt_dst) \
471 do { \
472 if (param.diff_type.enumv() == DTypeTrait<dt_src>::enumv && \
473 param.filter_type.enumv() == DTypeTrait<dt_src>::enumv && \
474 param.grad_type.enumv() == DTypeTrait<dt_dst>::enumv) { \
475 MIDOUT_BEGIN( \
476 megdnn_fallback_deconv, midout_iv(DTypeTrait<dt_src>::enumv)) { \
477 return kern_naive< \
478 DTypeTrait<dt_src>::ctype, DTypeTrait<dt_src>::ctype, \
479 DTypeTrait<dt_dst>::ctype>; \
480 } \
481 MIDOUT_END(); \
482 } \
483 } while (0)
484 cb(dtype::Int8, dtype::Int32);
485 cb(dtype::Quantized8Asymm, dtype::QuantizedS32);
486 cb(dtype::QuantizedS8, dtype::QuantizedS32);
487 megdnn_throw("unsupported data type on ConvolutionBackwardData");
488#undef cb
489}
490
491/* ===================== direct algo ===================== */
492

Callers

nothing calls this directly

Calls 2

MIDOUT_BEGINFunction · 0.70
cbFunction · 0.50

Tested by

no test coverage detected