From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id D49E2BC57 for ; Fri, 19 Nov 2010 16:58:13 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnoDAM4t5kzZSMDjgmdsb2JhbACiXBUBAQsLCBoDH706hUsEjWmIDA X-IronPort-AV: E=Sophos;i="4.59,223,1288566000"; d="scan'208";a="88754500" Received: from fmmailgate02.web.de ([217.72.192.227]) by mail1-smtp-roc.national.inria.fr with ESMTP; 19 Nov 2010 16:58:04 +0100 Received: from smtp06.web.de ( [172.20.5.172]) by fmmailgate02.web.de (Postfix) with ESMTP id 56AD3184FB3B5; Fri, 19 Nov 2010 16:58:03 +0100 (CET) Received: from [78.43.204.177] (helo=frosties.localdomain) by smtp06.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #24) id 1PJTLf-0005L4-00; Fri, 19 Nov 2010 16:58:03 +0100 Received: from mrvn by frosties.localdomain with local (Exim 4.72) (envelope-from ) id 1PJTLe-0000A3-Qh; Fri, 19 Nov 2010 16:58:02 +0100 From: Goswin von Brederlow To: Christophe TROESTLER Cc: Christophe Raffalli , caml-list@yquem.inria.fr Subject: Re: [Caml-list] SMP multithreading References: <8762vwdx09.fsf@frosties.localnet> <4CE46063.5080703@univ-savoie.fr> <20101119.100131.1002056833324939968.Christophe.Troestler+ocaml@umons.ac.be> Date: Fri, 19 Nov 2010 16:58:02 +0100 In-Reply-To: <20101119.100131.1002056833324939968.Christophe.Troestler+ocaml@umons.ac.be> (Christophe TROESTLER's message of "Fri, 19 Nov 2010 10:01:31 +0100 (CET)") Message-ID: <87pqu1l305.fsf@frosties.localnet> User-Agent: Gnus/5.110009 (No Gnus v0.9) XEmacs/21.4.22 (linux, no MULE) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: goswin-v-b@web.de X-Sender: goswin-v-b@web.de X-Provags-ID: V01U2FsdGVkX1/B9CC7UP1nzXGN2UqLhIsJYWJs3ISDbKF7reO9 RWWMcW91if+mcfo2GIi71vFLEp11NxcZ49N/yGSmjhmX2021Px e42iwUeFE= X-Spam: no; 0.00; christophe:01 troestler:01 christophe:01 troestler:01 ocaml:01 0100,:01 raffalli:01 ocaml:01 lapack:01 stubs:01 lapack:01 bigarray:01 mfg:98 threads:01 threads:01 Christophe TROESTLER writes: > On Thu, 18 Nov 2010 00:08:19 +0100, Christophe Raffalli wrote: >> >> And OCaml on GPU ? We just tested a recent GPU card with 480 >> processors at 900Mhz ... this is qui impressive ... and supported by >> matlab via cuda-lapack (http://www.culatools.com/) ... I imagine we >> could at least use cuda-lapack from OCaml ? > > This is certainly possible since they say that the standard LAPACK > functions are available. If you try, let us know! > > Best, > C. And the functions should enter/leave_blocking_section() in the C stubs so you can have 480 ocaml threads. All of them can run some lapack code while always only one can run ocaml code at any one time. If the lapack functions take long enough almost all threads will be running. This is actually a quick way to use multiple cores with ocaml. Find a often called function that takes considerable time and offload it to C with enter/leave_blocking_section() around it. Isn't always possible and you need to use BigArray for data or copy the arguments. MfG Goswin