From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1094ba,690ce1f62160d05a X-Google-Attributes: gid1094ba,public X-Google-Thread: 103376,690ce1f62160d05a X-Google-Attributes: gid103376,public X-Google-Thread: 1014db,690ce1f62160d05a X-Google-Attributes: gid1014db,public X-Google-Thread: 109fba,690ce1f62160d05a X-Google-Attributes: gid109fba,public From: Gautier Subject: Re: How to Design an Application Programmers' Interface (API) Date: 2000/08/11 Message-ID: <39943057.78926BBC@maths.unine.ch>#1/1 X-Deja-AN: 657222184 Content-Transfer-Encoding: 7bit References: <39921178.819F6DCB@netwood.net> <399386EF.4F2AA3E6@netwood.net> <39940E84.B3115EFC@maths.unine.ch> <3994158E.150D1FDA@netwood.net> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Trace: 11 Aug 2000 18:56:55 +0100, mac13-32.unine.ch Organization: Maths - Uni =?iso-8859-1?Q?Neuch=E2tel?= MIME-Version: 1.0 Newsgroups: comp.lang.c++,comp.lang.c,comp.lang.fortran,comp.lang.ada Date: 2000-08-11T00:00:00+00:00 List-Id: > 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