[Haskell-cafe] ANN: OpenCL package

Jason Dagit dagitj at gmail.com
Fri Oct 14 01:17:12 CEST 2011

On Thu, Oct 13, 2011 at 12:34 PM, Martin Dybdal <dybber at dybber.dk> wrote:
> On 3 October 2011 12:56, Luis Cabellos <cabellos at ifca.unican.es> wrote:
>> Hello, all.
>> I want to show you the OpenCL package. I have done this using Jeff Heard
>> OpenCLRaw package, but I create a new one due the lack of updates of the
>> former.
>> # Where to get it
>> * Hackage page (http://hackage.haskell.org/package/OpenCL)
>> * Repository (https://github.com/zhensydow/opencl)
>> * Bugs (https://github.com/zhensydow/opencl/issues)
>> * Examples (https://github.com/zhensydow/opencl/tree/master/examples).
>> # Things:
>> * I write it's high-level binding to OpenCL libraries, but only because I
>> added more types to hide most of the alloc/free of the API, and hide the
>> enums using c2hs enums.
>> * The worst problem of the OpenCLRaw is the bad types it use, I learn to fix
>> 32/64 bits issues with c2hs, and test it on linux machines.
>> * Tested on Linux + NVidia only.
>> * Jason Dagit is helping with Windows, OSX testing in own fork, also the
>> call-conv fork in github has changes to work on Windows
>> Please, Consider it's on experimental status but it works, I need lots of
>> feedbacks for detect posible errors,
>> Thanks,
> Hi everyone
> I just found this thread today, as I don't read Haskell-cafe that
> often (too bad, I know). I have been working on a set of OpenCL
> bindings for the last months myself, which I'm using to implement an
> OpenCL backend to the Data.Array.Accelerate library. The work is done
> at the HIPERFIT research center, Uni. Copenhagen.
> My bindings are even further from the naming conventions of the OpenCL
> library, but I really can't see the problem with that. People which
> are used to programming OpenCL from C/C++ might have to learn how the
> naming conventions of the Haskell library are, but they only need to
> do this once. When the mapping between the old and the new naming
> conventions are learned, they will benefit from having a more clean
> interface for all future times. (No Haskell hacker should have a
> problem with a steep learning curve.)
> It is somewhat troubling that we now have five different interfaces to
> OpenCL (that I know of), and I think we should join efforts and make
> one library that is as stable as possible. The five libraries are:
>  * OpenCL
>  * OpenCLRaw
>  * HsOpenCL
>  * hopencl
>  * The library presented by Benedict Gaster at AMD (yet to be released)
>  ( http://developer.amd.com/zones/OpenCLZone/publications/assets/MakingOpenCLSimplewithHaskell.pdf
> )
> My own library is available at https://github.com/HIPERFIT/hopencl and
> will be released on hackage very soon (next week probably). Please
> take a look at it. It is currently tested on x86_64 Linux with both
> the AMD x86/x86_64 bindings and NVIDIAs CUDA bindings. They will
> probably not work on Windows in their present state, and I don't have
> access to a Windows machine to test it on.

Windows uses stdcall instead of ccall.  If you get that right, your
bindings are likely to "just work".


More information about the Haskell-Cafe mailing list