[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)
Tom Honermann via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 11 11:53:35 PDT 2025
================
@@ -1641,6 +1641,13 @@ def DeviceKernel : DeclOrTypeAttr {
}];
}
+def SYCLExternal : InheritableAttr {
+ let Spellings = [Clang<"sycl_external">];
+ let Subjects = SubjectList<[Function], ErrorDiag>;
+ let LangOpts = [SYCLDevice];
----------------
tahonermann wrote:
In restrospect, I think we should allow the `sycl_external` attribute to be present for SYCL host compilation. It won't have an affect on what is emitted on the host side, but will allow for semantic diagnostics to be issued. It might be useful for SYCL implementations like AdaptiveCpp that don't (necessarily) perform a separate device compilation.
```suggestion
let LangOpts = [SYCLHost, SYCLDevice];
```
https://github.com/llvm/llvm-project/pull/140282
More information about the cfe-commits
mailing list