KhronosGroup / OpenCL-Headers

Khronos OpenCL-Headers
Apache License 2.0
666 stars 236 forks source link

clEnqueueWriteHostPipeINTEL XML discrepancy #221

Closed bashbaug closed 1 year ago

bashbaug commented 1 year ago

Related to PR #220, sorry I didn't notice this before merging...

The code in the headers for clEnqueueWriteHostPipeINTEL is now: https://github.com/KhronosGroup/OpenCL-Headers/blob/e3e85862d6905eba9f4b5ed02c52effe673721d3/CL/cl_ext.h#L2548

extern CL_API_ENTRY cl_int CL_API_CALL
clEnqueueWriteHostPipeINTEL(
            cl_command_queue command_queue,
            cl_program program,
            const char* pipe_symbol,
            cl_bool blocking_write,
            void* ptr,
            size_t size,
            cl_uint num_events_in_wait_list,
            const cl_event* event_wait_list,
            cl_event* event) CL_API_SUFFIX__VERSION_1_0;

In the XML file it is: https://github.com/KhronosGroup/OpenCL-Docs/blob/28bd8e10eaf66fc1c01c6156bb270f94f1a69c3c/xml/cl.xml#L4178

        <command>
            <proto><type>cl_int</type>              <name>clEnqueueWriteHostPipeINTEL</name></proto>
            <param><type>cl_command_queue</type>    <name>command_queue</name></param>
            <param><type>cl_program</type>          <name>program</name></param>
            <param>const <type>char</type>*         <name>pipe_symbol</name></param>
            <param><type>cl_bool</type>             <name>blocking_write</name></param>
            <param>const <type>void</type>*               <name>ptr</name></param>
            <param><type>size_t</type>              <name>size</name></param>
            <param><type>cl_uint</type>             <name>num_events_in_wait_list</name></param>
            <param>const <type>cl_event</type>*     <name>event_wait_list</name></param>
            <param><type>cl_event</type>*           <name>event</name></param>
        </command>

Note that the ptr is const in the XML file and non-const in the headers. I think const is correct, and hence these headers should be updated and not the XML file, but regardless they should be kept in sync. Let me know what you'd like to do - thanks!

CC: @zibaiwan

PS: We really need to enable code generation for the headers to avoid issues like these!

bashbaug commented 1 year ago

If the pointer should really be const we can merge #222 and we should be all set - thanks!

zibaiwan commented 1 year ago

Thanks @bashbaug for catching this. Yes it indeed should be a constant pointer. I have fixed the doc to reflect that. Please merge #222.

bashbaug commented 1 year ago

Fixed by #222, closing. Thanks for the prompt responses!