-
Notifications
You must be signed in to change notification settings - Fork 738
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] Make mutable swizzle functions unusable on const vec #13026
[SYCL] Make mutable swizzle functions unusable on const vec #13026
Conversation
In intel#12682 the mutating operators for swizzles (+=, -=, ..., ++, --) were reverted to be members rather than friends. Since swizzles mutate the underlying vec rather than themselves these operators should take and return constant references instead, which this commit implements. Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Swizzles should not expose mutating functions when the underlying vector is const. This commit SFINAEs these out. This is built on top of intel#13012. Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
I didn't really review the code closely, but I ran some test cases. Everything looked good, except this one which won't compile:
It seems like the |
Good find! Adding those can be done in separation, as I have done here: #13040 |
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
KhronosGroup/SYCL-Docs#514 has been merged. This is ready for review! Keep in mind that it is based on #13012. |
Discussing this with Andrei, we agreed that the proposed variant was too intrusive on the signatures compared to the new spec definitions. Instead, I have moved the operators to new base-classes, which are in turn specialized to match the requirements of the various operators. Note: I included the changes as part of the merge commit by accident. |
Swizzles should not expose mutating functions when the underlying vector
is const. This commit SFINAEs these out.
This is built on top of #13012.