提交 845f42a3 编写于 作者: M Megvii Engine Team

fix(midout/naive/warp_perspective): fix Template Functions instantiation

GitOrigin-RevId: c487f3663dcaf1bde5c56854fcd3d51a5e8cd734
上级 5fb07c99
......@@ -141,20 +141,25 @@ void WarpPerspectiveImpl::kern_fallback(
if (is_resize_optimizable(sub_param.mptr)) {
if (bmode == BorderMode::CONSTANT) {
MIDOUT_BEGIN(megdnn_fallback_warpperspective, midout_iv(1),
midout_iv(true)) {
midout_iv(true), ctype, mtype) {
kern_resize<true, ctype, mtype>(sub_param);
} MIDOUT_END();
}
MIDOUT_END();
} else {
MIDOUT_BEGIN(megdnn_fallback_warpperspective, midout_iv(1),
midout_iv(false)) {
midout_iv(false), ctype, mtype) {
kern_resize<false, ctype, mtype>(sub_param);
}
MIDOUT_END();
}
} else {
rep(oh, OH) kern_naive<ctype, mtype>(sub_param, oh);
MIDOUT_BEGIN(megdnn_fallback_warpperspective, midout_iv(2), ctype,
mtype) {
rep(oh, OH) kern_naive<ctype, mtype>(sub_param, oh);
}
MIDOUT_END();
}
sub_param.mptr += 3*3;
sub_param.mptr += 3 * 3;
sub_param.dptr += C*OH*OW;
}
......
......@@ -148,6 +148,24 @@ void WarpPerspectiveForwardImpl::kern_naive(
MIDOUT_END();
}
#define INST(ctype, mtype) \
template void WarpPerspectiveForwardImpl::kern_naive<ctype, mtype>( \
const KernParam<ctype, mtype>&, size_t);
INST(float, float);
#if !MEGDNN_DISABLE_FLOAT16
INST(dt_float16, float);
INST(dt_float16, dt_float16);
INST(dt_bfloat16, float);
INST(dt_bfloat16, dt_bfloat16);
#endif
INST(int8_t, float);
INST(uint8_t, float);
#undef INST
template <typename ctype, typename mtype>
void WarpPerspectiveForwardImpl::kern_naive_nhwcd4(
const KernParam<ctype, mtype>& kern_param, size_t task_id) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册