-
Notifications
You must be signed in to change notification settings - Fork 68
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
Load on vec does not allow pointer to non-const data. #540
Comments
We had a similar issue with
It seems like we would want to make a similar change to
@AerialMantis, I think you were looking at the "const" issues with |
I'm wondering whether this should indeed be solved in template <typename OtherElementType,
typename = std::enable_if_t<std::is_same_v<OtherElementType, std::add_const_t<ElementType>> ||
std::is_same_v<OtherElementType, std::add_volatile_t<ElementType>>>>
operator multi_ptr<OtherElementType, Space, DecorateAddress>() const; Users would expect to be able to call a function receiving |
@victor-eds: We already have these implicit conversions in |
True, then the two overloads look like a better solution. Omit my comment 👍 |
The
load
member function onsycl::vec
takes amulti_ptr<const DataT, ...>
which seems to written that way to allow pointers with and withoutconst
data. However, because the function is dependent, the conversion frommulti_ptr<DataT, ...>
tomulti_ptr<const DataT, ...>
cannot be resolved. See https://godbolt.org/z/dTdc6K7a9.Possible solution: Make two overloads of
load
- one withmulti_ptr<std::remove_const_t<DataT>, ...>
and one withmulti_ptr<std::add_const_t<DataT>, ...>
. See https://godbolt.org/z/xs175dc7v.Inspired by KhronosGroup/SYCL-CTS#870.
The text was updated successfully, but these errors were encountered: