From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA01634; Tue, 30 Jul 2002 19:58:17 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA01650 for ; Tue, 30 Jul 2002 19:58:16 +0200 (MET DST) Received: from ext-nj2gw-3.online-age.net (ext-nj2gw-3.online-age.net [216.35.73.165]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g6UHwF910726 for ; Tue, 30 Jul 2002 19:58:15 +0200 (MET DST) Received: from int-nj2gw-4.online-age.net (int-nj2gw-4.online-age.net [3.159.236.68]) by ext-nj2gw-3.online-age.net (8.12.3/8.9.1/990426-RLH) with ESMTP id g6UHwDD8012280; Tue, 30 Jul 2002 13:58:13 -0400 (EDT) Received: from uswaumsxbhmedge.med.ge.com (localhost [127.0.0.1]) by int-nj2gw-4.online-age.net (8.12.3/8.12.3/990426-RLH) with ESMTP id g6UHw6LP002010; Tue, 30 Jul 2002 13:58:07 -0400 (EDT) Received: by amermsx.med.ge.com with Internet Mail Service (5.5.2656.59) id ; Tue, 30 Jul 2002 12:58:04 -0500 Message-ID: From: "Gurr, David (MED, self)" To: Travis Bemann , Nicolas Cannasse Cc: caml-list@inria.fr Subject: ocaml, simd, & fftwgel RE: [Caml-list] Caml productivity. Date: Tue, 30 Jul 2002 12:58:02 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2656.59) Content-Type: text/plain Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > 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