OpenCL-Docs icon indicating copy to clipboard operation
OpenCL-Docs copied to clipboard

Add automatic checks of the XML to the CI

Open kpet opened this issue 2 years ago • 1 comments

  • [ ] Land https://github.com/KhronosGroup/OpenCL-Docs/pull/730
  • [ ] Validate enum names as suggested on https://github.com/KhronosGroup/OpenCL-Docs/pull/958#discussion_r1287531479
  • [ ] Check header generation
  • [ ] etc

kpet avatar Aug 09 '23 10:08 kpet

Surprisingly, my bindings were packing just fine even without my suggestion in #958. I only got a couple of new warnings in the log: "cl_ prefix missing" and "enum wasn't used" - then it got filtered out and couldn't affect anything further.

I can suggest dozens of small sanity checks (like having valid prefixes/suffixes) which I already do when parsing XML from this repo + a few more complicated ones when code-generating my bindings. But I'm not sure how appropriate it would be to check all the little things in this repo's tests. It might just make creating pulls less convenient, because when there are many small checks - some of them would inevitably give false negatives once in a while.

Off the top of my head, I can only think of one thing that would be great to check: vendor names/suffixes. For instance, in some places capitalization of ARM is inconsistent:

    <enums name="cl_arm_svm_alloc.flags" vendor="ARM" type="bitmask">

vs

    <enums name="cl_command_termination_reason_arm" vendor="Arm">

For my sanity checks I also made this table, so I can automatically determine that, for instance, IMG in CL_MIPMAP_FILTER_ANY_IMG refers to a vendor, rather than being part of the name. That table is good enough for what I'm doing, but not really good enough to add to XML as is. Some vendor names/suffixes are missing. Would probably also help to add some annotation for each vendor. But I don't know many of those vendors well enough.

SunSerega avatar Aug 10 '23 13:08 SunSerega