-
Notifications
You must be signed in to change notification settings - Fork 440
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
stride() is inconsistent with dimension(), extent(), etc. #1214
Comments
I had this conversation recently and I recall it dealing with the cost of stride per dimension, but I don’t remember all of the details. |
hmm I guess fundamentally stride() is multiplying out all the dimensions, so doing it all at once is more efficient that calling them all one at a time, so I guess I understand the motivation a bit more. still, in my case I only need one, so for that special case its less efficient. |
I’m not sure it’s a special case. I think it’s fairly common when interfacing views with linear algebra libraries. My comment wasn’t trying to discourage the feature, I was just reiterating the explanation I received when I asked this question. |
|
@mhoemmen as far as I know thats still the case, thats why I opened this issue. Edit: lies. |
I was able to do the following without issues: View<double**> A("A", M, N); // 2D view
int A_stride[A.Rank]; // length 2 array
A.stride(A_stride); // can pass length 2 array int stride call |
Oh yes, I misspoke there. I think the requirement has shifted to only being sized by the rank, so yes that particular issue has been fixed. I'm only referring to the need to pass an array at all. |
Yep, I would like to be able to do |
Why does
View::stride()
take an array and fill in all the values whileView::dimension()
andView::extent()
each take an index and return one value? This seems really inconsistent and less friendly to use. Can we add astride()
method that just takes an index and returns one value?@hcedwar @crtrott
The text was updated successfully, but these errors were encountered: