Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
SMP multithreading
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-11-19 (15:58)
From: Goswin von Brederlow <goswin-v-b@w...>
Subject: Re: [Caml-list] SMP multithreading
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 ( ...  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.