KhronosGroup / OpenCL-Docs

OpenCL API, OpenCL C, Extensions, SPIR-V Environment Specs, Ref page, and C++ for OpenCL doc sources.
Other
356 stars 113 forks source link

XML Representation for Vendor Extensions Promoted to KHR Extensions #431

Open bashbaug opened 4 years ago

bashbaug commented 4 years ago

There are a couple of places in the XML file where an enum block has been allocated for a vendor, then the vendor extension has been promoted to a KHR extension that reused the vendor extension enum values. For example:

    <enums start="0x4010" end="0x402F" name="enums.4010" vendor="NVIDIA" comment="Per Bug 5782">
        <enum value="0x4010"        name="CL_D3D10_DEVICE_KHR"/>
        <enum value="0x4011"        name="CL_D3D10_DXGI_ADAPTER_KHR"/>
        <enum value="0x4012"        name="CL_PREFERRED_DEVICES_FOR_D3D10_KHR"/>
        ....

Some of the spec scripting was looking for KHR enums by parsing the vendor and was hence skipping these blocks. Should we handle this case by:

oddhack commented 4 years ago

The direct way is looking for the 'KHR' suffix'. In part what you're running into here is that CL hasn't bought into the XML framework all the way. If the \ tags are kept up to date, you could traverse them for 'cl_khr' extensions looking for the required \ tags, and that gets you all the enums belonging to a khr extension.

The 'alias' attribute is used in the Vulkan XML to represent this relationship.