comp.lang.ada
 help / color / mirror / Atom feed
From: Gautier <gautier.demontmollin@maths.unine.ch>
Subject: Re: How to Design an Application Programmers' Interface (API)
Date: 2000/08/11
Date: 2000-08-11T00:00:00+00:00	[thread overview]
Message-ID: <39943057.78926BBC@maths.unine.ch> (raw)
In-Reply-To: 3994158E.150D1FDA@netwood.net

> Gautier wrote:
> > You may take a look to the Ada95 binding to BLAS :
> >   http://topo.math.u-psud.fr/~sands/BLAS/

E. Robert Tisdale:

> These thin interfaces to another language binding are called adapters.
> You have implemented a very nice adapter but I'm not sure why.

I fear you haven't noticed that it is not my work at all...

> Your adapter isn't really any more useful to Ada application programmers
> than the Fortran 77 language binding is to Fortran application programmers.
> Is it meant to help programmers implement linear algebra packages in Ada
> for Ada numerical application programmers to use?

It seems.

> I think that Ada numerical application programmers should be able to write

>     C := alpha*product(A, B) + beta*C;

> and let the compiler resolve the expression to a DGEMM procedure call.

For scalar things or usage with small vectors or matrices as output of
functions I would do so. For bigger structures the procedure is better
- no temporary object in expressions. In my own (partial) bindings I have
both approaches.

> Calling DGEMM directly from an Ada application program
> abrogates all of the safety feature built into the Ada language.

It depends on the ratio of BLAS/LAPACK calls in the Ada code. For my
finite element program the "adapter" fits: there are a few calls that
separates well the 1960s programming models to my year 2000 sources...
It firewalls efficiently the weak-typing headaches and I can add
degrees of complexity with joy and decontraction...
 
Anyway you can wrap the adapter into some "Multiply" etc. procedures -
as well as "*" etc. functions.

> Take a look at the Ada95 Matrix Package
>
>     http://dflwww.ece.drexel.edu/research/ada/
> 
> Chris Papademetrious, Xiaoxun Zhu, Moshe Kam had the right idea
> but the wrong Abstract Data Type.
> An Ada95 Matrix Package should support strided views (slices)
> of existing arrays of numbers like every other high performance
> matrix library developed over the last 50 years.
> The actual details of allocating and deallocating memory
> for array storage may vary slightly from one language binding to the next.

Seems very elegant, but it might be not very efficient
- functional-only, and things like "RESULT := (others => (others => 0.0));"
I don't know of a compiler that just zeroes rapidly RESULT (also
a temp. variable BTW)...

Regards
______________________________________________________
Gautier  --  http://members.xoom.com/gdemont/gsoft.htm




  parent reply	other threads:[~2000-08-11  0:00 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-08-10  0:00 How to Design an Application Programmers' Interface (API) E. Robert Tisdale
2000-08-10  0:00 ` Jack Klein
2000-08-10  0:00 ` Kaz Kylheku
2000-08-10  0:00   ` E. Robert Tisdale
2000-08-10  0:00     ` vrml3d.com
2000-08-10  0:00       ` Tony T. Warnock
2000-08-10  0:00         ` Keith Thompson
2000-08-10  0:00           ` E. Robert Tisdale
2000-08-10  0:00             ` Keith Thompson
2000-08-10  0:00               ` E. Robert Tisdale
2000-08-10  0:00                 ` Keith Thompson
2000-08-11  0:00                   ` David Botton
2000-08-11  0:00                 ` David Gillon
2000-08-11  0:00                   ` Peter S. Shenkin
2000-08-10  0:00         ` Toon Moene
2000-08-10  0:00       ` E. Robert Tisdale
2000-08-11  0:00 ` E. Robert Tisdale
2000-08-11  0:00   ` Gautier
2000-08-11  0:00     ` E. Robert Tisdale
2000-08-11  0:00       ` Interfacing to Numerical Programming libraries (was: How to Design..) Larry Kilgallen
2000-08-12  0:00         ` Sam Hobbs
2000-08-12  0:00         ` E. Robert Tisdale
2000-08-12  0:00           ` tmoran
2000-08-12  0:00             ` E. Robert Tisdale
2000-08-11  0:00       ` Gautier [this message]
2000-08-11  0:00         ` How to Design an Application Programmers' Interface (API) E. Robert Tisdale
2000-08-11  0:00   ` Larry Kilgallen
2000-08-11  0:00     ` E. Robert Tisdale
2000-08-11  0:00       ` Larry Kilgallen
2000-08-11  0:00         ` E. Robert Tisdale
2000-08-13  0:00   ` E. Robert Tisdale
2000-08-13  0:00     ` Gregory Pietsch
2000-08-13  0:00       ` E. Robert Tisdale
2000-08-13  0:00         ` Gregory Pietsch
2000-08-13  0:00           ` E. Robert Tisdale
2000-08-13  0:00         ` Larry Kilgallen
2000-08-13  0:00         ` Brendan Sechter
2000-08-13  0:00     ` Larry Kilgallen
replies disabled

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