Closed jarlebring closed 3 years ago
Documentation of an upcoming change.
Currently, addition with identity in the generated Julia code becomes code like
# Computing Ba5_2 with operation: lincomb coeff1=-9.932061741024752e-6 coeff2=0.00035453728444091774 memslots[6][:]=coeff1*I + coeff2*memslots[2]
This is slow.
In-place addition with identity operator can be done like this:
copy!(memslots[6],memslots[2]); memslots[6] .*= coeff2; memslots[6] .+= coeff1*I
However, for some reason (I think it's because it reduces to a blas-call similar to our blas code) this is faster
copy!(memslots[6],memslots[2]); memslots[6] .*= coeff2; D=view(memslots[6], diagind(memslots[6], 0)); # Create a view of the diagonal D .+= coeff1;
Tag 0126ea62f77cb27aeddf85bdd6d8a08803fe3bb9
Updated code generation works efficiently with identity op.
Documentation of an upcoming change.
Currently, addition with identity in the generated Julia code becomes code like
This is slow.
In-place addition with identity operator can be done like this:
However, for some reason (I think it's because it reduces to a blas-call similar to our blas code) this is faster