-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL][ESIMD] Add more stringent compile time checks to atomic_update API #11683
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
Conversation
# Conflicts: # sycl/include/sycl/ext/intel/esimd/memory.hpp
# Conflicts: # sycl/include/sycl/ext/intel/esimd/memory.hpp
Fix several issues with the existing API
# Conflicts: # sycl/include/sycl/ext/intel/esimd/memory.hpp
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.
Please see some comment below.
# Conflicts: # sycl/include/sycl/ext/intel/esimd/memory.hpp
Co-authored-by: Vyacheslav Klochkov <[email protected]>
Co-authored-by: Vyacheslav Klochkov <[email protected]>
Co-authored-by: Vyacheslav Klochkov <[email protected]>
… accessorCheck3 # Conflicts: # sycl/include/sycl/ext/intel/esimd/memory.hpp
@@ -5716,10 +5707,9 @@ template <atomic_op Op, typename T, int N, typename Toffset, | |||
typename AccessorTy, | |||
typename PropertyListT = | |||
ext::oneapi::experimental::detail::empty_properties_t> | |||
__ESIMD_API __ESIMD_API std::enable_if_t< | |||
__ESIMD_DNS::get_num_args<Op>() == 0 && std::is_integral_v<Toffset> && |
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.
Is removing the is_integral_v
check international? I see it in a few places and just want to make sure.
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 change here is good. It is better to let this function be matched and be lowered to (acc-au0-1) where the check already exists:
llvm/sycl/include/sycl/ext/intel/esimd/memory.hpp
Line 5731 in 6a74b23
static_assert(std::is_integral_v<Toffset>, "Unsupported offset type"); |
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 mean static_assert
with a meaningful user-friendly error is better, than error "could not match" with a long list of prototypes that could not be matched.
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.
It's removed in many places, so lets at least make sure every call tree has the static assert somewhere
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.
That was the purpose of removing it as it doesn't make sense to have it both as static_assert and as a condition in enable_if_t
typename RegionTy = region1d_t<T, N, 1>, | ||
typename PropertyListT = | ||
ext::oneapi::experimental::detail::empty_properties_t> | ||
template <atomic_op Op, typename Tx, int N, typename Toffset, |
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.
Can we use T instead of Tx? We fixed that in most places when updating to the new APIs but might have missed it here.
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.
Done
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.
Looks good to me. I have only 1 nit comment for intendations in comment-sections (the noticed pattern is met several times in the code).
Need to fix "error: use of undeclared identifier 'Tx" error.
No description provided.