1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Merge pull request #23255 from zihaomu:fused_cuda_naryeltwise

DNN: fuse conv+naryEletwise on CUDA backend.
This commit is contained in:
Zihao Mu
2023-02-17 18:18:13 +08:00
committed by GitHub
parent 923dbcc58f
commit 20dac7ea48
3 changed files with 66 additions and 22 deletions
+2 -1
View File
@@ -606,7 +606,8 @@ public:
if(IS_DNN_CUDA_TARGET(preferableTarget))
{
Ptr<EltwiseLayer> eltwise = top.dynamicCast<EltwiseLayer>();
if (!eltwise.empty()) // && eltwise->op == EltwiseLayer::SUM && eltwise->coeffs.empty())
Ptr<NaryEltwiseLayer> naryEltwise = top.dynamicCast<NaryEltwiseLayer>();
if (!eltwise.empty() || !naryEltwise.empty())
{
/* we also need to check that the eltwise input does not require shortcut mechanism
* it's difficult to verify it here but we hope that `fuseLayers` has done the check already