the original post deleted. the gist has some typo, I fixed it. I have looked at the arrayview. I am not sure if that helps.
I rewrote the function here https://gist.github.com/GaZ3ll3/c0201b02eb2bc5a8b58f it allocated a lot of memory in running time, makes conquer and divide really slow if depth is a little bit large. If depth is only 1. it will beat the tranditional dgemm by 8% or so on my machine. On Friday, July 18, 2014 1:56:17 PM UTC-5, Blake Johnson wrote: > > I think what you want is a view rather than a copy. This will probably > come to base Julia in the next release cycle, but for now you might check > out the ArrayViews.jl package: > > https://github.com/lindahua/ArrayViews.jl > > On Friday, July 18, 2014 12:00:05 PM UTC-4, Yimin Zhong wrote: >> >> I tried to implement Strassen algorithm for matrix multiplication in >> julia. And here is the gist, a naive implementation. a sample benchmark >> is included at beginning of the file. >> >> https://gist.github.com/GaZ3ll3/87df748f76b119199fed >> >> It can beat Julia's A_mul_B!(). around 2~8% faster, depending on the size >> of matrix and mindim threhold. >> >> However*, my problem* is it takes julia like 2~5% of the running time on >> allocating *lots* of memory, like storing 3 extra matrices. >> >> Now I am using >> >> a11 = a[1:mt, 1:kt] >> >> to get a submatrix, I assume this is a copy of values, not passing >> reference or using pointer. I think this is the problem, but I do not know >> how to avoid this and use pure julia pointer for all computing( in julia). >> >> later I found out "sub" function can give a SUBARRAY, which is using >> reference. But when I changed the code into sub-based. >> >> It takes much longer time to run a program. Not better, also it consumes >> lots of memory. I do not know why. >> >> Anyway, I can write this in C using cblas, using pure pointer operations >> and then call the C library(in fact, i already wrote it), I just want to >> see how is strassen algorithm working on Julia. >> >> >>
