Merge pull request #16063 from YashasSamaga:cuda4dnn-shortcut-unequal

support eltwise sum with different number of input channels in CUDA backend

* add shortcut primitive

* add offsets in shortcut kernel

* skip tests involving more than two inputs

* remove redundant modulus operation

* support multiple inputs

* remove whole file indentation

* skip acc in0 trunc test if weighted

* use shortcut iff channels are unequal
This commit is contained in:
Yashas Samaga B L
2020-01-17 00:24:00 +05:30
committed by Alexander Alekhin
parent c30af724ef
commit d85e67d3ec
6 changed files with 234 additions and 7 deletions
+4 -4
View File
@@ -1624,7 +1624,7 @@ TEST_P(Layer_Test_Eltwise_unequal, accuracy_input_0_truncate)
int backendId = get<0>(get<1>(GetParam()));
int targetId = get<1>(get<1>(GetParam()));
if (backendId == DNN_BACKEND_CUDA)
if (backendId == DNN_BACKEND_CUDA && weighted)
applyTestTag(CV_TEST_TAG_DNN_SKIP_CUDA);
Net net;
@@ -1690,15 +1690,15 @@ TEST_P(Layer_Test_Eltwise_unequal, accuracy_input_0)
int backendId = get<0>(get<1>(GetParam()));
int targetId = get<1>(get<1>(GetParam()));
if (backendId == DNN_BACKEND_CUDA)
applyTestTag(CV_TEST_TAG_DNN_SKIP_CUDA);
Net net;
LayerParams lp;
lp.type = "Eltwise";
lp.name = "testLayer";
lp.set<std::string>("output_channels_mode", "input_0");
if (backendId == DNN_BACKEND_CUDA && weighted)
applyTestTag(CV_TEST_TAG_DNN_SKIP_CUDA);
const int inpShapes[][4] = {{1, 4, 2, 2}, {1, 2, 2, 2}, {1, 3, 2, 2}};
const int out_channels = inpShapes[0][1];
std::vector<String> inpNames(3);