Repository navigation
Conversation
Adds an optional 'group' attribute to <enum> definitions in cl.xml,
following the gl.xml convention: each token names the C value-set
type(s) it belongs to (comma-separated for multi-role tokens). The
RNC schema is extended with 'attribute group { text } ?' on enums.
Attributions were derived from the OpenCL core and extension
specifications (cross-checked against the Khronos registry chapters
and cl.xml's own containers), not from container names alone.
Changes xml/cl.xml and xml/registry.rnc only; generated headers are
byte-identical (the attribute is metadata no current generator reads).
bashbaug
left a comment
There was a problem hiding this comment.
Thanks for doing this! Mostly LGTM, but here are a few things I would check.
The biggest question IMHO is what to do when a type / "group" starts as an extension and get promoted to a core feature, or moves from one extension type to another (e.g. vendor -> ext -> khr).
| <enum value="0x0" name="CL_COMPLETE" group="clCommandExecutionStatus"/> | ||
| <enum value="0x1" name="CL_RUNNING" group="clCommandExecutionStatus"/> | ||
| <enum value="0x2" name="CL_SUBMITTED" group="clCommandExecutionStatus"/> | ||
| <enum value="0x3" name="CL_QUEUED" group="clCommandExecutionStatus"/> |
There was a problem hiding this comment.
It's a little strange that we don't name a type for this. Should we? Regardless, clCommandExecutionStatus looks a lot more like an API function name than a type name, so we might want to consider something different for it. Maybe just CommandExecutionStatus?
There was a problem hiding this comment.
Do we want to add a typedef cl_int cl_command_execution_status?
I agree with the above suggestion in the meantime.
There was a problem hiding this comment.
When I changed the name of the group to CommandExecutionStatus I did not notice that the enum carries a name of clCommandExecutionStatus.
<enums name="clCommandExecutionStatus" vendor="Khronos">Also we need to update CL_ECC_RECOVERED_IMG which for now carries clCommandExecutionStatus for a group.
@bashbaug what is your take on this? I am worried that changing the name field above might lead to problems for project that were relying on it.
There was a problem hiding this comment.
I don't think I have a perfect answer, but here are a few options to consider:
-
Rename the enum name and group to
cl_command_execution_status. This seems like the right thing to do with the benefit of hindsight. If we can convince ourselves that there is no problem actually adding the type (as you suggested above), then we can do so, but even if not I think this is the right name for the group. -
Rename the enum name and group to
CommandExecutionStatusso it doesn't look like an API name or an official type name. We wouldn't add a typedef if we did this. -
Don't consider these enums part of any group (note that
CL_COMMAND_EXECUTION_STATUSjust returns acl_int). I suspect this was probably done because the "command execution status" can also be an error code if the command is abnormally terminated.- Note, at some point in the future, maybe we should name error codes and address the command execution status at the same time - I think one of these PRs proposed doing something like this - but this would be a much bigger change.
-
Just stick with
clCommandExecutionStatusfor now. It's a little weird, but we've been living with it, and we may as well stick with it if we aren't sure what a better name is.
There was a problem hiding this comment.
4 seems reasonable to me, We'd need to revert one of the suggestions I merged, but that seems rather straightforward.
| <enums name="cl_arm_svm_alloc.flags" vendor="Arm" type="bitmask"> | ||
| <enum bitpos="10" name="CL_MEM_SVM_FINE_GRAIN_BUFFER_ARM"/> | ||
| <enum bitpos="11" name="CL_MEM_SVM_ATOMICS_ARM"/> | ||
| <enum bitpos="10" name="CL_MEM_SVM_FINE_GRAIN_BUFFER_ARM" group="cl_arm_svm_alloc.flags"/> | ||
| <enum bitpos="11" name="CL_MEM_SVM_ATOMICS_ARM" group="cl_arm_svm_alloc.flags"/> |
There was a problem hiding this comment.
Likewise, these should probably be cl_svm_mem_flags_arm.
There was a problem hiding this comment.
Thanks for catching this one. Other SVM flags that were accepted by the clSVMAllocARM should maby get cl_svm_mem_flags_arm a second tag, what do you think?
| <enum value="0x1093" name="CL_QUEUE_PROPERTIES" group="cl_command_queue_info,cl_queue_properties,cl_queue_properties_khr"/> | ||
| <enum value="0x1094" name="CL_QUEUE_SIZE" group="cl_command_queue_info,cl_queue_properties,cl_queue_properties_khr"/> |
There was a problem hiding this comment.
It's a little confusing to me to list both cl_queue_properties and cl_queue_properties_khr here, but I do think this is correct. As a consideration for the future, if we ever do another extension like cl_khr_create_command_queue, are there things we should do differently that would be less confusing? Could we reuse the cl_queue_properties type, for example?
There was a problem hiding this comment.
In this instance, the WithProperties API appeared first in an extension, and the type with it, so I am unsure how to get around this particular sequencing.
Thanks for looking through it, and catching all those things I missed.
Good question. I would prioritize the approach that would help type safety when creating bindings from the xml file, since I believe this is the main benefit from these changes. |
Co-authored-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
| <enum value="0x1112" name="CL_IMAGE_ROW_PITCH" group="cl_image_info"/> | ||
| <enum value="0x1113" name="CL_IMAGE_SLICE_PITCH" group="cl_image_info"/> |
There was a problem hiding this comment.
| <enum value="0x1112" name="CL_IMAGE_ROW_PITCH" group="cl_image_info"/> | |
| <enum value="0x1113" name="CL_IMAGE_SLICE_PITCH" group="cl_image_info"/> | |
| <enum value="0x1112" name="CL_IMAGE_ROW_PITCH" group="cl_image_info,cl_image_pitch_info_qcom"/> | |
| <enum value="0x1113" name="CL_IMAGE_SLICE_PITCH" group="cl_image_info,cl_image_pitch_info_qcom"/> |
@bashbaug I think this is also correct, and was proposed by earlier attempts at doing this.
…istry branch Brice opened KhronosGroup#1636 from the (squashed) registry branch and applied 13-line review fixes via web UI (bashbaug + Kerilk reviews, 2026-10-20). This branch now carries the identical cl.xml and updated overrides/self-tests so re-running the engine cannot revert them: - CL_QUEUE_FAMILY_MAX_NAME_SIZE_INTEL: group REMOVED (misc API constant) - CL_LAYER_API_VERSION_100: cl_layer_info -> cl_layer_api_version - CL_COMPLETE/RUNNING/SUBMITTED/QUEUED: clCommandExecutionStatus -> CommandExecutionStatus (reads as a type, not a function) - CL_MIGRATE_MEM_OBJECT_HOST_EXT: cl_mem_migration_flags -> cl_mem_migration_flags_ext (the actual EXT param type) - 4x CL_DEVICE_SVM_*_ARM -> cl_device_svm_capabilities_arm - 2x CL_MEM_SVM_*_ARM -> cl_svm_mem_flags_arm Battery: 319 overrides, 85/85 self-tests, XML valid, 1334/1334 agree, cl.xml byte-identical to registry tip 03eabf3 (round-trip proof).
Adds an optional 'group' attribute to definitions in cl.xml, following the gl.xml convention: each token names the C value-set type(s) it belongs to (comma-separated for multi-role tokens). The RNC schema is extended with 'attribute group { text } ?' on enums.
Attributions were derived from the OpenCL core and extension specifications (cross-checked against the Khronos registry chapters and cl.xml's own containers), not from container names alone.
Changes xml/cl.xml and xml/registry.rnc only; generated headers are byte-identical (the attribute is metadata no current generator reads).
Chose not to implement the group property at the container level to avoid breaking the existing tooling.