[clang] [SYCL] SYCL host kernel launch support for the sycl_kernel_entry_point attribute. (PR #152403)

Tom Honermann via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 20 22:19:42 PST 2025


================
@@ -683,24 +696,55 @@ There are a few items worthy of note:
    or more parameters depending on how the SYCL library implementation defines
    these types.
 
-#. The call to ``kernel_entry_point()`` has no effect other than to trigger
-   emission of the entry point function. The statments that make up the body
-   of the function are not executed when the function is called; they are
-   only used in the generation of the entry point function.
+The call to ``kernel_entry_point()`` by ``single_task()`` is effectively
+replaced with synthesized code that looks approximately as follows.
+
+.. code-block:: c++
+
+  sycl::stream sout = Kernel.sout;
+  S s = Kernel.s;
+  sycl_kernel_launch<KN>("kernel-symbol-name", sout, s);
----------------
tahonermann wrote:

The kernel name is provided mainly for convenience. Without it, if the SYCL library had a need for it (which it might not), obtaining it would require that `sycl_kernel_launch()` be a member of a class template parameterized by the kernel name and that seems overly restrictive to me. Passing it in maintains consistency with SYCL kernel invocation functions generally.

https://github.com/llvm/llvm-project/pull/152403


More information about the cfe-commits mailing list