Skip to content

[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

Merged
merged 22 commits into from
Dec 14, 2023

Conversation

fineg74
Copy link
Contributor

@fineg74 fineg74 commented Oct 27, 2023

No description provided.

@fineg74 fineg74 requested a review from a team as a code owner October 27, 2023 00:08
@fineg74 fineg74 temporarily deployed to WindowsCILock October 27, 2023 00:09 — with GitHub Actions Inactive
@fineg74 fineg74 temporarily deployed to WindowsCILock October 27, 2023 00:31 — with GitHub Actions Inactive
# 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
Copy link
Contributor

@v-klochkov v-klochkov left a 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
… 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> &&
Copy link
Contributor

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.

Copy link
Contributor

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:

static_assert(std::is_integral_v<Toffset>, "Unsupported offset 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 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.

Copy link
Contributor

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

Copy link
Contributor Author

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,
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

@v-klochkov v-klochkov left a 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).

v-klochkov
v-klochkov previously approved these changes Dec 13, 2023
@v-klochkov v-klochkov dismissed their stale review December 13, 2023 23:23

Need to fix "error: use of undeclared identifier 'Tx" error.

@v-klochkov v-klochkov merged commit ba44e2e into intel:sycl Dec 14, 2023
@fineg74 fineg74 deleted the accessorCheck3 branch December 14, 2023 02:23
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