Skip to content

[ESIMD] Fix is_esimd_arithmetic_type internal problem. #4826

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 1 commit into from
Oct 27, 2021

Conversation

kbobrovs
Copy link
Contributor

@kbobrovs kbobrovs commented Oct 27, 2021

In some cases 'computation_type_t' meta-function call lead to call to this
template struct is_esimd_arithmetic_type<
Ty, __esimd_void_t<std::enable_if_t<std::is_arithmetic_v>,
decltype(std::declval() + std::declval()),
...>>
meta-function with Ty being a simd type, which caused
decltype(std::declval() + std::declval()) to fail (it is not supposed to
be invoked with a simd type).

The fix is to enable SFINAE in is_esimd_arithmetic_type in the case when std::is_arithmetic_v is false, and therefore the second partial specialization of is_esimd_arithmetic_type won't participate in resolution.

Signed-off-by: Konstantin S Bobrovsky [email protected]

In some cases 'computation_type_t' meta-function call lead to call to this
template <class Ty> struct is_esimd_arithmetic_type<
    Ty, __esimd_void_t<std::enable_if_t<std::is_arithmetic_v<Ty>>,
                       decltype(std::declval<Ty>() + std::declval<Ty>()),
					   ...>>
meta-function with Ty being a simd type, which caused
decltype(std::declval<Ty>() + std::declval<Ty>()) to fail (it is not supposed to
be invoked with a simd type).

Signed-off-by: Konstantin S Bobrovsky <[email protected]>
@kbobrovs kbobrovs merged commit 0e72f02 into intel:sycl Oct 27, 2021
@kbobrovs kbobrovs deleted the computation_type_t branch November 25, 2021 05:16
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