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 sparse Subarray fill! #38021

Merged
merged 7 commits into from
Oct 20, 2020
Merged

Fix sparse Subarray fill! #38021

merged 7 commits into from
Oct 20, 2020

Conversation

dkarrasch
Copy link
Member

Closes #38009.

This should actually improve performance in broadcasted scalar assignments to sparse matrices (dest .= val). The functionality touched here hasn't been called since #26347, which had a missing <: and hided the function in dispatch, which was fixed in #37856, but revealed #38009. Also, #26347 added support for Integers, whereas the original code was written only for I::AbstractVector{<:Integer}, which included indexing into I. I haven't replaced the obviously scalar indexing calls by calls to the helper function, to allow for the detection of any flaws in the indexing logic (it's pretty involved, I must admit). You can index into a number, but only with index 1. So, if there were scalar indexing calls with helper indices other than 1, we should still see it, but tests seem to pass locally.

@mbauman mbauman added the sparse Sparse arrays label Oct 14, 2020
Co-authored-by: Matt Bauman <mbauman@juliacomputing.com>
Co-authored-by: Matt Bauman <mbauman@juliacomputing.com>
@dkarrasch
Copy link
Member Author

By the way, does this supersede #24711? Not necessarily this PR here, but more like #37856? @KristofferC

@dkarrasch dkarrasch merged commit a188457 into master Oct 20, 2020
@dkarrasch dkarrasch deleted the dk/fix_sparse_setindex! branch October 20, 2020 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sparse Sparse arrays
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sparse matrices broadcast broken
3 participants