-
Notifications
You must be signed in to change notification settings - Fork 768
[SYCL] Correct spec about constness of get(properties_tag) member and add respective warning #17947
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
Conversation
…respective warning Signed-off-by: Hu, Peisen <[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.
UR LGTM
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.
Graph changes LGTM!
Signed-off-by: Hu, Peisen <[email protected]>
Requesting @intel/llvm-gatekeepers to merge this. Thanks! |
@@ -338,7 +338,7 @@ struct KernelFunctor { | |||
a[i] = b[i] + c[i]; | |||
} | |||
|
|||
auto get(sycl::ext::oneapi::experimental::properties_tag) { | |||
auto get(sycl::ext::oneapi::experimental::properties_tag) const { |
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.
@Pennycook , I think there was some other PR where it was decided that kernel properties can't be runtime. Should we change this to static constexpr
instead?
Currently some of our docs suggest using
get(properties_tag) {...}
member in kernel functors to specify kernel properties while some suggest usingget(properties_tag) const {...}
. But actuallyget(properties_tag) {...}
might not work under certain conditions, so we should update the incorrect docs that they suggest readers to useget(properties_tag) const {...}
rather thanget(properties_tag) {...}
.Also as @Pennycook suggested, added a diagnostic warning to indicate the user when:
-they have declared a
get(properties_tag)
member in the kernel functorAND
-they declared
get(properties_tag){...}
rather thanget(properties_tag) const {...}
Updated the tests containing the non-const version of
get(properties_tag)
as well.