-
Notifications
You must be signed in to change notification settings - Fork 787
[WIP][SYCL] Update usage rules of SYCL_EXTERNAL #962
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
[WIP][SYCL] Update usage rules of SYCL_EXTERNAL #962
Conversation
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.
Maybe we need CodeGen test too.
This patch allows to apply `SYCL_EXTERNAL` to class member functions, but only if they weren't declared as virtual or as pure virtual. The same logic was applied to `[[intel::device_indireclty_callable]]`. Signed-off-by: Alexey Sachkov <[email protected]>
d6dde51
to
cd4ea6c
Compare
// must be emitted regardless of number of actual uses | ||
if (LangOpts.SYCLIsDevice && isa<CXXMethodDecl>(D)) | ||
if (auto *A = D->getAttr<SYCLDeviceAttr>()) | ||
return !A->isImplicit(); |
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.
Not sure if it worth to check for explicit SYCLDeviceAttr
. Also, it would be good to hear feedback about this if
in general: is it the right place and proper if
?
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'm ok with the place. I believe that in a happy future we will outline device code in other way: do this in CodeGen like OpenMP. We already try to do this in llorg, and we do some changes in this function for this.
So, could you please make your changes to this function not conflicting with https://reviews.llvm.org/D71016#change-cNmcQq4FKHx8 ?
And, I'm not sure that checking for explicit SYCLDeviceAttr
is needed.
@@ -3,6 +3,15 @@ | |||
|
|||
int bar(int b); | |||
|
|||
class A { | |||
public: | |||
// TODO: check for constructor/destructor as well |
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.
One more TODO
: check how it works for class templates and class member templates
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.
One more TODO: check how it works for class templates and class member templates
Not sure that it's so hard to defer it to another patch.
@Fznamznon ping |
Will be implemented in #1295 |
This patch allows to apply
SYCL_EXTERNAL
to class member functions,but only if they weren't declared as virtual or as pure virtual.
The same logic was applied to
[[intel::device_indireclty_callable]]
.