On Tue, 09 Mar 1999 11:34:24 +0100 Pierre Hugonnet <[log in to unmask]>
wrote:
> Dan Nagle wrote:
> >
> > Hello,
> >
> > Pierre Hugonnet wrote:
> > >
> > <snip requoted material>
> > >
> > > if I declare two arrays:
> > >
> > > REAL(selected_real_kind(12)) :: a(n), b(n)
> > >
> > > I want to compute their dot product using BLAS routines: which
> > > one should I call: SDOT or DDOT ??
> >
> > I think the real solution here is to request that the library
> > supplier produce a Fortran 90/95 version of the library, with
> > interfaces so that the programmer simply calls "DOT()",
> > and the compiler does the Right Thing.
> >
>
> probably you're living in a perfect world... :-)
>
> The compiler vendors could of course provide this kind
> of interface with the libraries they support (even if I've never
> seen something like that), but what about
> the many free libraries, and the libraries you write yourself?
> This kind of interface is processor-dependant (one version of the
> routine for each kind value supplied by the compiler), so that it
> becomes very difficult to design a machine-independant library by
> using SELECTED_REAL_KIND. From this point of view SELECTED_REAL_KIND
> is in fact less portable than REAL and DOUBLE PRECISION!
True! but only to some extent. I would expect machine vendors to supply
libraries for all precisions available on their systems. By now I would also
expect them to provide generic interfaces to such libraries. In such cases
you should be able to use kind portably. If you are a portable library
provider I would expect it to be provided generic over REAL and DOUBLE
PRECISION. You could then use kind to portably select which was need for your
program. If your program needs precision not provided by one of these then it
is inherently non-portable since the standard only mandates these two
precisions.
However, there is a deficiency with the KIND mechanism. There is no way of
even at compile time to inquire on the number of available precisions. If
there were and a macro expander was available such as ccp, it would be
possible to generate generic code for each available precision. At least I
think it would. WG5 might like to think about this!
>
>
> Best Regards
>
>
>
> --
> +-----------------------------------+----------------------------+
> | Pierre Hugonnet | mail....CGG |
> | | 1, rue Leon Migaux |
> | Seismic Data Processing R&D | 91341 MASSY cedex |
> | | FRANCE |
> | COMPAGNIE GENERALE DE GEOPHYSIQUE | phone...(33) 164 47 45 59 |
> | Massy processing centre (France) | fax.....(33) 164 47 32 49 |
> | http://www.cgg.com | [log in to unmask] |
> +-----------------------------------+----------------------------+
> My opinions are not necessarily those of CGG
> --------------------------------------------------------------------------------
--
Lawrie Schonfelder
Director, Computing Services Dept.
The University of Liverpool, UK, L69 7ZF
Phone: 44(151)794 3716, Fax: 44(151)794 3759
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|