nythrix's picture

[OpenCL] Possible bug at CL.CreateProgramWithBinary

Project:The Open Toolkit library
Category:bug report

I think these two signatures don't quite match. Note the
byte @char
const unsigned char **binaries
parameters. Shouldn't it be string[]?

public static IntPtr CreateProgramWithBinary( 
             IntPtr context, 
             int num_devices, 
             IntPtr* device_list, 
             IntPtr* lengths, 
             byte @char, 
             int* binary_status, 
             ErrorCode* errcode_ret );


cl_program clCreateProgramWithBinary (
             cl_context context,
             cl_uint num_devices,
             const cl_device_id *device_list,
             const size_t *lengths,
             const unsigned char **binaries,
             cl_int *binary_status,
             cl_int *errcode_ret)

If not then please consider enlightening me on this. Thank you.


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture


Status:open» confirmed

It seems that the converter is mis-parsing const unsigned char ** and is ignoring the "**" part. (CreateProgramWithSource takes a const char ** and is parsed correctly.)

I'll check this. For the time being I'd suggest adding a DllImport manually, with a #warning that this is a temporary workaround, until the issue is fixed.

the Fiddler's picture


Status:confirmed» fixed

Fixed in rev. 2410.

According to cl.h, the correct signature is byte** binaries, while the spec defines this as void** binaries. I'm following the first, as the intent is somewhat clearer and matches Assembly.Load from the BCL (byte arrays which contain binaries).

the Fiddler's picture


Version:0.9.x-dev» 1.0-beta-1
Status:fixed» closed

Closing issues fixed in 1.0 beta-1.