cuda4dnn(concat): fix stream not being set for concat wrappers after fusion #17359
Merged
opencv-pushbot merged 1 commit intoopencv:masterfrom May 27, 2020
Merged
Conversation
6 tasks
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug introduced in #16161
The concat fusion logic creates new wrappers. I forgot to set the streams of the newly created wrappers after fusion. This makes the wrappers use the default stream for copying.
#17349 dropped support for default streams and added assertions to catch the accidental use of default streams.
The new assertions are triggered when blobs of concat layer are being transferred from host to device or vice versa. Unfortunately, this situation does not happen in any test case. Hence, the bug wasn't caught.
This PR removes the need to set streams manually (very error-prone and easy to forget) and instead does it automatically in
wrap. Ideally, it is best if this was done insidewrapMatbut it's a static function and doesn't have access toimpl. ThesetStreamcode has to be copied whereverwrapMatis used. So there is a risk of new bugs in the future.Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.