-
Notifications
You must be signed in to change notification settings - Fork 796
[SYCL] Remove generic_type_lists.hpp
#15714
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] Remove generic_type_lists.hpp
#15714
Conversation
We don't need to instantiate all the `vec`/`marray` types to implement `generic_type_traits.hpp`.
| inline __SYCL_ALWAYS_INLINE std::enable_if_t< | ||
| sycl::detail::is_contained< | ||
| T, sycl::ext::oneapi::experimental::cuda::detail::ldg_types>::value, | ||
| detail::check_type_in_v<detail::element_type_t<T>, char, signed char, short, |
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.
I think this part isn't NFC in a sense that gtl::scalar_floating_list on the left included bfloat16 but the code in this file hasn't been adjusted to actually handle it when it was added there. As such, the change here is actually good.
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.
Should we leave a TODO reminding it on code?
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.
IMO, that's up to the @intel/llvm-reviewers-cuda to decide if any changes are necessary here.
maarquitos14
left a comment
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, just one nit.
| inline __SYCL_ALWAYS_INLINE std::enable_if_t< | ||
| sycl::detail::is_contained< | ||
| T, sycl::ext::oneapi::experimental::cuda::detail::ldg_types>::value, | ||
| detail::check_type_in_v<detail::element_type_t<T>, char, signed char, short, |
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.
Should we leave a TODO reminding it on code?
| template <typename T> | ||
| inline constexpr bool is_sgenfloat_v = | ||
| is_contained_v<T, gtl::scalar_floating_list>; | ||
| check_type_in_v<T, float, double, half, ext::oneapi::bfloat16>; |
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.
given that you replace is_contained_v with check_type_in_v its implementation should probably be changed to the is_base_of way of checking membership for best performance
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.
Yeah, I'll look into that separately.
|
@npmiller , @intel/llvm-reviewers-cuda , ping, you're the last approval needed. |
npmiller
left a comment
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.
CUDA changes LGTM
We don't need to instantiate all the
vec/marraytypes to implementgeneric_type_traits.hpp.