Merge pull request #23511 from zihaomu:issue_23465

pull/23529/head
Alexander Alekhin 2 years ago
commit 9ab0ff6cf2
  1. 5
      modules/dnn/src/layers/cpu_kernels/convolution.cpp
  2. 1
      modules/dnn/test/test_onnx_importer.cpp

@ -456,7 +456,8 @@ void runFastConv(InputArray _input, OutputArray _output, const Ptr<FastConv>& co
int dilation_d = conv->dilation_d, dilation_h = conv->dilation_h, dilation_w = conv->dilation_w; int dilation_d = conv->dilation_d, dilation_h = conv->dilation_h, dilation_w = conv->dilation_w;
int ksize = Dk*Hk*Wk; int ksize = Dk*Hk*Wk;
bool fast_1x1 = ksize == 1 && stride_d == 1 && stride_w == 1 && stride_h == 1; bool fast_1x1 = ksize == 1 && stride_d == 1 && stride_w == 1 && stride_h == 1
&& pad_front == 0 && pad_left == 0 && pad_top == 0;
int DkHkWkCg = Dk*Hk*Wk*Cg; int DkHkWkCg = Dk*Hk*Wk*Cg;
std::vector<int> ofstab_(Hk*Wk*Dk*4, 0); std::vector<int> ofstab_(Hk*Wk*Dk*4, 0);
@ -502,7 +503,7 @@ void runFastConv(InputArray _input, OutputArray _output, const Ptr<FastConv>& co
} }
} }
int MAX_STRIPES = (56 + CONV_NR - 1)/CONV_NR; int MAX_STRIPES = conv->conv_type == CONV_TYPE_DEPTHWISE_REMAIN ? 1 : (56 + CONV_NR - 1)/CONV_NR;
// Friendly to L1 cache // Friendly to L1 cache
const int K_BLOCK_SIZE = conv->conv_type == CONV_TYPE_DEPTHWISE_REMAIN ? 1 : 32; const int K_BLOCK_SIZE = conv->conv_type == CONV_TYPE_DEPTHWISE_REMAIN ? 1 : 32;

@ -256,6 +256,7 @@ TEST_P(Test_ONNX_layers, Convolution3D_bias)
applyTestTag(CV_TEST_TAG_DNN_SKIP_CUDA_FP16); applyTestTag(CV_TEST_TAG_DNN_SKIP_CUDA_FP16);
} }
testONNXModels("conv3d_bias"); testONNXModels("conv3d_bias");
testONNXModels("conv3d_depthwise_bias"); // kernel 1x1
} }
TEST_P(Test_ONNX_layers, Two_convolution) TEST_P(Test_ONNX_layers, Two_convolution)

Loading…
Cancel
Save