-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
OneTo
indices in a view
should have fast linear indexing
#18581
Conversation
Clearly I was too optimistic in thinking that I could fix this via the Github web interface without testing it locally. I'll try to correct this when I am at home tonight. |
CI is just failing due to #18577. |
Good catch. Interestingly, the example you give, however, can't have fast linear indexing. For example, A = rand(3,5)
B = view(A, 1:2, 1:3) clearly can't have fast linear indexing. Now, However, if all trailing indices are scalars (2 rather than |
Indeed, I was mixing linear indexing with the contiguous storage for BLAS matrix multiplication. But are the changes correct? Everywhere |
Yes, the code changes are perfect, and helpful indeed. Thanks! From my perspective this can be merged once CI finishes. |
It wouldn't hurt? |
3e99288
to
1be5818
Compare
This is still worth doing. I've rebased it and added a test — although note that it doesn't fix the case @Jutho originally reported. We cannot assume that This means that Jutho's original case still must remain IndexCartesian. The case that this affects is OneTo indices that follow a complete slice:
|
Thanks for that; I had forgotten about it. My initial example was indeed incorrect, as also pointed out by @timholy . |
I assume this was missed in the addition of the
OneTo
type?is contiguous and should have fast linear indexing. Does this need a test?
cc @timholy