[log in to unmask] wrote:
>
>
> Exactly. To be consistent, there should be a NORM(X) function,
> (yes, it is redundant with DOT_PRODUCT(X,X), in the same way
> than this latter is redundant with SUM(X*X). What is aimed here
> is optimisation: it's easier for a compiler to optimise
> NORM(X) rather than DOT_PRODUCT(X,X))
>
> Wrong. It's not more difficult to optimize DOT_PRODUCT(x,x) than NORM(x),
> if the compiler has the slightest bit of modern optimzation technology in
> it. Most of the compilers I've seen turn DOT_PRODUCT(X,y) pretty
> immediately into SUM(X*Y) anyway.
>
So what is the reason for having DOT_PRODUCT ?
Very often I could verify that
SUM(X*Y) slower than DOT_PRODUCT(X,Y)
DOT_PRODUCT(X,X) slower than (blas) NRM2(X)
particularly when X and Y are expressions (probably
because in practice the optimisation is not so easy
in these cases ?)
Regards
--
+-----------------------------------+-----------------------------+
| Pierre Hugonnet | mail....CGG |
| | 1, rue Leon Migaux |
| Seismic Data Processing R&D | 91341 MASSY cedex |
| | FRANCE |
| COMPAGNIE GENERALE DE GEOPHYSIQUE | phone...(33/0) 164 47 45 59 |
| Massy processing center (France) | fax.....(33/0) 164 47 32 49 |
| http://www.cgg.com | [log in to unmask] |
+-----------------------------------+-----------------------------+
My opinions are not necessarily those of CGG
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|