[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
Wed Dec 10 08:51:21 PST 2025
================
@@ -17,6 +17,21 @@
using namespace clang;
using namespace CodeGen;
+void CodeGenFunction::EmitSYCLKernelCallStmt(const SYCLKernelCallStmt &S) {
+ if (getLangOpts().SYCLIsDevice) {
+ // A sycl_kernel_entry_point attributed function is unlikely to be emitted
+ // during device compilation, but might be if it is ODR-used from device
+ // code that is emitted. In these cases, the function is emitted with an
+ // empty body; the original body is emitted in the offload kernel entry
+ // point and the synthesized kernel launch code is only relevant for host
+ // compilation.
+ return;
----------------
tahonermann wrote:
That is a good idea. I'll poke around to see if I can find a good option.
https://github.com/llvm/llvm-project/pull/152403
More information about the cfe-commits
mailing list