Skip to content
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

Fix 1-element vec ambiguities #38

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

GagaLP
Copy link
Contributor

@GagaLP GagaLP commented Jan 27, 2025

This is the third part of a series of four pull requests addressing some SYCL clarifications for sycl::vec.

This pull request implements the behavior specified in KhronosGroup/SYCL-Docs#670 (comment), which resolves ambiguities for 1-element sycl::vec.

@GagaLP GagaLP requested review from PeterTh and fknorr January 27, 2025 18:08
Comment on lines +238 to +240
template<typename T>
swizzled_vec &operator=(const T &rhs)
requires(allow_assign && std::convertible_to<T, value_type>)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
template<typename T>
swizzled_vec &operator=(const T &rhs)
requires(allow_assign && std::convertible_to<T, value_type>)
template<std::convertible_to<value_type> T>
swizzled_vec &operator=(const T &rhs)
requires(allow_assign)

Comment on lines +545 to +548
template<typename T>
vec &operator=(const T &rhs)
requires(std::convertible_to<T, DataT>)
{
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
template<typename T>
vec &operator=(const T &rhs)
requires(std::convertible_to<T, DataT>)
{
template<std::convertible_to<DataT> T>
vec &operator=(const T &rhs)
{

Comment on lines +763 to +765
template<typename T> \
friend vec operator op(const vec &lhs, const T &rhs) \
requires(enable_if && std::convertible_to<T, DataT>) \
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
template<typename T> \
friend vec operator op(const vec &lhs, const T &rhs) \
requires(enable_if && std::convertible_to<T, DataT>) \
template<std::convertible_to<DataT> T> \
friend vec operator op(const vec &lhs, const T &rhs) \
requires(enable_if) \

(same for overloads below)

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