[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 23 06:10:53 PDT 2025
================
@@ -476,6 +476,47 @@ The SYCL kernel in the previous code sample meets these expectations.
}];
}
+def SYCLExternalDocs : Documentation {
+ let Category = DocCatFunction;
+ let Heading = "sycl_external";
+ let Content = [{
+The ``sycl_external`` attribute indicates that a function defined in another
+translation unit may be called by a device function defined in the current
+translation unit or, if defined in the current translation unit, the function
+may be called by device functions defined in other translation units.
+The attribute is intended for use in the implementation of the ``SYCL_EXTERNAL``
+macro as specified in section 5.10.1, "SYCL functions and member functions
+linkage", of the SYCL 2020 specification.
+
+The attribute only appertains to functions and only those that meet the
+following requirements.
----------------
erichkeane wrote:
```suggestion
following requirements:
```
https://github.com/llvm/llvm-project/pull/140282
More information about the cfe-commits
mailing list