-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL][UX] Diagnostic for undefined device functions #1026
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
Changes from all commits
3ff2deb
699b77e
46a90ca
768f44f
30c66dd
22ac951
a355390
d37a0c3
19ec821
96945e4
b6abd6c
d3a0b94
0c2ba82
ec27d5a
4ff23c4
444e30e
9121b3b
0f8e11a
9fc0f2a
8cc61f9
d5f3c07
e03d71c
d2a57a4
a9077dc
423aa08
c13c7ae
e956ef3
86241ca
4303df4
0f4a972
1ed0f9d
bf9897d
ad87643
49b3671
c0002be
7ad4529
31d10c8
a5f1e73
ed494da
ac9d797
fb214af
28afc0d
f514a83
ff3692d
1c4a66f
eabbf41
48b7653
11db09c
3063419
a78909d
7a4639a
bba50f2
a806343
cdfee11
e72badd
283b638
68af609
98f3ef3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18016,6 +18016,12 @@ Decl *Sema::getObjCDeclContext() const { | |
} | ||
|
||
Sema::FunctionEmissionStatus Sema::getEmissionStatus(FunctionDecl *FD) { | ||
// Due to SYCL functions are template we check if they have appropriate | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't seem to be a full sentence. Word missing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't see what is missing in "Due to SYCL functions are template we check if they have appropriate attribute prior to checking if it is a template" |
||
// attribute prior to checking if it is a template | ||
if (LangOpts.SYCLIsDevice && | ||
(FD->hasAttr<SYCLDeviceAttr>() || FD->hasAttr<SYCLKernelAttr>())) | ||
return FunctionEmissionStatus::Emitted; | ||
|
||
// Templates are emitted when they're instantiated. | ||
if (FD->isDependentContext()) | ||
return FunctionEmissionStatus::TemplateDiscarded; | ||
|
@@ -18080,6 +18086,23 @@ Sema::FunctionEmissionStatus Sema::getEmissionStatus(FunctionDecl *FD) { | |
return FunctionEmissionStatus::Emitted; | ||
} | ||
s-kanaev marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
if (getLangOpts().SYCLIsDevice) { | ||
if (!FD->hasAttr<SYCLDeviceAttr>() && !FD->hasAttr<SYCLKernelAttr>()) | ||
return FunctionEmissionStatus::Unknown; | ||
|
||
// Check whether this function is externally visible -- if so, it's | ||
// known-emitted. | ||
// | ||
// We have to check the GVA linkage of the function's *definition* -- if we | ||
// only have a declaration, we don't know whether or not the function will | ||
// be emitted, because (say) the definition could include "inline". | ||
FunctionDecl *Def = FD->getDefinition(); | ||
|
||
if (Def && | ||
!isDiscardableGVALinkage(getASTContext().GetGVALinkageForFunction(Def))) | ||
return FunctionEmissionStatus::Emitted; | ||
} | ||
|
||
// Otherwise, the function is known-emitted if it's in our set of | ||
// known-emitted functions. | ||
return (DeviceKnownEmittedFns.count(FD) > 0) | ||
|
Uh oh!
There was an error while loading. Please reload this page.