Expression templates

Bill Baxter dnewsgroup at billbaxter.com
Wed Dec 13 20:20:16 PST 2006


Don Clugston wrote:
> Don Clugston wrote:
>> The recent language improvements (especially, opAssign) have made 
>> expression templates eminently feasible. Here's a proof-of-concept which
>> implements parsing of the basic vector operations of addition and 
>> scalar multiplication.
> 
> I've made a slightly improved version...

I'm making some headway on an nd-array class that uses BLAS/LAPACK under 
the hood.  It would be nifty if I could somehow get this:

      R = A * x + y

to be groked and translated to a single call to of BLAS's 
saxpy/daxpy/caxpy/zaxpy routines.

With all the EAX talk, it looks like you're talking about a different 
level of optimization.  The theory with BLAS anyway, is that you'll have 
access to a hand-tuned version for the platform you're on, so it'll be 
hard to beat with any kind of register-level compile-time 
micromanagement.  For instance BLAS level 3 (matrix-matrix) routines do 
blocking to make things easier on the cache for big inputs.  And of 
course there are also parallel BLAS implementations around, too.

--bb



More information about the Digitalmars-d mailing list