Skip to content

implement pretty printing for ur_device_partition_property_t and ur_queue_property_t #412

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
pbalcer opened this issue Apr 4, 2023 · 5 comments
Labels
common Changes or additions to common utilities
Milestone

Comments

@pbalcer
Copy link
Contributor

pbalcer commented Apr 4, 2023

These two types are typedefs to intptr_t and are used for null-terminated arrays of key-value pairs.

    const ur_queue_property_t *pProps, ///< [in][optional] specifies a list of queue properties and their
                                       ///< corresponding values.
                                       ///< Each property name is immediately followed by the corresponding
                                       ///< desired value.
                                       ///< The list is terminated with a 0.
                                       ///< If a property value is not specified, then its default value will be used.
    const ur_device_partition_property_t *pProperties, ///< [in] null-terminated array of <$_device_partition_t enum, value> pairs.
    const ur_queue_property_t props[] = {UR_QUEUE_PROPERTIES_FLAGS, queryFlag,
                                         0};
    ASSERT_SUCCESS(urQueueCreate(context, device, props, &queue));

There doesn't seem to be a way to figure this out in the mako template, so this variable type will probably require a qualifier in desc to distinguish it from other _property_t enum types.

Parsing aside, the same could be achieved with a linked list through pNext, as we do for other things. That would be a bit better from a type safety perspective and consistent with other properties/desc types.

@pbalcer
Copy link
Contributor Author

pbalcer commented Apr 4, 2023

@kbenzie do you think it would make sense to refactor these two properties to use the linked list approach?

@pbalcer
Copy link
Contributor Author

pbalcer commented Apr 4, 2023

Just noticed that ur_device_partition_property_t is being changed in #401 :)

@pbalcer pbalcer added the common Changes or additions to common utilities label Apr 4, 2023
@kbenzie
Copy link
Contributor

kbenzie commented Apr 5, 2023

@kbenzie do you think it would make sense to refactor these two properties to use the linked list approach?

yes, I've not got round to updating urQueueCreate yet but do intend to soon.

@kbenzie
Copy link
Contributor

kbenzie commented Apr 5, 2023

I've updated urQueueCreate in #414.

@pbalcer
Copy link
Contributor Author

pbalcer commented Jun 6, 2023

And Petr changed partitions in #536, so we can close this.

@pbalcer pbalcer closed this as completed Jun 6, 2023
@kbenzie kbenzie added this to the 0.7 milestone Aug 3, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
common Changes or additions to common utilities
Projects
None yet
Development

No branches or pull requests

2 participants