[clang] [clang] Fix inconsistencies with the device_kernel attr on different targets (PR #161905)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 7 09:18:09 PDT 2025


jhuber6 wrote:

> I missed the previous PRs that lumped all of these attributes together. I think `sycl_kernel` should have been left separate as it isn't directly used to declare a device function. It instead has rather complicated semantics that result in a function that is used on the host as well as a synthesized device function (with a different name, different parameters, and a hard-coded calling convention). However, `sycl_kernel` is also destined to go away in favor of the `sycl_kernel_entry_point` attribute.

I'd say we could just rename it to `spirv_kernel` to avoid the confusion, but I'm honestly not sure we need the special names if we just accept `device_kernel` to mean "externally callable thing in a GPU context." Possibly we could even make this generic on all targets if we just make it imply non-hidden visibility, since that would make a function 'callable' in this context.

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


More information about the cfe-commits mailing list