![]() |
Blitz Support : |
From: Mathias Wagner (mathias.wagner_at_[hidden])
Date: 2004-08-19 02:26:14
HI,
> yourselves. If there is anything I can do to improve the performance,
> please let me know. Your comments and suggestions are appreciated.
try using CBLAS (for example the GSL or Intel MKL implementation) function
cblas_dgemm
like this
inline blitz::Array<double,2> matmult(const blitz::Array<double,2> &A,const
blitz::Array<double,2> &B) const
{
blitz::Array<double,2> C(A.rows(),B.columns());
cblas_dgemm(CblasRowMajor,CblasNoTrans,CblasNoTrans,C.rows(),C.columns(),A.columns(),1.0,A.data(),A.columns(),B.data(),B.columns(),0.0,C.data(),C.columns());
return C.copy();
};
for me, using the GSL this was about 4 times faster than 3 loops over
Blitz::Arrays. The Intel MKL implementation was even 10 times faster than the
loop version.
(using icc 8.0 "icc -fast -tpp7 -xN" on a 2.6 GHz P4)
See
http://www.gnu.org/software/gsl/
http://www.intel.com/software/products/mkl/noncom.htm
for more details.
Mathias
> yourselves. If there is anything I can do to improve the performance,
> please let me know. Your comments and suggestions are appreciated.