From cdbb893b27319dfdb4da0c5e7a4b438b3dc1bae6 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Tue, 20 Dec 2022 09:46:48 +0000 Subject: [PATCH] dnn: disable OpenCL code path in MatMul processing - this mode is not supported by 22828 --- .../dnn/src/layers/fully_connected_layer.cpp | 2 +- modules/dnn/test/test_onnx_importer.cpp | 26 ++++++++++++++----- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/modules/dnn/src/layers/fully_connected_layer.cpp b/modules/dnn/src/layers/fully_connected_layer.cpp index 321994cbb7..505ea460d5 100644 --- a/modules/dnn/src/layers/fully_connected_layer.cpp +++ b/modules/dnn/src/layers/fully_connected_layer.cpp @@ -510,7 +510,7 @@ public: CV_TRACE_FUNCTION(); CV_TRACE_ARG_VALUE(name, "name", name.c_str()); - CV_OCL_RUN(IS_DNN_OPENCL_TARGET(preferableTarget), + CV_OCL_RUN(IS_DNN_OPENCL_TARGET(preferableTarget) && !isMatMul, forward_ocl(inputs_arr, outputs_arr, internals_arr)) if (inputs_arr.depth() == CV_16S) diff --git a/modules/dnn/test/test_onnx_importer.cpp b/modules/dnn/test/test_onnx_importer.cpp index e8350e418d..4546dccbb8 100644 --- a/modules/dnn/test/test_onnx_importer.cpp +++ b/modules/dnn/test/test_onnx_importer.cpp @@ -904,23 +904,37 @@ TEST_P(Test_ONNX_layers, Multiplication) testONNXModels("mul"); } -TEST_P(Test_ONNX_layers, MatMul) +TEST_P(Test_ONNX_layers, MatMul_2d) { - if (backend == DNN_BACKEND_INFERENCE_ENGINE_NN_BUILDER_2019) - applyTestTag(CV_TEST_TAG_DNN_SKIP_IE_NN_BUILDER); - testONNXModels("matmul_2d"); +} +TEST_P(Test_ONNX_layers, MatMul_3d) +{ testONNXModels("matmul_3d"); +} +TEST_P(Test_ONNX_layers, MatMul_4d) +{ testONNXModels("matmul_4d"); } -TEST_P(Test_ONNX_layers, MatMul_init) +TEST_P(Test_ONNX_layers, MatMul_2d_init) { testONNXModels("matmul_2d_init"); +} +TEST_P(Test_ONNX_layers, MatMul_3d_init) +{ testONNXModels("matmul_3d_init"); +} +TEST_P(Test_ONNX_layers, MatMul_4d_init) +{ testONNXModels("matmul_4d_init"); - +} +TEST_P(Test_ONNX_layers, MatMul_init_2) +{ testONNXModels("matmul_init_2"); +} +TEST_P(Test_ONNX_layers, MatMul_init_bcast) +{ testONNXModels("matmul_init_bcast"); }