[Haskell-cafe] ANN: OpenCL package

Jason Dagit dagitj at gmail.com
Mon Oct 3 18:04:25 CEST 2011

On Mon, Oct 3, 2011 at 3:56 AM, 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

Your bindings are a higher quality than the the OpenCLRaw bindings and
you're doing good technical work, but I stopped using your bindings
for a couple reasons:
  * The main reason is that I'm not comfortable with the license
you're using.  The original code by Jeff Heard was BSD3 with an
additional copyright notice.  Your code is AGPL3.  The GPL is known to
cause problems with Haskell code due to cross module inlining.  I
don't know how the "A" in AGPL changes things.
  * Some of the exposed function names have been changed from the
original name in the OpenCL specification.  This is the same thing
that was done with the OpenGL bindings and it is very confusing for
people who come to the Haskell bindings from the official
documentation.  I realize that some of the API functions require some
bit of name mangling, but I think the current way is not the right
way.  For example with this function:

We could have a different version of the function for each return
type, clGetDeviceInfo_FPConfig, clGetDeviceInfo_AddressBits, etc.
It's a great naming convention but it has the property that someone
searching the bindings or the bindings' haddocks for clGetDeviceInfo
will find those functions.  I think this is better than naming it
clGetDeviceExtensions, which is not in the OpenCL specification.

I'd still be willing to test the changes you have, I just don't want
to contribute to your bindings due to the license.  I currently
thinking of starting my own bindings (Jeff's bindings contain too many
small bugs and if I'm going to change most lines of code then I might
as well start from scratch so that it can have a standard BSD3


More information about the Haskell-Cafe mailing list