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 81010BBAF for ; Tue, 15 Dec 2009 17:20:52 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: As4BALNGJ0vRVdrkkGdsb2JhbACQJYF1ghWGUT8BAQEBCQkMBxMDiDKkUoExhWqIYwECAwWEJgQ X-IronPort-AV: E=Sophos;i="4.47,400,1257116400"; d="scan'208";a="42064087" Received: from mail-bw0-f228.google.com ([209.85.218.228]) by mail1-smtp-roc.national.inria.fr with ESMTP; 15 Dec 2009 17:20:52 +0100 Received: by bwz28 with SMTP id 28so34733bwz.17 for ; Tue, 15 Dec 2009 08:20:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=NMpgBZ8cn1zBhJH7O9oPgZtgfApQApIH1IEnYIdCtlo=; b=HmcdjqBJb20p2tjD/yU0TBSEgX+XLI97NrJT2sZ0g+dtr53CgXwzfGOsaW4yCg0vDe oMGc8ce4CQGvdH3t7m2SHJ3qD9VW0poqXmYZVupQtRW2kr6bIiBaS5t8/VXTf3yTSWTw +6nqpsb99kH6eOqMhXGWigE42R2QSl1Q+ljYs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=lQI2WdlUxh4gflqoP8wSwMpDmn2b54cIgmq2aij7R98SP44FRPyoZoPwl00kD/2HXn OLf/IqiWaHxOEE0rI/NhGviT8sbymg7og70AJsNZp6Ji/KaPV7IOLCWhtH/OUYR1iBpE FI7Sd7iheG1OVN8huYRnqzaUzl4xXTYmTsAL8= MIME-Version: 1.0 Received: by 10.204.152.27 with SMTP id e27mr3773719bkw.192.1260894051820; Tue, 15 Dec 2009 08:20:51 -0800 (PST) In-Reply-To: <4B27B442.9030300@starynkevitch.net> References: <320e992a0912150737t483a5946x9cad351fc344691f@mail.gmail.com> <4B27B442.9030300@starynkevitch.net> Date: Tue, 15 Dec 2009 18:20:51 +0200 Message-ID: <320e992a0912150820l4d36e4e0s24dc7cc084c9fc29@mail.gmail.com> Subject: Re: [Caml-list] How to write a CUDA kernel in ocaml? From: Eray Ozkural To: Basile STARYNKEVITCH Cc: caml-list@inria.fr, Emmanuel Chailloux Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; ocaml:01 eray:01 ozkural:01 basile:01 basile:01 eray:01 ozkural:01 bindings:01 ocaml:01 compiler:01 makefile:01 chailloux:01 compiler:01 bilkent:01 2009:98 On Tue, Dec 15, 2009 at 6:07 PM, Basile STARYNKEVITCH wrote: > Eray Ozkural wrote: >> >> Hello there, >> >> I've looked at the CUDA bindings for ocaml, but it seems the kernels >> were in C, am I right? How can I write the kernel in ocaml? I have an >> ocaml program that is badly in need of parallelization and it fits the >> NVIDIA architecture. If ocaml changes are required please explain to >> me a little, I have sufficient knowledge of compilers, I've worked on >> a commercial C-to-FPGA compiler project for 2 years. Of course it >> would be best if I can just handle it with a makefile :) > > You cannot do that today easily. > > The French OpenGPU project -funded by French public money > http://www.competitivite.gouv.fr/spip.php?article581 (in which I will be a > partner)- will start in january 2010 to deal with such issues (probably with > OpenCL, not CUDA). There won't be usable results soon (and I have no idea if > at end of the project, there will be a simple solution to your problem). > > You could try to help the OpenGPU partners involved. Ask Emmanuel Chailloux > (in CC). > > If you need today to call a CUDA kernel from Ocaml, you have to use C! It's great to hear such an effort, I will be following the developments. Of course OpenCL will be just as good. Pretty similar, anyway. I've seen some restrictions in OpenCL's C99 extension for compiling kernels, which is *not good* and might ultimately impair the implementation of a functional language. I don't see how one could think of putting any restrictions. We didn't have to invent any restrictions when compiling to hardware! At any rate, the obvious question from a compiler standpoint is, cannot we compile ocaml to C, is there a way to translate to C first and then to whatever works for kernel? I know little about the ocaml compiler so please forgive my naive questions. Best, -- Eray Ozkural, PhD candidate. Comp. Sci. Dept., Bilkent University, Ankara http://groups.yahoo.com/group/ai-philosophy http://myspace.com/arizanesil http://myspace.com/malfunct