Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicates using custom compare with bitonic block sort #803

Conversation

rosenrodt
Copy link
Contributor

I have modified test case to reproduce the issue as described in #774. And a fix is proposed

Tested on:

  • Nvidia Geforce GTX1060
  • AMD Radeon HD 6770

@jszuppe
Copy link
Contributor

jszuppe commented Dec 19, 2018

Thanks! I'll look into today or later this week and merge.

@jszuppe
Copy link
Contributor

jszuppe commented Dec 19, 2018

It would be great if you can change the order of commits: first test which shows the bug, then commit with a fix. Please reference issue id in the fix commit. If you have problems with doing that, or don't know how to do it using git, don't worry, I'll do that for you. Thanks again for submitting a fix and testing it on two platforms!

@rosenrodt
Copy link
Contributor Author

I’ll do that once I get back to my computer. Do I simply force-push to rewrite the git history?

@jszuppe
Copy link
Contributor

jszuppe commented Dec 19, 2018

Yes, force push will work.

@rosenrodt rosenrodt force-pushed the fix-dupe-with-custom-compare-bitonic-block-sort branch from 528eb79 to bceb336 Compare December 19, 2018 13:30
@rosenrodt
Copy link
Contributor Author

@jszuppe thanks. i've rearranged the commits

@jszuppe
Copy link
Contributor

jszuppe commented Dec 19, 2018

After looking at it.

  1. Will it work correctly if we do opposite: force them not to do the swap if they are equal? This is always one local memory operation less. I think the bug is/was that if there are equal values one is swapped and one is not.
  2. If 1. does not work, then I think we can at least limit your fix to sort_by_key situation only.

But in generally fix is ok.

@rosenrodt
Copy link
Contributor Author

  1. That will do too. I have pushed them too in the PR
  2. The fix concerns bitonic_block_sort with sort_by_key = false. So I am not sure what you mean by that. Although I haven't looked into it but does the CPU equivalent or bitonic_block_sort with sort_by_key = true could possibly repro issue Wrong sort results using customized compare #774 too?

btw the Travis build server seems to complain about missing CL.h

@jszuppe
Copy link
Contributor

jszuppe commented Dec 20, 2018

  1. Ok
  2. Yeah, you're right. I think it can apply sort-by-key situation too with keys, but of course this fixes also that problem.

@jszuppe
Copy link
Contributor

jszuppe commented Dec 20, 2018

btw the Travis build server seems to complain about missing CL.h

Yeah, I'll have to fix Travis CI script someday.... Too much work at work ;)

@jszuppe jszuppe merged commit 2a12dee into boostorg:develop Dec 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants