-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Description
Based on https://discourse.julialang.org/t/uniform-scaling-inplace-addition-with-matrix/59928 some improvements can be done in the julia code gen:
- add a function
inplace_scale_add!(a,A,B::UniformScaling)
which computes A=a*A+B whereB=I
is UniformScaling with for-loop as in discourse - add a function
inplace_scale_add!(a,A,B::Matrix)
which computes A=a*A+B, essentially replacingBLAS.axpby!
calls withdot
operation. Direct BLAS-calls should be avoided in julia. - Replace codes like this with a
copy
-call and subsequently a call toinplace_scale_add!
memslots[6][:]=coeff1*memslots[2] + coeff2*memslots[3]
The functions should maybe take into account if a coefficient is one since it can be made more efficient. Maybe we need more functions, e.g. just inplace_add
and inplace_scale_add_scale!
and inplace_add_scale!
.
Metadata
Metadata
Assignees
Labels
No labels