Skip to content

[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

Conversation

AlexeySachkov
Copy link
Contributor

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]].

Copy link
Contributor

@Fznamznon Fznamznon left a 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]>
@AlexeySachkov AlexeySachkov force-pushed the private/asachkov/relax-sycl-external branch from d6dde51 to cd4ea6c Compare December 23, 2019 21:14
// must be emitted regardless of number of actual uses
if (LangOpts.SYCLIsDevice && isa<CXXMethodDecl>(D))
if (auto *A = D->getAttr<SYCLDeviceAttr>())
return !A->isImplicit();
Copy link
Contributor Author

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?

Copy link
Contributor

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
Copy link
Contributor Author

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

Copy link
Contributor

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.

@romanovvlad
Copy link
Contributor

@Fznamznon ping

@AlexeySachkov AlexeySachkov changed the title [SYCL] Update usage rules of SYCL_EXTERNAL [WIP][SYCL] Update usage rules of SYCL_EXTERNAL Dec 30, 2019
@AlexeySachkov
Copy link
Contributor Author

Will be implemented in #1295

@AlexeySachkov AlexeySachkov deleted the private/asachkov/relax-sycl-external branch April 1, 2020 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants