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 bounds checking for certain sparse matrix cases #9864

Merged
merged 1 commit into from
Jan 22, 2015

Conversation

simonster
Copy link
Member

Previously this did not throw for spmat[0:1, 1] and some related cases, and threw "invalid Array dimensions" for spmat[:, 0:1] instead of a BoundsError.

@simd for k in colptrA[col]:colptrA[col+1]-1
if rowvalA[k] in I; nnzS += 1 end # `in` is fast for ranges
@inbounds nnzS += rowvalA[k] in I # `in` is fast for ranges
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This had @simd but not @inbounds, so it wasn't vectorizable. I haven't checked to see if LLVM is actually vectorizing it now, but it's conceivably possible.

simonster added a commit that referenced this pull request Jan 22, 2015
Fix bounds checking for certain sparse matrix cases
@simonster simonster merged commit 7221a83 into master Jan 22, 2015
@simonster simonster deleted the sjk/sparse-bounds branch January 22, 2015 02:55
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.

2 participants