Boost logo

Ublas :

From: James Sutherland (James.Sutherland_at_[hidden])
Date: 2008-01-22 17:20:59


Gunter,

Thanks for your advice!

I was using noalias previously. I just changed to axpy_prod and the result
is 5x faster! Now I am on par with the current linear algebra package I am
using.

James

On 1/22/08 3:08 PM, "Gunter Winkler" <guwi17_at_[hidden]> wrote:

> Am Dienstag, 22. Januar 2008 22:58 schrieb James Sutherland:
>> I have run this using compressed_matrix and find that the application
>> is still 5x slower than my current implementation, which is not
>> hand-tuned.
>>
>> I am using the following flags with g++ 3.4.6
>> -04 -fexpensive-optimizations -funroll-loops -DNDEBUG
>>
>> Running gprof shows that
>> ublas::vector_assign
>> consumes 40% of the execution time, while
>> ublas::compressed_matrix::find2
>> consumes 35% of the total time.
>
> This looks like you are not using axpy_prod (see operation.hpp)
>
> Without further information what kind of matrix/vector operations you
> need we can not give any hints. The general optimizations are
>
> * use noalias where possible
>
> noalias(x) = y + z;
>
> * use axpy_prod where possible
>
> axpy_prod(A,x,y,false); // y += prod(A,x)
> axpy_prod(A,x,y,true); // y = prod(A,x)
>
> * use iterators instead of loops and operator(i,j)
>
> mfg
> Gunter
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/ublas

-- 
James C. Sutherland, Asst. Professor, Dept. of Chemical Engineering
The University of Utah
50 S. Central Campus Dr, 3290 MEB
Salt Lake City, UT 84112-9203
Tel: (801) 585-1246
http://www.che.utah.edu/~sutherland