Repository navigation
flann/kmeans: Fix non-determinism of KMeans index - #14092
Merged
Merged
Conversation
Member
|
Nice catch! Using of multiple mutexes has huge overhead here. I believe we can move out post-processing from parallel_for body (it is simple enough).
|
Member
|
As a "bugfix" this patch should go into 3.4 branch first. We will merge changes from 3.4 into master regularly (weekly/bi-weekly). So, please:
Note: no needs to re-open PR, apply changes "inplace". |
mattismyname
force-pushed
the
fix-kmeans
branch
from
March 19, 2019 23:03
bd21bd7 to
9f7868e
Compare
Author
|
ok please take a look now. |
alalek
reviewed
Mar 20, 2019
alalek
left a comment
Member
There was a problem hiding this comment.
Well done!
Please take a look on comments below.
Member
|
Perhaps this patch should resolve these sporadic failures: #9179 |
mattismyname
force-pushed
the
fix-kmeans
branch
3 times, most recently
from
March 20, 2019 15:41
6b3b022 to
80cadf5
Compare
When running with >1 OpenCV thread, KMeans index generation was non-deterministic because of a RWW race. Issue is resolved by removing the offending logic from the parallel section.
mattismyname
force-pushed
the
fix-kmeans
branch
from
March 20, 2019 15:45
80cadf5 to
74e3403
Compare
opencv-pushbot
pushed a commit
that referenced
this pull request
Mar 20, 2019
Merged
SavyaSanchi-Sharma
pushed a commit
to SavyaSanchi-Sharma/opencv
that referenced
this pull request
Jul 30, 2026
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.
When running with >1 OpenCV thread, KMeans index generation was
non-deterministic. Issue is resolved by protecting each radius variable
with a mutex.
resolves #9179
relates #3458