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

SIMDSort reads beyond end of array #1

Open
Reen opened this issue Aug 3, 2018 · 2 comments
Open

SIMDSort reads beyond end of array #1

Reen opened this issue Aug 3, 2018 · 2 comments

Comments

@Reen
Copy link

Reen commented Aug 3, 2018

I tried to use your AVX2 SIMDSort code to sort a list of 2,000,000 floats. In the final pass of MergePass8 with run_size = 512 the code in the for-loop accesses memory outside the array. As 2,000,000 is divisible by 64, I do not run into the assert() at the entry point.

I tried to debug it, but I'm unable to find a reasonable abort criterion for the loop. Can you provide a hint on how to fix this?

Thank you for your time.

@saatviks
Copy link
Collaborator

saatviks commented Aug 3, 2018

We should have added an assertion for this too(I think its explained in the report) - but the input size has to be a power of 2 as well.

Edit: Yes, we have mentioned it under the Usage section in the README.

@PatwinchIR
Copy link
Owner

For now, you might need to manually match your input size to the power of 2. We might release a version in the future to automatically handle this. Sorry about the inconvenience.

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

No branches or pull requests

3 participants