diff --git a/modules/dnn/perf/perf_layer.cpp b/modules/dnn/perf/perf_layer.cpp index 38e35f1258..1e7552c86c 100644 --- a/modules/dnn/perf/perf_layer.cpp +++ b/modules/dnn/perf/perf_layer.cpp @@ -55,7 +55,7 @@ struct Layer_Slice : public TestBaseWithParam > } }; -static std::set nary_eltwise_cuda_deny_ops = {"add", "equal", "greater", "less", "mean", "mul", "pow", "sub"}; +static std::set nary_eltwise_cuda_deny_ops = {"equal", "greater", "less", "mean", "pow", "sub"}; struct Layer_NaryEltwise : public TestBaseWithParam > { diff --git a/modules/dnn/src/layers/nary_eltwise_layers.cpp b/modules/dnn/src/layers/nary_eltwise_layers.cpp index 3f43c024c7..91eb7f3c0e 100644 --- a/modules/dnn/src/layers/nary_eltwise_layers.cpp +++ b/modules/dnn/src/layers/nary_eltwise_layers.cpp @@ -112,7 +112,7 @@ public: op == OPERATION::LESS_EQUAL ); if (op == OPERATION::MAX || op == OPERATION::MIN || op == OPERATION::SUM || - op == OPERATION::PROD || op == OPERATION::DIV) + op == OPERATION::PROD || op == OPERATION::DIV || op == OPERATION::ADD) return backendId == DNN_BACKEND_OPENCV || backendId == DNN_BACKEND_CUDA; return backendId == DNN_BACKEND_OPENCV; } @@ -688,6 +688,7 @@ public: case OPERATION::SUM: return cuda4dnn::EltwiseOpType::SUM; case OPERATION::PROD: return cuda4dnn::EltwiseOpType::PRODUCT; case OPERATION::DIV: return cuda4dnn::EltwiseOpType::DIV; + case OPERATION::ADD: return cuda4dnn::EltwiseOpType::SUM; default: CV_Error(Error::StsNotImplemented, "Other operators except MAX, MIN, SUM, PRODUCT and DIV are not supported with cuda."); } }();