octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: conv2 performance


From: Jaroslav Hajek
Subject: Re: conv2 performance
Date: Thu, 4 Mar 2010 07:11:24 +0100

On Wed, Mar 3, 2010 at 9:30 PM, John W. Eaton <address@hidden> wrote:
> On  3-Mar-2010, Jaroslav Hajek wrote:
>
> | On Wed, Mar 3, 2010 at 7:28 PM, Michael D. Godfrey
> | <address@hidden> wrote:
> | > Jaroslav,
> | >
> | > Here is what I got for 3 runs using the matlab shown
> | > below, and following are 3 runs on the same machine
> | > (Linux qss.stanford.edu 2.6.31.12-174.2.3.fc12.x86_64 #1 SMP Mon Jan 18
> | > 19:52:07 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux)
> | > using your latest patches as of today (3 March).
> | >
> |
> | Incl. this one, I suppose:
> | http://hg.savannah.gnu.org/hgweb/octave/rev/5af0b4bb384d
>
> Is there a particular reason to use Fortran for this with several
> essentially repeated functions instead of a C++ template?  I know the
> BLAS routines are unique functions, but couldn't they be handled as
> template parameters, similar to the way we handle the mapping
> functions in the Array<T>::map methods?
>
> jwe
>

The main problem with calling BLAS functions repeatedly in a loop from
C++ is that the F77_XFCN macro involves a nontrivial setup to make the
computation breakable. If you want to avoid that setup repeatedly
(which I do), you'd need to use F77_FCN and
do the interrupt and error handling explicitly outside the loop or
just code the innermost loops in Fortran side and call that with
F77_XFCN.

Besides that, when >2D arrays are involved, Fortran handles that more
naturally than C's pointer arithmetics (yet usually equally
efficiently).

The only problem is that in Fortran you typically need to duplicate
the code for each type; I have sed scripts for that, so it's usually
little problem for me, but maybe it would be better if I used m4
instead?

And lastly, I like coding in Fortran. Is it a problem having Fortran
stuff in Octave?

-- 
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz



reply via email to

[Prev in Thread] Current Thread [Next in Thread]