-
Notifications
You must be signed in to change notification settings - Fork 740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SYCL] Refactor compile-time properties' detail::
traits
#16099
[SYCL] Refactor compile-time properties' detail::
traits
#16099
Conversation
* Prefer to perform the check on values and not keys * Use `std::is_empty_v` to distinguish between compile/run-time properties * Remove unused traits (including the ones that became such after changes above) Technically, I'm (almost?) able to remove the `compile_time_property_key` and `run_time_property_key` base classes at this point, but I'd prefer to do that later once `property_value` template is removed from the spec too, as both of these changes will require updating all the properties and I'd rather do that once.
bd56319
to
824b517
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a reasonable cleanup! Only one smallish concern about readability for future readers.
// check if a compile-time property is valid for annotated_ptr | ||
static_assert(!detail::IsCompileTimePropertyValue<Prop>::value || | ||
is_valid_property<T *, Prop>::value, | ||
static_assert(!std::is_empty_v<Prop> || is_valid_property<T *, Prop>::value, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we consider aliasing std::is_empty_v
to make the use of it here clearer? It might not be clear that it has to do with whether or not the property has runtime contents.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but ideally we need to refactor it one level higher - this entire trait needs to lifted to C++17 at the very least (with pack expansion).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
std::is_empty_v
to distinguish between compile/run-time propertiesTechnically, I'm (almost?) able to remove the
compile_time_property_key
andrun_time_property_key
base classes at this point, but I'd prefer to do that later onceproperty_value
template is removed from the spec too, as both of these changes will require updating all the properties and I'd rather do that once.