|
| 1 | +# Considerations for working on KHR extensions |
| 2 | + |
| 3 | +SYCL specification evolves through embedding extensions developed by various |
| 4 | +vendors, including Khronos Group itself (`khr` extensions). |
| 5 | + |
| 6 | +In order for a KHR extension to be accepted, there must be CTS tests for it and |
| 7 | +at least one implementation which passes them. |
| 8 | + |
| 9 | +Considering that KHR extensions are being developed in public, we can start |
| 10 | +prototyping them as soon as corresponding PR for an extension is published at |
| 11 | +KhronosGroup/SYCL-Docs. |
| 12 | + |
| 13 | +However, we shouldn't be exposing those extensions to end users until the |
| 14 | +extension if finalised, ratified and published by Khronos - due to risk of an |
| 15 | +extension changing during that process and lack of the officially published |
| 16 | +version of it. |
| 17 | + |
| 18 | +So, we can have a PR but can't merge it. Keeping PRs opened for a long time is a |
| 19 | +bad practice, because they tend to get stale: there are merge conflicts, |
| 20 | +potential functional issues due to the codebase changes, etc. |
| 21 | + |
| 22 | +In order for us to avoid stale PRs, all functionality which is a public |
| 23 | +interface of an "in-progress" KHR extension, must be hidden under |
| 24 | +`__DPCPP_ENABLE_UNFINISHED_KHR_EXTENSIONS` macro. That way we can merge a PR to |
| 25 | +avoid constantly maintaining it in a good shape, start automatically testing it |
| 26 | +but at the same time avoid exposing incomplete and/or undocumented feature to |
| 27 | +end users just yet. |
| 28 | + |
| 29 | +"in-progress" KHR extension term used above is defined as: |
| 30 | +- PR proposing a KHR extension has not been merged/cherry-picked to `sycl-2020` |
| 31 | + branch of KhronosGroup/SYCL-Docs. |
| 32 | + |
| 33 | + That only happens after all formal processes on Khronos Group side are |
| 34 | + completed so an extension can be considered good and stable to be released by |
| 35 | + us. |
| 36 | + |
| 37 | + Note: merge of an extension proposal PR into `main` branch of |
| 38 | + KhronosGroup/SYCL-Docs repo is **not** enough. |
| 39 | +- Published (i.e. the above bullet complete) KHR extension, which hasn't been |
| 40 | + fully implemented by us |
| 41 | + |
| 42 | +The macro is **not** intended to be used by end users and its purpose is to |
| 43 | +simplify our development process by allowing us to merge implementation (full |
| 44 | +or partial) of the aforementioned extensions earlier to simplify maintenance and |
| 45 | +enable automated testing. |
| 46 | + |
| 47 | +Due to this reason, we are not providing a separate macro for each "in-progress" |
| 48 | +KHR extension we may (partially) support, but just a single guard. |
0 commit comments