nythrix's picture

[OpenCL] Possible bug at CL.CreateProgramWithBinary

Project:The Open Toolkit library
Version:1.0-beta-1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

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

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

OpenCL:

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.


Comments

Comment viewing options

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

#1

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

#2

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

#3

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

Closing issues fixed in 1.0 beta-1.