-
-
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 generic fallback for Blas.LinAlg.axpy! #5189
Conversation
You have really turned your back to specifying types. Could there be a potential problem with difficult error messages when providing illegal inputs? Besides that I think it looks good except that I think it belongs in |
It's hard to break the habit of specifying types, but I'm beginning to feel that in Julia you should have a concrete reason to declare a type rather than vice versa. But if people feel strongly I about this case I could sprinkle a few If we put it in |
I'm fine the way it is. It's just a fallback. I don't have a strong opinion on blas.jl vs generic.jl. it depends on whether blas.jl should only contain blas wrappers. |
It may be worth specifying types for Is it worth considering |
…rns y rather than a pointer
Moved to |
add generic fallback for Blas.LinAlg.axpy!
With this and Givens, it's getting to the point where we'll have to make IterativeSolvers post-0.2.0-compatible only. |
You can always just do if VERSION < v"0.3"
# define things that weren't in 0.2 yet
end It's a bit of an eyesore, but it's easy to isolate and easy to delete later when it's no longer needed. |
That's almost above my pay grade to care about. |
Who uses 0.2 anymore? Any Julia version more than two days old is obviously a fossil. |
0.2 is so last month. |
In cases where one wants to use
axpy!
to reduce memory allocation (see e.g. JuliaLinearAlgebra/IterativeSolvers.jl#16), it is annoying that it is only defined forArray
s ofBlasFloat
types. This patch provides a fallback for arbitrary array-like and range-like types.Also, I noticed that
axpy!(alpha, x, y)
for BLAS types returnedy
, butaxpy!(alpha, x, rx, y, ry)
returned a pointer to data iny
. The latter exposure of the internal implementation seems undesirable and not very useful, so I modified it to returny
.