octave-maintainers
[Top][All Lists]
Advanced

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

Re: conv2 performance


From: John W. Eaton
Subject: Re: conv2 performance
Date: Thu, 4 Mar 2010 11:30:00 -0500

On  4-Mar-2010, Jaroslav Hajek wrote:

| 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.

OK.  The {BEGIN,END}_INTERRUPT_IMMEDIATELY_IN_FOREIGN_CODE macros in
libcruft/misc/quit.h should make that somewhat easier.

| 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?

It doesn't matter to me whether it is sed, awk, or m4.  But it might
be better to put your actual source code in the archive along with the
script so that if someone has to modify the sources later, they don't
have to do it N times, or write their own script.  That's one reason
that it seems better to me to use C++ templates in a case like this.

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

I'm not saying don't ever do it, but I would prefer to avoid adding
more Fortran code to Octave unless there is some good reason to do
so.

jwe


reply via email to

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