Skip to content

Add check in blas_compat_1d for stride == 0 and fix for stride < 0 #1088

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

Merged
merged 2 commits into from
Oct 25, 2021

Conversation

jturner314
Copy link
Member

@jturner314 jturner314 commented Oct 23, 2021

Fixes #1085.

It may also be necessary to return false for negative strides; I haven't tested that.

@bluss
Copy link
Member

bluss commented Oct 24, 2021

Thanks. DGEMV doc from http://www.netlib.org/blas/ confirms that INCX must not be zero

@bluss bluss force-pushed the fix-blas_compat_1d-stride0 branch 2 times, most recently from 7052177 to 48a6024 Compare October 24, 2021 11:55
@bluss
Copy link
Member

bluss commented Oct 24, 2021

I think I fixed the other issue too. As usual, BLAS wants the lowest in memory pointer. I'm not sure why we hadn't already fixed this. I added very simple tests to the blas testsuite (the tests would reliably fail and it would reproduce the stride == 0 error message, before the fix).

It's relatively fast and easy to run the blas tests. I use cargo test --features=openblas-system in xtest-blas, so it doesn't need to compile any blas backend, just using the system-installed one.

@bluss bluss changed the title Add check in blas_compat_1d for stride == 0 Add check in blas_compat_1d for stride == 0 and fix for stride < 0 Oct 24, 2021
Stride == 0 is unsuppored for vector increments;
Stride < 0 would be supported but the code needs to be adapted to pass
the right pointer for this case (lowest in memory pointer).

Co-authored-by: bluss <bluss@users.noreply.github.com>
@bluss bluss force-pushed the fix-blas_compat_1d-stride0 branch from 48a6024 to fe3baa6 Compare October 24, 2021 11:58
@bluss bluss added this to the 0.15.4 milestone Oct 24, 2021
@bluss bluss force-pushed the fix-blas_compat_1d-stride0 branch from cbd4d45 to b954a38 Compare October 25, 2021 17:15
@bluss bluss merged commit 55f3276 into rust-ndarray:master Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cblas_dgemv error during matrix multiplication
2 participants