Thanks, I see that the subject of in-place operations has been discussed several times before. I am not sure I completely understand what the resolution is, it seems that everyone is happy with += and the like not being in-place operators, but just syntactic sugar. But I did learn from the discussion that the .+ operators actually translate to a broadcast (I thought it was merely an element-wise operation), so that is great, that makes the code look a lot cleaner. Then with @devec and @in2 macros I should more or less get what I want in most cases. I think only a .+= to broadcast!() translation is not covered.
Cheers, ---david On Thursday, November 13, 2014 3:18:49 PM UTC+1, Andreas Noack wrote: > > See the discussion https://github.com/JuliaLang/julia/issues/249 and the > code in https://github.com/simonbyrne/InplaceOps.jl. > > Personally, I like to use the BLAS like way if writing the multiplication > in optimized code. Hopefully, we can soon get rid of the `A` and `B` part > of `A_mul_B!` such that it would only be `mul!` and I'd also like if we > adopt the BLAS convention completely and add scalar arguments to the matrix > multiplication functions. > > 2014-11-13 6:11 GMT-05:00 David van Leeuwen <[email protected] > <javascript:>>: > >> On a related note, >> >> On Tuesday, October 21, 2014 10:20:25 PM UTC+2, Stefan Karpinski wrote: >>> >>> On Tue, Oct 21, 2014 at 4:13 PM, David van Leeuwen < >>> [email protected]> wrote: >>> >>>> Does anybody know if `a' * b` is translated to a single BLAS call with >>>> the correct transposition options set, or that this is translated to a >>>> transposition followed by a BLAS call? >>> >>> >>> Yes, `a' * b` is parsed specially and calls the wonderfully named >>> Ac_mul_B function, which calls BLAS without doing an explicit conjugate >>> transpose. We would like to change this by making (conjugate) transpose >>> lazy so that both version use the same BLAS call. >>> >> >> I am now at the point where I get a lot of efficiency out of in-place >> multiplication >> by triangular matrix. Julia uses BLAS.trmm! in >> >> A_mul_B!(x, triangular) >> >> which is great. Is there any chance Julia will learn to substitute >> A_mul_B!() when using the syntax >> >> x = x * triangular >> >> or, what I like even more but gets a bit hairy for matrices, >> >> x *= triangular >> >> ? >> >> Cheers, >> >> ---david >> > >
