-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL] Made access::decorated::no default for get_multi_ptr. #9735
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] Made access::decorated::no default for get_multi_ptr. #9735
Conversation
Signed-off-by: JackAKirk <jack.kirk@codeplay.com>
What are the arguments to set default to "access::decorated::no" as opposed to "access::decorated::yes"? |
As I understand it in most cases CC @ProGTX in case there is anything more to add to this. |
@JackAKirk, do you have specific example of when decorated::yes can have undesirable secondary side effect and what is the effect? |
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 joint matrix tests were changed in #8874 from:
accC.get_pointer()
to:
accC.template get_multi_ptraccess::decorated::no().
Should we change these to remove the template argument as access::decorated::no is the default now? This will make the syntax more concise.
I don't, but I was told that there are some examples. Point is that there should be a default whether it is |
Yes this is the point. I opened this PR to try to resolve this and raise a discussion to set the default. But when a default is chosen we should definitely update tests etc to make them more concise. If Da Vinci read these tests I don't think he would be happy: the quote is "simplicity is the ultimate sophistication". |
break badly with template / type traits. This doesn't work for instance. template<typename T>
void foo(T* p) {
static_assert(std::numeric_limits<T>::is_integer);
}
[...]
auto* ptr = accessor_to_int.get_multi_ptr<access::decorated::yes>();
foo(ptr);
With this implementation that is, decorated pointers are entirely implementation defined so it is also bad for portability (they may not be decorated at all actually). |
According to the SYCL 2020 (at least the one I'm reading) there is no default value for the method, neither |
@JackAKirk if decorated is no, does it mean we are not passing address space information to SPIRV and underlying layers? |
The decoration flag is only controlling the exposed interface, not what the multi_ptr holds. Its sole purpose is to portably carry that address space around. |
I see here that the spirv functions take the decorated pointer type, but also that you seem to support the multi_ptr decorated::no case because you call Possibly I am misunderstanding things? I was initially thrown by this: #9496 but then I realized that the cuda implementation doesn't need decorated pointer at all. Cuda implementation is loading the correct address space ptx without #9499. |
I verified on a Joint Matrix test case that even if I set decorated::no, I still see correct address space in IGC LLVM IR, so default "no" should not impact Joint Matrix in IGC. But does this change (adding default) conform to SYCL 2020 standard? I second Dmitry's question about introducing non-standard API. |
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.
According to the SYCL 2020 (at least the one I'm reading) there is no default value for the method, neither
::yes
nor::no
. So why do we even have it in our APIs?
But does this change (adding default) conform to SYCL 2020 standard? I second Dmitry's question about introducing non-standard API.
+1
This goes against the current SYCL 2020 specification (Table 57). You may ask specification writers (e.g., @jbrodman and @gmlueck) to make this change in the spec or create an issue against spec. If the spec change will be approved and merged, the current patch with implementation can be applied.
OK I've made a sycl-docs issue. |
closed by #10174 |
At the moment users always need to specify the decorated mode (on/off) for
get_multi_ptr()
, which is not ideal, since it is an unnecessary complication since in common usage SYCL programmers do not need to worry aboutaccess::decorated
. From what I can tell it seems that it was intended to have a default valueaccess::decorated::no
.