caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Gurr, David (MED, self)" <David.Gurr@med.ge.com>
To: Travis Bemann <bemann@execpc.com>, Nicolas Cannasse <warplayer@free.fr>
Cc: caml-list@inria.fr
Subject: ocaml, simd, & fftwgel RE: [Caml-list] Caml productivity.
Date: Tue, 30 Jul 2002 12:58:02 -0500	[thread overview]
Message-ID: <D4DBD8568F05D511A1C20002A55C008C09C294EE@uswaumsx03medge.med.ge.com> (raw)




> From: Travis Bemann:
> On Mon, Jul 29, 2002 at 10:13:24AM +0200, Nicolas Cannasse wrote:
> > > I agree that the C interface is pretty nice. However,
> > > how do would you use SIMD math instructions on the
> > > x86? Would you always call C-routines just to make use
> > > of SIMD or multimedia-instructions? What is the
> > > overhead for calling a function that is executing a
> > > few assembly instructions? Is it even possible to
> > > create a solid division line between "low-level" and
> > > "high-level" code?
> >
> > Yes it is.
> > Actually if you need to perform alot of SIMD instructions each frame
> > (involving zounds of C calls), you can try to group them in 
> one-C-call that
> > will do the job in one time. That's matter of architecture 
> and choices...
> > not always obvious :)
> 
> Note that most C or C++ compilers won't do this either, with the
> exception of some specialized vector parallelizing compilers (such as
> those used to compile code on vector supercomputers).  If you really
> need SIMD instructions, you'd probably need to hand-code it in
> assembly, no matter what language you're using.

IMHO:

High performance numerical code esp using SIMD or multiprocessor is
beyond the reach of hand written assembly or hand written C.  Very
heavy template based C++ almost works but odds are you will run into
C++ compiler bugs.  The best thing known at the present are special
purpose optimizing compilers.  The best known of these is fftgen, the
compiler that underlies FFTW and it is written in ocaml.  Others like
it are Atlas and Spiral.  Of special note is a versions of FFTW that
generates SIMD code for AMD Athlons:
http://www.complang.tuwien.ac.at/skral/fftwgel.html
Perhaps Dr Kral could explain more about fftwgel and the merits of
writting 
high performance code using ocaml.

About memory allocation, real time code should not be doing memory
allocation in the real time section.  For many things that you need
to do in realtime, the ocaml code does not allocate so allocation
is not issue.  If you need allocation control, write a C allocator.
You lose some of the safety of ocaml but it is better than writting
the whole thing in C.  And there is the possiblity of GC-free functional
programming as done in MLKit4.  This is SML not ocaml.  I would imagine
that the technique could be used in ocaml.

-D 
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


             reply	other threads:[~2002-07-30 17:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-30 17:58 Gurr, David (MED, self) [this message]
2002-07-31  1:29 ` Travis Bemann
2002-07-31  8:09   ` Xavier Leroy
2002-07-31  8:39 ` Noel Welsh
2002-08-01 15:22 ` John Max Skaller
2002-08-01 15:36 Damien Doligez
2002-08-01 16:38 ` John Max Skaller
2002-08-01 16:55   ` Alexander V.Voinov
2002-08-01 16:45 ` Jonathan Coupe
2002-08-02  2:56 Gurr, David (MED, self)
2002-08-02  9:57 ` Noel Welsh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D4DBD8568F05D511A1C20002A55C008C09C294EE@uswaumsx03medge.med.ge.com \
    --to=david.gurr@med.ge.com \
    --cc=bemann@execpc.com \
    --cc=caml-list@inria.fr \
    --cc=warplayer@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).