Boost logo

Boost :

Subject: Re: [boost] How to structurate libraries ?
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2009-01-18 18:59:44


Joel Falcou wrote:

> Do you really thing I can't be able to hide this somehow ?
> This kind of thing *is* abstracted into the SIMD traits and use
> compile-time define to know how large a vector is on different platform.
> Thanks for thinking I am that much incompetent.

How are you supposed to code in a portable way?

If I write
vec<float> = {5., 5., 5., 5.};

the code will only compile if the SIMD register is 4 floats big on that
architecture (as you said yourself).

If it was
vec<float, 4> = {5., 5., 5., 5.};
the library could actually fallback to something else to make the code
work...

>> You had declared r to be a vec<float>.
> Which is call a typo. As I said, it's meant to be float r;

I was clarifying. You said you didn't declare 'r'.

>> How is that any different?
> Because sometimes you want to perform SIMD operation on something else
> than an array of value.

Like what?
That's what it is as far as I can see. That's what a vector is. N times
the same type. And SIMD performs the same operation on all elements.

I really don't see the difference.
I don't see much difference with uBlas either, except yours is a POD,
which doesn't bring anything useful as far as I can see.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk