OpenCL bindings

Lemonfiend lemon at fie.nd
Tue Mar 19 08:03:10 PDT 2013


On Tuesday, 19 March 2013 at 14:55:10 UTC, Mike Parker wrote:
> On Tuesday, 19 March 2013 at 14:30:19 UTC, Lemonfiend wrote:
>> Hi,
>>
>> I'm interested in updating the existing OpenCL bindings 
>> (https://github.com/Trass3r/cl4d) so they work with Derelict3, 
>> but have never undertaken such a task.
>> I'm not sure where/how to begin.
>>
>> Does anyone have any advice? :)
>
> Trass3r's binding is static, with a wrapper on top of it. Plus, 
> the binding (in the 'c' package) uses mixins to some end (just 
> gave it a cursory look, so not clear on the details). I don't 
> think there's anything to "update" here. It's a different 
> approach entirely than what I take with Derelict.

That's a shame.

> My advice is just to start from scratch. Look at the smaller 
> Derelict packages (DerelictAL, DerelictFT, DerelictGLFW3) for 
> the basic layout. I'm not familiar with the OpenCL API. Never 
> used it or looked at it, so I don't know if you'll need 
> something as more complex like the DerelictGL3 package. But the 
> basic idea is to put all type declarations in one module named 
> types.d, all function pointer alias and declarations in 
> functions.d, and then load everything up via a subclass of 
> SharedLibLoader in a module named appropriately for the binding 
> (in this case, cl.d would be a good choice, with 
> derelict.opencl as the package name).

I see. That's a larger project than I'd hoped. Considering I've 
never created a binding before, is there some kind of 
tutorial/recommended reading available?

> This is actually something I've wanted to get around to for a 
> long time. I'm busier than ever these days so I can't take it 
> on right now for sure. If you do decide to get busy on it, drop 
> by the Derelict forums[1] if you need any help. You could email 
> me, too, but I imagine that any advice I give you could be 
> useful for others wanting to work on a Derelictified binding.



More information about the Digitalmars-d-learn mailing list