-
Notifications
You must be signed in to change notification settings - Fork 808
[SYCL] Add sycl::detail::bit_cast implementation #1762
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] Add sycl::detail::bit_cast implementation #1762
Conversation
Signed-off-by: Dmitry Vodopyanov <[email protected]>
Signed-off-by: Dmitry Vodopyanov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have any major objections, but would like to hear feedback from @Pennycook
Signed-off-by: Dmitry Vodopyanov <[email protected]>
Signed-off-by: Dmitry Vodopyanov <[email protected]>
Please, do not forget to update sycl/doc/extensions/README.md with a new status of this extension. |
Could you please add a little bit more information in the commit message: what bitcast does and what it is lowered to depending on the compiler used. |
Signed-off-by: Dmitry Vodopyanov <[email protected]>
…st spec Signed-off-by: Dmitry Vodopyanov <[email protected]>
@romanovvlad, done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Dmitry Vodopyanov <[email protected]>
eb92988
Signed-off-by: Dmitry Vodopyanov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for making all the changes.
Signed-off-by: Dmitry Vodopyanov <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@dm-vodopyanov, could you update the description, please? I think it's doesn't exactly match the patch. |
@bader thanks, found a mistake in description (renamed sycl::intel::bit_cast to sycl::detail::bit_cast). Everything else looks good for me. If something else should be added/removed, please tell me. |
Implementing SYCL_INTEL_bitcast extension which reinterprets the bits of an object as an object of a different data type calling the sycl::detail::bit_cast function. This function has the same specification as std::bit_cast, defined by C++20.
sycl::detail::bit_cast calls std::bit_cast if __cpp_lib_bit_cast macro is enabled, otherwise, it calls __builtin_bit_cast builtin for oneAPI Data Parallel C++ compiler and sycl::detail::memcpy function for other compilers.