[llvm] [libsycl] SYCL Extension naming policy. (PR #226967)
Kseniya Tikhomirova via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 5 05:04:38 PDT 2026
================
@@ -31,3 +31,90 @@ Coding Standards.
files in directories `cmake/modules` and `docs` should be named in camel
case.
+### Extension Naming Policy
+
+The SYCL 2020 specification gives every vendor extension a vendor string. The
+extension's APIs are declared in the `sycl::ext::<vendor>` namespace, its
+feature-test macro is `SYCL_EXT_<VENDOR>_<NAME>`, and any enumerators or members
+it adds to core SYCL classes (for example aspects) are prefixed with
+`ext_<vendor>_`.
+
+The vendor string tells users who defines the behavior of the feature. libsycl
+picks it by that rule, not by who wrote the implementation.
+
+| Origin of the extension | Vendor string |
+| ------------------------------------------------------------- | ---------------------------------------------- |
+| Not defined by any vendor: designed in the LLVM community | `llvm` |
+| Defined by another vendor and implemented as specified | The original one (e.g. `oneapi`, `intel`) |
+| Defined by another vendor, but libsycl intentionally deviates | `llvm`, only after the deviation is justified |
+| Ratified by Khronos | `khr` |
+
+#### Community Extensions
+
+An extension that the LLVM community designs itself uses the `llvm` vendor
+string, for example `sycl::ext::llvm::<name>` with the feature-test macro
+`SYCL_EXT_LLVM_<NAME>`. The community determines what such a feature is, so its
+specification must be reviewed and committed together with the implementation.
+
+#### Extensions Adopted From Another Vendor
+
+When libsycl implements an extension defined by another vendor with the intent
+to match it, the extension keeps its original name. For example, the
+`sycl_ext_oneapi_<name>` extension from intel/llvm is implemented as
+`sycl::ext::oneapi::<name>` with the feature-test macro
+`SYCL_EXT_ONEAPI_<NAME>`. The original vendor's specification defines the
+feature:
+
+- Any behavioral difference from that specification is a libsycl bug.
+- The implementation refers to the specification and to the revision of it that
+ is implemented.
+- The feature-test macro is defined, with the value of the implemented revision,
+ only once that revision is fully implemented. Until then, the missing parts
+ are listed in `libsycl/docs/index.md`.
+- Differences that the specification does not make observable, such as
+ implementation details, unspecified behavior, or diagnostic wording, are not
+ deviations.
+- If the specification appears to be wrong, the problem is raised with the
+ vendor that owns it rather than fixed only in libsycl.
+- New revisions of the specification are followed. An incompatible revision is
+ implemented by updating to it and to its feature-test macro value.
----------------
KseniyaTikhomirova wrote:
yes, you got the idea right, thanks for proposal of better wording, updated
https://github.com/llvm/llvm-project/pull/226967
More information about the llvm-commits
mailing list