-
-
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
Add more negative stride support to BLAS Level 1/2 functions #42957
Conversation
501bc34
to
e89dce0
Compare
Looks like openblas on arm only test Anyway, |
55f1c1b
to
d755559
Compare
7ea2135
to
ca0e655
Compare
5dca9de
to
d86b66e
Compare
d86b66e
to
8f30511
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, just one very minor comment.
BTW, does this also fix #41513 (comment)? Does it therefore "replace" #42054 on master, so #42054 should be only backported to v1.7 and v1.6, but should not be used on master? |
No, that comment is not fixed in this PR. |
@N5N3 When you find the time, could you please resolve the merge conflict (on a quick glance, I couldn't find |
Define `vec_pointer_stride` Blas use the beginning in memory as the vector ptr. Also add test. Add neg-stride support to `scal!` test added Simplify `dot` implement Add neg-stride support to `nrm2`/`asum`/`iamax` test added some test clean Add neg-stride support to `axp(b)y!` And some code clean. tesst added Add neg-stride support to `symv`/`hemv` test added Add neg-stride support to `gbmv`/`hbmv`/`sbmv` test added Add neg-stride support to `hpmv`/`spmv` test added (and some code clean) Add neg-stride support to `ger`/`her`/`syr` test added Add neg-stride support to `trmv`/`trsv` test added Add neg-stride support to `spr!` Add neg-stride support to `copyto!` test added add some lazy some test clean Co-Authored-By: Daniel Karrasch <daniel.karrasch@posteo.de>
Only allow 0-stride inputs in `dot`/`axp(b)y`
Also call BLAS for negative `lda` (if possible)
0e4b17e
to
6f7daea
Compare
The unreviewed changes are sepetated. |
@dkarrasch All tests are done. Error on linux32/64 seems unrelated. (BLAS test passed). |
(cherry picked from commit 6409a8a)
(cherry picked from commit 6409a8a)
(cherry picked from commit 6409a8a)
This PR could be regarded as the follow-up attempt of #41513 and #39751
In general, negative stride support is added to the following Level 1 functions:
(Let
st
denotes the input vector's stride)nrm2
,asum
Openblas always return
0
ifst < 0
, so I pass inabs(st)
.scal!
st
and-st
give the same result, so I pass inabs(st)
.axpy(by)!
,BLAS.copyto!
st
does affect the results' order so I have to pass negativest
directly. At least OpenBLAS and MKL could handle these calls.(API with stide input, like
rot!(n, X, incx, Y, incy, c, s)
is not changed in this PR. User should pass in correct pointer ifinc < 0
)Besides,
st < 0
is supported by MKL and openblas for all the implemented Level 2 functions, so all of them are extended in this PR.Test Added.
Edit:
spr!
addedEdit2: commits have been cleaned for easier review.