-
Notifications
You must be signed in to change notification settings - Fork 790
[SYCL][Doc] Update address_cast specification #12689
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][Doc] Update address_cast specification #12689
Conversation
Signed-off-by: John Pennycook <[email protected]>
Signed-off-by: John Pennycook <[email protected]>
Signed-off-by: John Pennycook <[email protected]>
template <access::address_space Space, | ||
typename ElementType> | ||
multi_ptr<ElementType, Space, DecorateAddress> | ||
multi_ptr<ElementType, Space, access::decorated::no> | ||
static_address_cast(ElementType* ptr); |
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.
out of curiosity, why removing the possibility to select the yes/no decoration ?
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.
The logic was that there shouldn't be two ways to do the same thing, because that's harder to teach.
Before this change, *_address_cast
functions could be used to cast between address spaces and to introduce decoration. Now, they can only be used to cast between address spaces, which is aligned with their name.
multi_ptr
already provides interfaces to move between decorated and undecorated pointers (via implicit casts), so we don't need to handle it here as well.
@intel/llvm-gatekeepers I think this can be merged now. |
Reflects spec changes from intel#12689
Reflects spec changes from #12689
This PR contains three improvements to the specification:
This allows developers using generic raw pointers to cast to
multi_ptr
without worrying about decoration:...or to opt-in to decoration by using a generic multi-pointer, which propagates decoration information: