提交 2d3267c8 编写于 作者: C chenjiaoAngel

fix kernel chosee. test=develop

上级 ae8cfcec
...@@ -80,6 +80,7 @@ if (NOT HAS_ARM_MATH_LIB_DIR) ...@@ -80,6 +80,7 @@ if (NOT HAS_ARM_MATH_LIB_DIR)
conv3x3s2_depthwise_int8.cc conv3x3s2_depthwise_int8.cc
conv5x5s1_depthwise_int8.cc conv5x5s1_depthwise_int8.cc
conv5x5s1_depthwise_fp32.cc conv5x5s1_depthwise_fp32.cc
conv5x5s1_depthwise_fp32_c4.cc
conv5x5s2_depthwise_int8.cc conv5x5s2_depthwise_int8.cc
conv5x5s2_depthwise_fp32.cc conv5x5s2_depthwise_fp32.cc
conv3x3_winograd_fp32_c4.cc conv3x3_winograd_fp32_c4.cc
......
此差异已折叠。
...@@ -735,6 +735,7 @@ void conv_depthwise_5x5_fp32(const void* din, ...@@ -735,6 +735,7 @@ void conv_depthwise_5x5_fp32(const void* din,
bool flag_relu = param.fuse_relu; bool flag_relu = param.fuse_relu;
bool flag_bias = param.bias != nullptr; bool flag_bias = param.bias != nullptr;
ctx->ExtendWorkspace((w_in + w_out) * sizeof(float)); ctx->ExtendWorkspace((w_in + w_out) * sizeof(float));
bool flag_act = param.act_param.has_active;
if (stride == 2) { if (stride == 2) {
conv_depthwise_5x5s2_fp32(reinterpret_cast<const float*>(din), conv_depthwise_5x5s2_fp32(reinterpret_cast<const float*>(din),
reinterpret_cast<float*>(dout), reinterpret_cast<float*>(dout),
...@@ -751,7 +752,7 @@ void conv_depthwise_5x5_fp32(const void* din, ...@@ -751,7 +752,7 @@ void conv_depthwise_5x5_fp32(const void* din,
act_param, act_param,
ctx); ctx);
} else if (stride == 1) { } else if (stride == 1) {
if (h_in < 5 || w_in < 5) { if (h_in < 5 || w_in < 5 || flag_act) {
conv_depthwise_5x5s1_fp32(reinterpret_cast<float*>(dout), conv_depthwise_5x5s1_fp32(reinterpret_cast<float*>(dout),
reinterpret_cast<const float*>(din), reinterpret_cast<const float*>(din),
reinterpret_cast<const float*>(weights), reinterpret_cast<const float*>(weights),
......
...@@ -58,7 +58,8 @@ void DepthwiseConv<PRECISION(kFloat), PRECISION(kFloat)>::PrepareForRun() { ...@@ -58,7 +58,8 @@ void DepthwiseConv<PRECISION(kFloat), PRECISION(kFloat)>::PrepareForRun() {
auto strides = param.strides; auto strides = param.strides;
auto hin = param.x->dims()[2]; auto hin = param.x->dims()[2];
auto win = param.x->dims()[3]; auto win = param.x->dims()[3];
if (win >= kw && hin >= kw && (strides[0] == 1 && strides[1] == 1)) { bool flag_act = param.act_param.has_active;
if (win >= kw && hin >= kw && (strides[0] == 1 && strides[1] == 1) && !flag_act) {
flag_trans_weights_ = false; flag_trans_weights_ = false;
impl_ = lite::arm::math::conv_depthwise_5x5_fp32; impl_ = lite::arm::math::conv_depthwise_5x5_fp32;
#ifdef LITE_WITH_PROFILE #ifdef LITE_WITH_PROFILE
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册