Skip to content
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

Merged
merged 2 commits into from
Nov 18, 2024

Conversation

aelovikov-intel
Copy link
Contributor

  • 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.

* 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.
Copy link
Contributor

@steffenlarsen steffenlarsen left a 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,
Copy link
Contributor

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.

Copy link
Contributor Author

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).

Copy link
Contributor

@steffenlarsen steffenlarsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@aelovikov-intel aelovikov-intel merged commit 69572a2 into intel:sycl Nov 18, 2024
13 checks passed
@aelovikov-intel aelovikov-intel deleted the properties-traits branch November 18, 2024 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants