Skip to content

Fixed bug that made cuda::filter give corrupted output when different filters were used in different threads/streams. - #13695

Merged
alalek merged 3 commits into
opencv:3.4from
flyingfalling:3.4
Mar 13, 2019
Merged

alalek merged 3 commits into
opencv:3.4from
flyingfalling:3.4

Conversation

@flyingfalling

@flyingfalling flyingfalling commented Jan 26, 2019 •

Copy link
Copy Markdown
Contributor

… filters called in different threads. This was due to use of global texture variable shared by all filters.

resolves #6742

force_builders=linux,Docs,Custom
buildworker:Custom=linux-1,linux-2,linux-4
docker_image:Custom=ubuntu-cuda:16.04

… filters called in different threads. This was due to use of global texture variable shared by all filters.
@flyingfalling

Copy link
Copy Markdown
Contributor Author

This looks like it succeeded on source builds but failed on "docs" build (something about whitespace?). What does that mean? Did I incorrectly use tabs or spaces or something? -R

@alalek

alalek commented Jan 29, 2019 •

Copy link
Copy Markdown
Member

Here:

modules/cudafilters/src/cuda/filter2d.cu:82: tab in indent.
+	    PtrStepSz<type> dat; \

Don't use tabs. Use 4 spaces instead.
See coding style guide / contribution guidelines on OpenCV Wiki pages.


Update:

  • removed wrong note about another PR

@nglee

nglee commented Mar 13, 2019 •

Copy link
Copy Markdown
Contributor

#6742 (comment)

This may have some downsides when it comes to 2D locality since it is accessing in 16x16 chunks, but on newer devices this downside will probably be negligible.

Comparing the "mean" value of opencv_perf_cudafilters, no significant performance loss was observed by this PR. In fact, in many cases, performance improved. (CUDA 10.1, 2080 Ti)

@alalek
alalek merged commit 8158e5b into opencv:3.4 Mar 13, 2019
@alalek alalek mentioned this pull request Mar 13, 2019
@flyingfalling

flyingfalling commented Mar 14, 2019 •

Copy link
Copy Markdown
Contributor Author

To confirm, do I need to make a pull request for the opencv_contrib repo?

The source this patched was moved from opencv to opencv_contrib after opencv4, and I would like that to get patched ASAP too...

Edit: I went ahead and created one, since it seems contrib hasn't been updated in 6 months?

@alalek

alalek commented Mar 14, 2019

Copy link
Copy Markdown
Member

No, CUDA patches from 3.4 are moved to opencv_contrib here: opencv/opencv_contrib#2040

SavyaSanchi-Sharma pushed a commit to SavyaSanchi-Sharma/opencv that referenced this pull request Jul 30, 2026
* Fixed bug that made cuda::filter give corrupted output when different filters called in different threads. This was due to use of global texture variable shared by all filters.

* REV: fixed tab issue for opencv coding style...
kallaballa pushed a commit to kallaballa/Plan-V4D.old that referenced this pull request Sep 1, 2026
…gfalling:3.4

* Fixed bug that made cuda::filter give corrupted output when different filters called in different threads. This was due to use of global texture variable shared by all filters.

* REV: fixed tab issue for opencv coding style...

original commit: opencv/opencv@8158e5b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: gpu/cuda (contrib) OpenCV 4.0+: moved to opencv_contrib

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants