comp.lang.ada
 help / color / mirror / Atom feed
From: Duncan Sands <sands@topo.math.u-psud.fr>
To: Gautier <gautier.demontmollin@maths.unine.ch>
Subject: BLAS
Date: 2000/05/12
Date: 2000-05-12T16:01:02+00:00	[thread overview]
Message-ID: <E12qHFV-00005Z-00@Baldrick> (raw)
In-Reply-To: 391BC1F5.DFB47045@maths.unine.ch

Gautier wrote:

> Duncan wrote:
>
> > How important do you think it is to keep Ada 83 compatibility?
> 
> Maybe because some Ada83 can be more efficient than their Ada 95
> replacements. I did not install GNAT on OpenVMS to compare with the
> DEC Ada I'm using, but the latter really rocks; I doubt GNAT can
> be as good as DEC Ada. But globally an Ada95 solution using
> Interfaces.Fortran is preferable. It would be also preferable
> to have the best sort of Ada 95 for each platform with the in-house
> code generator, with  e.g. a Lahey Ada95, a DEC Ada 95, a Fujitsu
> Ada 95, but -hum- it's rather a wish...
>
> In fact what is missing is an extensive comparison among
> compilers on each platforms, including Ada and Fortran
> compilers!

While gcc (C version) does a good job on all platforms, it can certainly
be beaten by C compilers tailored for the platform.  Since GNAT can't do
better than gcc, your remarks about DEC Ada aren't surprising; there must
be many other examples.  It is true that a systematic compiler comparison
would be interesting.

> So, my answer is: not important!
> 
> BTW I've pushed the remaining "DEC Ada" people at DEC to
> include some 95 extensions like
>   "Ada.Numerics.Generic_elementary_functions = Math_lib"
>   "Ada.Numerics.Elementary_functions = Float_math_lib"
> and so on. But they would push towards GNAT and are pushed towards
> the exit door... Anyway there is a bit of effort on that
> side (some improvements in the library, 95esque iirc).

I'm glad it's not important, because I plan to make the binding even
more Ada 95'ish, using child packages as follows:

Ada_Blas <- non generic package defining exceptions and other common stuff
Ada_Blas.Real <- real blas
Ada_Blas.Complex <- complex blas

By the way, I'm in two minds as to whether the Matrix and Vector types
should be defined in the package or passed as generic parameters.  It
would be nice to be able to pass them in.  The problem with generic
parameters is that I don't see how to pass in an array type of Float_Type'Base:

generic
   type Float_Type is digits <>;
   type Matrix is array (Integer range <>, Integer range <>) of Float_Type'Base;

is rejected by GNAT.  I would like to do

generic
   type Float_Type is digits <>;
   type Base_Type is new Float_Type'Base;
   type Matrix is array (Integer range <>, Integer range <>) of Base_Type;

but there are two problems with this:
(1) GNAT seems to have a bug in this area.
(2) Base_Type could have a range restriction.  Eg if I defined
type Base is new Float_Type'Base range 0.0 .. 1.0;
then this is fine for passing as the Base_Type parameter.  The
problem is that the Fortran procedures aren't going to respect the
range constraints, so after performing operations you may obtain
vectors/matrices with invalid components.  You could then check
(with the 'Valid attribute) if all components are ok, but this
would introduce heavy overheads.  Not checking is not in keeping
with the Ada philosophy!  By the way, I want Float_Type'Base because
it has no range constraints (cf Ada.Numerics.Generic_Elementary_Functions).

Any thoughts?

Duncan.







       reply	other threads:[~2000-05-12  0:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <391BC1F5.DFB47045@maths.unine.ch>
2000-05-12  0:00 ` Duncan Sands [this message]
2000-05-12  0:00   ` BLAS Robert A Duff
2000-05-12  0:00   ` BLAS Gautier
2000-05-13  0:00   ` BLAS Robert Dewar
2000-05-13  0:00   ` BLAS Larry Kilgallen
2000-05-14  0:00     ` BLAS Gautier
2000-05-15  0:00       ` BLAS Gisle S�lensminde
2000-05-15  0:00       ` BLAS Larry Kilgallen
2000-05-15  0:00         ` BLAS Gisle S�lensminde
2000-05-15  0:00 BLAS Duncan Sands
2000-05-15  0:00 ` BLAS Robert A Duff
2000-05-15  0:00   ` BLAS Robert Dewar
2000-05-16  0:00     ` BLAS Robert A Duff
2000-05-17  0:00       ` BLAS Robert Dewar
2000-05-17  0:00         ` BLAS Robert A Duff
2000-05-18  0:00           ` BLAS Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
2000-05-12  0:00 BLAS Duncan Sands
2000-05-12  0:00 ` BLAS Gautier
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox