-
Notifications
You must be signed in to change notification settings - Fork 69
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
Should be sycl::vec::as<bool> clarified/prohibited? #455
Labels
clarification
Something is unclear
Comments
deprecate in future and use static casts to give alternative? |
Just adding for information a link to the relevant part in the current C++ specification draft https://eel.is/c++draft/bit.cast |
use C++ std::bit.cast |
KornevNikita
added a commit
to KornevNikita/SYCL-CTS
that referenced
this issue
Aug 18, 2023
KornevNikita
added a commit
to KornevNikita/SYCL-CTS
that referenced
this issue
Aug 18, 2023
Awaiting PR on spec to clarify this. Already removed the test in the CTS. |
This was referenced Feb 13, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After recent SYCL-CTS change, we've noticed that here we're calling
sycl::vec::as<bool>
for differentsycl::vec<T>
, where T is char, int, float and so on, like:Looks like it's not legal. SYCL2020 defines
template <typename asT> asT as() const
method as:According to https://en.cppreference.com/w/cpp/numeric/bit_cast:
If there is no value of type To corresponding to the value representation produced, the behavior is undefined.
So, it looks like
as<bool>
should be prohibited as it's UB.The text was updated successfully, but these errors were encountered: