Boost logo

Glas :

Re: [glas] mapping expressions to backend

From: Andrew Lumsdaine (lums_at_[hidden])
Date: 2006-01-19 14:21:54


This can happen in a couple of ways.

One obvious way is for expressions / operations that do not have a
corresponding BLAS realization. Adding three vectors together and
putting them into a third, for example. Doing this with successive
axpy calls is going to take many more trips through memory than the
single fused loop you would get with an expression template approach.

Second, Toon didn't say that generic/blas would always outperform
every optimized BLAS out there. BLAS contains a number of functions
(level 1, level 2, level 3). Level-1 and level-2 BLAS are
straightforward to match in performance (on microprocessor based
systems) because the computation isn't typically the limiting factor
on problems of any scale. It is only level 3 that can really reach
close to peak performance (because of the favorable ratio of compute
to memory access). Even in that case, the optimizations to get that
level of performance are well known and done at a high level (loop
unrolling, tiling, blocking) -- and can be included in a glas
equivalent to level-3 BLAS. With MTL we were able to match or beat
several vendor-tuned BLAS on gemm -- including ESSL. And even if
there are BLAS out there that are faster than glas for gemm -- some
won't be -- hence, it is to be expected that there will be cases
(CPU, problem size, compiler, vendor) where generic/blas backed
outperforms BLAS.

On Jan 19, 2006, at 6:26 AM, C J Kenneth Tan -- OptimaNumerics wrote:

> Toon,
>
>> It is not unthinkable that the generic/glas backend outperforms an
>> optimised BLAS library for instance on e.g. compile-time-fixed-size
>> vectors.
>
> How do you see this being possible when some implementations of BLAS
> can deliver 98% to 99% of peak chip performance?
>
>
> Kenneth Tan
> ----------------------------------------------------------------------
> -
> C J Kenneth Tan, PhD
> OptimaNumerics Ltd Telephone: +44 798 941 7838
> E-mail: cjtan_at_[hidden] Telephone: +44 207 099 4428
> Web: http://www.OptimaNumerics.com Facsimile: +44 207 100 4572
> ----------------------------------------------------------------------
> -
> _______________________________________________
> glas mailing list
> glas_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/glas