Skip to content

[NFC][SYCL] Use get_elem_type_t instead of TryToGetElementType<T>::type #12738

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

Merged
merged 2 commits into from
Feb 20, 2024

Conversation

aelovikov-intel
Copy link
Contributor

No description provided.

public:
using type = decltype(check(T()));
static constexpr bool value = !std::is_same_v<T, type>;
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we keep TryToGetElementType?

Copy link
Contributor Author

@aelovikov-intel aelovikov-intel Feb 19, 2024

Choose a reason for hiding this comment

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

It has a single remaining use just below at line 650. Note that it's ::value, not ::type so I can't do the same replacement as in other places of this PR. I think it's possible to replace that as well somehow, but I've decided to wait until we can drop legacy builtins implementation and remove it after that.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. I personally think value in this is unintuitive, so I would prefer we replace it, if nothing else then by just replacing the use with !std::is_same_v<T, get_elem_type_t<T>>.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not immediately obvious if that would be an NFC or not, so I won't be doing it here.

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.

I am fine with my comment being addressed separately, but I also don't think it necessarily muddies this PR too much to just inline the one remaining use case.

public:
using type = decltype(check(T()));
static constexpr bool value = !std::is_same_v<T, type>;
};
Copy link
Contributor

Choose a reason for hiding this comment

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

I see. I personally think value in this is unintuitive, so I would prefer we replace it, if nothing else then by just replacing the use with !std::is_same_v<T, get_elem_type_t<T>>.

@aelovikov-intel aelovikov-intel merged commit 39639f6 into intel:sycl Feb 20, 2024
@aelovikov-intel aelovikov-intel deleted the get-elem-type-t branch February 20, 2024 21:34
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.

3 participants